Skip to content

Commit ea5ec5c

Browse files
committed
Stack CI: repair cache key
1 parent 91cd3a9 commit ea5ec5c

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

.github/workflows/stack.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
os: [macos-latest] # [ubuntu-latest,macos-latest,windows-latest]
17-
ghc-ver: ['9.8'] # ['9.12', '9.10', '9.8', '9.6']
16+
os: [ubuntu-latest,macos-latest,windows-latest]
17+
ghc-ver: ['9.12', '9.10', '9.8', '9.6']
1818
# Snapshots for 9.4.8, 9.2.8, 9.0.2, 8.10.7 do not have a recent enough base-compat; 0.13 is needed.
1919
# On ubuntu-22.04 the old versions 8.8.4, 8.6.5, 8.4.4, 8.2.2 fail due to HsOpenSSL linking errors.
2020
# They used to work under ubuntu-20.04, but it is not worth the trouble maintaining them.
@@ -42,12 +42,16 @@ jobs:
4242
with:
4343
ghc-version: ${{ matrix.ghc-ver }}
4444
enable-stack: true
45+
# Andreas, 2026-04-18
46+
# There have been problems with libcrypto on macOS with GHC 9.8.4 with --system-ghc
47+
# so we let Stack install GHC itself.
4548
stack-no-global: true
4649

4750
- name: Set up the openssl library (MacOS)
4851
if: runner.os == 'macOS'
52+
# Already installed:
53+
# brew install openssl
4954
run: |
50-
brew install openssl
5155
echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}"
5256
echo "PKG_CONFIG_PATH=$(brew --prefix)/opt/openssl/lib/pkgconfig" >> "${GITHUB_ENV}"
5357
@@ -71,11 +75,15 @@ jobs:
7175
- name: Cache dependencies (restore)
7276
uses: actions/cache/restore@v5
7377
id: cache
78+
env:
79+
key: ${{ runner.os }}-stack-${{ steps.setup.outputs.stack-version }}-ghc-${{ matrix.ghc-ver }}
80+
# ${{ steps.setup.outputs.ghc-version }} is empty with stack-no-global
81+
# so we use plain ${{ matrix.ghc-ver }}
7482
with:
7583
path: ${{ steps.setup.outputs.stack-root }}
7684
# Use a unique primary key (always save new cache); works if caches aren't to big or too many...
77-
key: ${{ runner.os }}-stack-${{ steps.setup.outputs.stack-version }}-ghc-${{ steps.setup.outputs.ghc-version }}-commit-${{ github.sha }}
78-
restore-keys: ${{ runner.os }}-stack-${{ steps.setup.outputs.stack-version }}-ghc-${{ steps.setup.outputs.ghc-version }}-
85+
key: ${{ env.key }}-commit-${{ github.sha }}
86+
restore-keys: ${{ env.key }}-
7987

8088
- name: Install dependencies
8189
# if: ${{ steps.cache.outputs.cache-hit != 'true' }}

0 commit comments

Comments
 (0)