diff --git a/.github/workflows/editorconfig.yml b/.github/workflows/editorconfig.yml index 9fe857e..57a0177 100644 --- a/.github/workflows/editorconfig.yml +++ b/.github/workflows/editorconfig.yml @@ -4,6 +4,7 @@ permissions: read-all on: push: + branches: [master] pull_request: jobs: @@ -11,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: cachix/install-nix-action@v20 + - uses: cachix/install-nix-action@v24 - name: "Check EditorConfig" # Python already has Ruff, # and doesn't necessarily have a consistent 4 spaces indent diff --git a/.github/workflows/nix-build.yml b/.github/workflows/nix-build.yml new file mode 100644 index 0000000..88f4306 --- /dev/null +++ b/.github/workflows/nix-build.yml @@ -0,0 +1,22 @@ +name: "Nix build" + +permissions: read-all + +on: + # Allows running this workflow manually + workflow_dispatch: + push: + branches: [master] + pull_request: + +jobs: + nix-build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: cachix/install-nix-action@v24 + - uses: DeterminateSystems/magic-nix-cache-action@v2 + with: + diagnostic-endpoint: "" + - name: Run `nix build` + run: nix build -L . diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml index c92426a..acbb72a 100644 --- a/.github/workflows/ruff.yml +++ b/.github/workflows/ruff.yml @@ -1,9 +1,10 @@ -name: "Check Formatting" +name: "Ruff lints" permissions: read-all on: push: + branches: [master] pull_request: jobs: @@ -11,6 +12,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: cachix/install-nix-action@v20 + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v40 + with: + files: | + **.py + - uses: cachix/install-nix-action@v24 - name: "Check Ruff lints" - run: nix run 'nixpkgs#ruff' -- check . --output-format=github + if: steps.changed-files.outputs.any_changed == 'true' + run: nix run 'nixpkgs#ruff' -- check . --output-format=github ${{ steps.changed-files.outputs.all_changed_files }}