From 6f53cb5f4a4294e34cb70f14dde8443a821974ea Mon Sep 17 00:00:00 2001 From: truxnell <19149206+truxnell@users.noreply.github.com> Date: Tue, 26 Mar 2024 21:16:21 +1100 Subject: [PATCH] feat: add auto lint workflow --- .github/workflows/nix-lint.yaml | 46 +++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/nix-lint.yaml diff --git a/.github/workflows/nix-lint.yaml b/.github/workflows/nix-lint.yaml new file mode 100644 index 0000000..9c7738f --- /dev/null +++ b/.github/workflows/nix-lint.yaml @@ -0,0 +1,46 @@ +name: Nix Flake Check + +on: [pull_request] + +jobs: + check: + runs-on: ubuntu-latest + + permissions: + contents: write + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install Nix + uses: cachix/install-nix-action@v23 + with: + nix_path: nixpkgs=channel:nixos-unstable + + - name: Install Nix Linting and Formatting Tools + run: nix-env -i statix nixpkgs-fmt -f '' + + - name: Run Statix Lint + run: statix fix + + - name: Run Nix Format + run: nix fmt + + - name: Nix Flake Checker + # You may pin to the exact commit or the version. + # uses: DeterminateSystems/flake-checker-action@4b90f9fc724969ff153fe1803460917c84fe00a3 + uses: DeterminateSystems/flake-checker-action@v5 + + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.x' + + - name: Generate Readme + run: python3 sh/readme.py + + - name: Commit + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: Auto lint/format \ No newline at end of file