diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml new file mode 100644 index 0000000..8516e3f --- /dev/null +++ b/.github/workflows/check.yaml @@ -0,0 +1,32 @@ +name: "Check" +on: + push: + branches: + - "master" + pull_request: + branches: + - "master" + workflow_dispatch: + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v25 + with: + nix_path: nixpkgs=channel:nixos-unstable + extra_nix_config: | + experimental-features = nix-command flakes + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} + - uses: cachix/cachix-action@v14 + with: + name: sunziping2016 + # Create a personal auth token from https://app.cachix.org/personal-auth-tokens, + # login to cachix, and then generate a signing key and provision it. + # cachix authtoken --stdin # paste personal auth token + # cachix generate-keypair sunziping2016 + # gh secret set CACHIX_SIGNING_KEY # paste signing key + signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}" + - run: nix flake show + - run: nix flake check diff --git a/flake.lock b/flake.lock index 6ade011..6463d42 100644 --- a/flake.lock +++ b/flake.lock @@ -204,6 +204,26 @@ "type": "github" } }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1703863825, + "narHash": "sha256-rXwqjtwiGKJheXB43ybM8NwWB8rO2dSRrEqes0S7F5Y=", + "owner": "nix-community", + "repo": "nix-github-actions", + "rev": "5163432afc817cf8bd1f031418d1869e4c9d5547", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-github-actions", + "type": "github" + } + }, "nixago": { "inputs": { "flake-utils": [ @@ -284,6 +304,7 @@ "git-hooks-nix": "git-hooks-nix", "gitignore-nix": "gitignore-nix", "impermanence": "impermanence", + "nix-github-actions": "nix-github-actions", "nixago": "nixago", "nixago-exts": "nixago-exts", "nixpkgs": "nixpkgs", diff --git a/flake.nix b/flake.nix index c304d3d..843fcff 100644 --- a/flake.nix +++ b/flake.nix @@ -67,6 +67,9 @@ gitignore-nix.url = "github:hercules-ci/gitignore.nix"; gitignore-nix.inputs.nixpkgs.follows = "nixpkgs"; + + nix-github-actions.url = "github:nix-community/nix-github-actions"; + nix-github-actions.inputs.nixpkgs.follows = "nixpkgs"; }; outputs =