WIP: removed llvm from GHA (macos) #668
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Haskell CI | |
on: | |
pull_request: | |
merge_group: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
ghc: ["8.10", "9.2", "9.4", "9.6", "9.8", "9.10"] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
defaults: | |
run: | |
shell: 'bash' | |
steps: | |
- name: Set cache version | |
run: echo "CACHE_VERSION=pu4Aevoo_v1" >> $GITHUB_ENV | |
- name: "Setup Haskell" | |
uses: haskell-actions/setup@v2 | |
id: setup-haskell | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
cabal-version: "3.12.1.0" | |
- name: Print environment variables | |
if: runner.os == 'macOS' && matrix.ghc == '8.10' | |
run: | | |
echo "PATH = $PATH" | |
- uses: actions/checkout@v4 | |
- name: "Configure cabal.project.local" | |
run: | | |
cat ./.github/workflows/cabal.project.local > ./cabal.project.local | |
cat ./cabal.project.local | |
- name: "Cabal update" | |
run: cabal update | |
- name: Record dependencies | |
id: record-deps | |
run: | | |
cabal build all --dry-run | |
cat dist-newstyle/cache/plan.json | jq -r '."install-plan"[].id' | sort | uniq > dependencies.txt | |
echo "weeknum=$(/bin/date -u "+%W")" >> $GITHUB_OUTPUT | |
- uses: actions/cache/restore@v4 | |
name: "Restore cabal store" | |
with: | |
path: ${{ runner.os == 'Windows' && steps.win-setup-haskell.outputs.cabal-store || steps.setup-haskell.outputs.cabal-store }} | |
key: cache-dependencies-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dependencies.txt') }} | |
restore-keys: cache-dependencies-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }} | |
enableCrossOsArchive: true | |
- uses: actions/cache@v4 | |
name: "Cache `dist-newstyle`" | |
with: | |
path: | | |
dist-newstyle | |
!dist-newstyle/**/.git | |
key: cache-dist-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ steps.record-deps.outputs.weeknum }} | |
restore-keys: cache-dist-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }} | |
enableCrossOsArchive: true | |
- name: Build dependencies | |
run: | | |
cabal build --only-dependencies all | |
- uses: actions/cache/save@v4 | |
name: "Save cabal store" | |
with: | |
path: ${{ runner.os == 'Windows' && steps.win-setup-haskell.outputs.cabal-store || steps.setup-haskell.outputs.cabal-store }} | |
key: cache-dependencies-${{ env.CACHE_VERSION }}-${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('dependencies.txt') }} | |
enableCrossOsArchive: true | |
- name: Build projects [build] | |
run: cabal build all | |
- name: Build documentation [haddock] | |
run: cabal haddock all | |
- name: io-sim [test] | |
run: cabal run io-sim:test | |
- name: io-classes:si-timers [test] | |
run: cabal run io-classes:test-si-timers | |
- name: io-classes:strict-mvar [test] | |
run: cabal run io-classes:test-strict-mvar |