From 916b94e6eb1c3ad9242fe38ced3376d94e05fb53 Mon Sep 17 00:00:00 2001 From: flip111 Date: Thu, 27 Mar 2025 18:55:36 +0100 Subject: [PATCH 1/2] Updated GitHub Actions workflow * Upgraded actions/cache from v2 to v4 for better performance * Upgraded actions/checkout from v3 to v4 * Enhanced cache key strategy with hashFiles of Cabal configuration * Added restore-keys for better cache hit rates when exact matches aren't found * Maintained existing functionality while improving CI reliability --- .github/workflows/haskell-ci.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index c22d273..aac738d 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -21,7 +21,7 @@ jobs: - os: macOS-latest ghc: 'latest' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install libncurses5 and libtinfo if: runner.os == 'Linux' && (matrix.ghc == '8.0' || matrix.ghc == '8.2') run: | @@ -32,13 +32,15 @@ jobs: ghc-version: ${{ matrix.ghc }} - name: Update cabal package database run: cabal update - - uses: actions/cache@v2 + - uses: actions/cache@v4 name: Cache cabal stuff with: path: | ${{ steps.setup-haskell-cabal.outputs.cabal-store }} dist-newstyle - key: ${{ runner.os }}-${{ matrix.ghc }} + key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('**/*.cabal', 'cabal.project') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.ghc }}- - name: Test run: | cabal sdist -z -o . @@ -59,19 +61,21 @@ jobs: needs: build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: haskell/actions/setup@v2 id: setup-haskell-cabal with: ghc-version: 'latest' - name: Update cabal package database run: cabal update - - uses: actions/cache@v2 + - uses: actions/cache@v4 name: Cache cabal stuff with: path: | ${{ steps.setup-haskell-cabal.outputs.cabal-store }} dist-newstyle - key: ${{ runner.os }}-latest + key: ${{ runner.os }}-latest-${{ hashFiles('**/*.cabal', 'cabal.project') }} + restore-keys: | + ${{ runner.os }}-latest- - name: Test - run: cabal test --ghc-options='-fcheck-prim-bounds -fno-ignore-asserts' + run: cabal test --ghc-options='-fcheck-prim-bounds -fno-ignore-asserts' \ No newline at end of file From 0373766c819809012085734b4f7b755fbe5b8485 Mon Sep 17 00:00:00 2001 From: flip111 Date: Thu, 3 Apr 2025 23:53:15 +0200 Subject: [PATCH 2/2] Optimize caching in CI --- .github/workflows/haskell-ci.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index aac738d..bd0e94d 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -30,8 +30,7 @@ jobs: id: setup-haskell-cabal with: ghc-version: ${{ matrix.ghc }} - - name: Update cabal package database - run: cabal update + cabal-update: true # This runs 'cabal update' automatically - uses: actions/cache@v4 name: Cache cabal stuff with: @@ -62,12 +61,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: haskell/actions/setup@v2 + - uses: haskell-actions/setup@v2 id: setup-haskell-cabal with: ghc-version: 'latest' - - name: Update cabal package database - run: cabal update + cabal-update: true - uses: actions/cache@v4 name: Cache cabal stuff with: