From a3dc7620ce1566a774d190f68ee5631c87efa89a Mon Sep 17 00:00:00 2001 From: jappeace-sloth Date: Sat, 7 Mar 2026 11:08:21 +0000 Subject: [PATCH 1/2] Merge CI workflows, add GHC 9.12, cancel run on any failure - Combine nix.yaml and cabal.yaml into ci.yaml - Add GHC 9.12 to matrix, keep 9.6, 9.8, 9.10 - Enable fail-fast for cabal matrix - Cancel entire workflow run on any job failure - Bump actions to latest versions (checkout v4, cache v4, haskell-actions/setup v2) Co-Authored-By: Claude Opus 4.6 --- .github/workflows/cabal.yaml | 40 -------------------- .github/workflows/ci.yaml | 72 ++++++++++++++++++++++++++++++++++++ .github/workflows/nix.yaml | 31 ---------------- 3 files changed, 72 insertions(+), 71 deletions(-) delete mode 100644 .github/workflows/cabal.yaml create mode 100644 .github/workflows/ci.yaml delete mode 100644 .github/workflows/nix.yaml diff --git a/.github/workflows/cabal.yaml b/.github/workflows/cabal.yaml deleted file mode 100644 index 3bd40a2..0000000 --- a/.github/workflows/cabal.yaml +++ /dev/null @@ -1,40 +0,0 @@ -on: - pull_request: - push: - branches: - - master -jobs: - build: - - runs-on: ${{ matrix.os }} - - strategy: - fail-fast: false - matrix: - ghc: # should mirror current stable releases: https://www.haskell.org/ghc/download.html - - '9.8' - - '9.10' - os: [ubuntu-latest, macOS-latest, windows-latest] - cabal: ['latest'] - - steps: - - uses: actions/checkout@v3 - - uses: haskell/actions/setup@v2 # https://github.com/haskell/actions/tree/main/setup#haskellactionssetup - with: - ghc-version: ${{ matrix.ghc }} - - - name: Cabal cache - uses: actions/cache@v3 - env: - cache-name: cache-cabal - with: - path: ~/.cabal - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - - name: Cabal update - run: cabal update - - name: Build using cabal - run: cabal build all - - name: Test - run: cabal test all diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..aa8a5a6 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,72 @@ +on: + pull_request: + push: + branches: + - master +jobs: + nix: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Local cache + uses: actions/cache@v4 + with: + path: /nix/store + key: "${{ runner.os }}-nix-cache" + - uses: cachix/install-nix-action@v31 + with: + nix_path: nixpkgs=channel:nixos-unstable + extra_nix_config: | + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} + + - uses: cachix/cachix-action@v15 + with: + name: jappie + signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' + - run: nix-build + - run: nix-shell --run "echo OK" + - name: Cancel workflow on failure + if: failure() + run: gh run cancel ${{ github.run_id }} + env: + GH_TOKEN: ${{ github.token }} + + cabal: + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: true + matrix: + ghc: + - '9.12' + - '9.10' + - '9.8' + - '9.6' + os: [ubuntu-latest, macOS-latest, windows-latest] + + steps: + - uses: actions/checkout@v4 + - uses: haskell-actions/setup@v2 + with: + ghc-version: ${{ matrix.ghc }} + + - name: Cabal cache + uses: actions/cache@v4 + env: + cache-name: cache-cabal + with: + path: ~/.cabal + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + - name: Cabal update + run: cabal update + - name: Build using cabal + run: cabal build all + - name: Test + run: cabal test all + - name: Cancel workflow on failure + if: failure() + run: gh run cancel ${{ github.run_id }} + env: + GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/nix.yaml b/.github/workflows/nix.yaml deleted file mode 100644 index ba6acc1..0000000 --- a/.github/workflows/nix.yaml +++ /dev/null @@ -1,31 +0,0 @@ -on: - pull_request: - push: - branches: - - master -jobs: - tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - name: Local cache - uses: actions/cache@v5 - with: - path: /nix/store - key: "${{ runner.os }}-nix-cache" - - uses: cachix/install-nix-action@v31 - with: - nix_path: nixpkgs=channel:nixos-unstable - extra_nix_config: | - access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} - - # follow guide: https://nix.dev/tutorials/continuous-integration-github-actions - # this uses the tokens which are revokable - - uses: cachix/cachix-action@v15 - with: - name: jappie - # If you chose API tokens for write access OR if you have a private cache - # authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' - - run: nix-build - - run: nix-shell --run "echo OK" From 60b1c3195e7dcbd756f9f40db252134f6e82749b Mon Sep 17 00:00:00 2001 From: jappeace-sloth Date: Sat, 7 Mar 2026 11:21:16 +0000 Subject: [PATCH 2/2] Fix CI: bump base bound for GHC 9.12, fix cancel permissions - Bump base upper bound from <4.21.0 to <4.22.0 for GHC 9.12 support - Add permissions: actions: write for workflow cancellation - Add continue-on-error on cancel step (fork PRs lack permissions) Co-Authored-By: Claude Opus 4.6 --- .github/workflows/ci.yaml | 6 ++++++ template.cabal | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index aa8a5a6..3869443 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,6 +3,10 @@ on: push: branches: - master + +permissions: + actions: write + jobs: nix: runs-on: ubuntu-latest @@ -27,6 +31,7 @@ jobs: - run: nix-shell --run "echo OK" - name: Cancel workflow on failure if: failure() + continue-on-error: true run: gh run cancel ${{ github.run_id }} env: GH_TOKEN: ${{ github.token }} @@ -67,6 +72,7 @@ jobs: run: cabal test all - name: Cancel workflow on failure if: failure() + continue-on-error: true run: gh run cancel ${{ github.run_id }} env: GH_TOKEN: ${{ github.token }} diff --git a/template.cabal b/template.cabal index efbf242..426dcb4 100644 --- a/template.cabal +++ b/template.cabal @@ -54,7 +54,7 @@ common common-options -threaded -rtsopts "-with-rtsopts=-N -M7G -T -Iw10" build-depends: - base >=4.9.1.0 && <4.21.0 + base >=4.9.1.0 && <4.22.0 default-language: Haskell2010