github: add magic Nix workflow #368
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: basic nix checks | |
on: [pull_request] | |
jobs: | |
instantiate: | |
name: nix-instantiate | |
runs-on: ubuntu-latest | |
steps: | |
- uses: cachix/install-nix-action@v20 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- uses: actions/checkout@v3 | |
- run: nix-instantiate release.nix -A qchem | |
# Check if the flake is sane | |
check: | |
name: nix flake check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: cachix/install-nix-action@v20 | |
- uses: actions/checkout@v3 | |
- run: nix flake check --accept-flake-config --no-build | |
statix: | |
name: statix code check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: cachix/install-nix-action@v20 | |
- uses: actions/checkout@v3 | |
- name: get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v35 | |
- run: | | |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do | |
nix run nixpkgs#statix -- check $file | |
done |