1
0
Fork 0
mirror of https://github.com/Mic92/sops-nix.git synced 2024-12-14 11:57:52 +00:00
sops-nix/.github/workflows/test.yml
2020-07-14 11:26:54 +01:00

34 lines
1.1 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
runs-on: ubuntu-latest
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: Build nix packages
run: nix run nixpkgs.nix-build-uncached -c nix-build-uncached default.nix
- name: Add keys group (needed for go tests)
run: sudo groupadd keys
- name: Run sops-install-secrets tests
run: nix-shell --pure --run "$(command -v sudo) unshare --mount --fork go test ./pkgs/sops-install-secrets"
- 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"