1
0
Fork 0
mirror of https://github.com/Mic92/sops-nix.git synced 2025-03-06 16:47:41 +00:00
sops-nix/.github/workflows/test.yml
2020-07-22 23:34:56 +01:00

40 lines
1.3 KiB
YAML

name: "Test"
on:
pull_request:
push:
schedule:
- cron: '51 2 * * *'
jobs:
tests:
strategy:
matrix:
nixPath:
- nixpkgs=channel:nixos-20.03
- nixpkgs=channel:nixpkgs-unstable
os: [ ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v10
with:
nix_path: "${{ matrix.nixPath }}"
- name: Setup cachix
uses: cachix/cachix-action@v6
with:
name: mic92
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
- name: Show nixpkgs version
run: nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
- name: Run golangci-lint
run: nix-shell --pure --run "golangci-lint run"
if: matrix.nixPath == 'nixpkgs=channel:nixpkgs-unstable'
- name: Build nix packages
run: nix-build release.nix
- name: Run sops-pgp-hook tests
run: nix-shell --pure --run "NIX_PATH=nixpkgs=$(nix-instantiate --find-file nixpkgs) go test ./pkgs/sops-pgp-hook"
- name: Add keys group (needed for go tests)
run: sudo groupadd keys
if: matrix.os == 'ubuntu-latest'
- name: Run sops-install-secrets tests
run: nix-shell --pure --run "$(command -v sudo) unshare --mount --fork go test ./pkgs/sops-install-secrets"
if: matrix.os == 'ubuntu-latest'