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..3869443 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,78 @@ +on: + pull_request: + push: + branches: + - master + +permissions: + actions: write + +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() + continue-on-error: true + 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() + continue-on-error: true + 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" 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