Skip to content

Commit

Permalink
ci: more
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjm committed Aug 22, 2024
1 parent 9355ea0 commit b752eef
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
cabal: ["3.2"]
ghc:
- "8.10.7"
- "9.0.2"
Expand All @@ -32,7 +31,7 @@ jobs:
name: Setup Haskell (Cabal)
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
cabal-version: "latest"

- name: Freeze
run: |
Expand All @@ -44,6 +43,14 @@ jobs:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}

- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew update
# For older GHCs
brew install llvm@13 --quiet # Suppress deprecation warning
echo /opt/homebrew/opt/llvm@13/bin >> $GITHUB_PATH
- name: Build
run: |
cabal configure --enable-tests --enable-benchmarks --test-show-details=direct
Expand All @@ -54,22 +61,15 @@ jobs:
cabal test
stack:
name: stack ${{ matrix.stack }} / ${{ matrix.os }} / resolver ${{ matrix.resolver }}
name: stack / ${{ matrix.os }} / resolver ${{ matrix.resolver }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
resolver:
- lts-14 # 8.6.5
- lts-16 # 8.8.4
- lts-18 # 8.10.7
- lts-19 # 9.0.2
exclude:
# GHC bug on this version causes the build to fail ("Access violation in generated code when writing 0x0")
- os: windows-latest
resolver: lts-15

steps:
- uses: actions/checkout@v2
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master'
Expand All @@ -84,21 +84,17 @@ jobs:
- name: Run stack setup
shell: bash
run: |
stack setup --resolver ${{matrix.resolver}}
export STACK_EXTRA_ARGS="--resolver ${{matrix.resolver}}"
# Certain resolvers need dedicated stack.yaml files
STACK_EXTRA_ARGS="--resolver ${{matrix.resolver}}"
[ "${{matrix.resolver}}" = "lts-14" ] && STACK_EXTRA_ARGS="--stack-yaml stack-lts14.yaml"
[ "${{matrix.resolver}}" = "lts-15" ] && STACK_EXTRA_ARGS="--stack-yaml stack-lts15.yaml"
[ "${{matrix.resolver}}" = "lts-16" ] && STACK_EXTRA_ARGS="--stack-yaml stack-lts16.yaml"
stack setup $STACK_EXTRA_ARGS
echo STACK_EXTRA_ARGS="$STACK_EXTRA_ARGS" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Cache ~/.stack
with:
path: ~/.stack
key: ${{ runner.os }}-${{ matrix.resolver }}-stack-${{ matrix.stack }}-key2
key: ${{ runner.os }}-${{ matrix.resolver }}-stack-key2

- name: Build
run: |
Expand Down

0 comments on commit b752eef

Please sign in to comment.