Nix CI #655
This file contains hidden or 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: Nix CI | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 0 * * *' # daily flake.lock update | |
| jobs: | |
| nix-ci: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: DeterminateSystems/nix-installer-action@v22 | |
| - name: Configure Git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| # Deadnix | |
| - name: Deadnix | |
| run: | | |
| nix run nixpkgs#deadnix -- --edit . | |
| if ! git diff --quiet; then | |
| git commit -am "chore: clean dead code" | |
| git pull --rebase origin "$GITHUB_REF_NAME" | |
| git push | |
| fi | |
| # Statix | |
| - name: Statix | |
| run: | | |
| nix run nixpkgs#statix -- fix . | |
| if ! git diff --quiet; then | |
| git commit -am "chore: lint with statix" | |
| git pull --rebase origin "$GITHUB_REF_NAME" | |
| git push | |
| fi | |
| # Format | |
| - name: Format | |
| run: | | |
| nix run nixpkgs#alejandra -- . | |
| if ! git diff --quiet; then | |
| git commit -am "chore: format nix files" | |
| git pull --rebase origin "$GITHUB_REF_NAME" | |
| git push | |
| fi | |
| # Update flake.lock | |
| - name: Update flake.lock | |
| run: | | |
| nix flake update | |
| if ! git diff --quiet; then | |
| git commit -am "chore: update flake.lock" | |
| git pull --rebase origin "$GITHUB_REF_NAME" | |
| git push | |
| fi |