Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 40 additions & 49 deletions .github/workflows/build-and-test-ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:

jobs:
build-with-stack:
name: Build and test with Stack
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -15,21 +16,22 @@ jobs:
uses: actions/cache@v4.2.3
with:
path: |
~/.ghcup
~/.stack
~/.ghc
.stack-work
key: >-
${{ runner.os }}-stack-${{ hashFiles(
'**/stack.yaml.lock',
'**/package.yaml'
) }}
restore-keys: |
${{ runner.os }}-stack-${{
hashFiles('**/stack.yaml.lock')
}}-${{
hashFiles('**/package.yaml')
}}
restore-keys: |-
${{ runner.os }}-stack-${{ hashFiles('**/stack.yaml.lock') }}-
${{ runner.os }}-stack-
- name: Set up GHC with Stack
run: stack setup
- name: Build project
run: >
run: >-
stack build --fast --hpack-force --lock-file=error-on-write
--ghc-options="-Werror"
- name: Check that .cabal file has not changed except hpack comment
Expand All @@ -54,67 +56,56 @@ jobs:
- name: Run tests
run: stack test --fast
build-with-cabal:
# Cabal matrix build:
# This job builds and tests the project using multiple GHC versions.
# - Ensures compatibility with stable compiler versions (e.g. 9.4.7, 9.6.6).
# - Tests with 'latest' GHC to catch breaking changes early.
# - Uses '--allow-newer=base' with 'latest' to relax bounds for future compatibility.
# - Enables the 'dump-ast' flag to ensure internal tooling builds correctly.
name: Build and test with Cabal (GHC ${{ matrix.ghc }})
runs-on: ubuntu-latest
strategy:
matrix:
ghc: [9.4.7, 9.6.6]
ghc: [9.4.7, 9.6.6, latest]
env:
MATRIX_GHC: ${{ matrix.ghc }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cache GHC, Cabal store, and build artifacts
uses: actions/cache@v4.2.3
with:
path: |
~/.ghcup
~/.ghc
~/.cabal/store
dist-newstyle
key: >-
${{ runner.os }}-cabal-${{ matrix.ghc }}-${{
hashFiles('**/package.yaml')
}}
restore-keys: |
${{ runner.os }}-cabal-${{ matrix.ghc }}-
${{ runner.os }}-cabal-
- name: Set up GHC ${{ matrix.ghc }} and Cabal
id: setup-ghc
uses: haskell-actions/setup@v2.8.0
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: latest
cabal-update: true
- run: cabal configure --enable-tests
- name: Build project (GHC ${{ matrix.ghc }})
run: cabal build --ghc-options="-Werror"
- name: Run tests (GHC ${{ matrix.ghc }})
run: cabal test --test-show-details=direct
build-on-latest:
name: Build-and-and-test-with-ghc-latest
needs: build-with-cabal
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Log GHC and Cabal outputs
run: |
echo "GHC Version: ${{ steps.setup-ghc.outputs.ghc-version }}"
echo "Cabal Store Path: ${{ steps.setup-ghc.outputs.cabal-store }}"
- name: Cache GHC, Cabal store, and build artifacts
uses: actions/cache@v4.2.3
with:
path: |
~/.ghcup
~/.ghc
~/.cabal/store
dist-newstyle
key: ${{ runner.os }}-cabal-latest-store-${{ hashFiles('**/package.yaml')}}
key: >-
${{ runner.os }}-cabal-${{
steps.setup-ghc.outputs.ghc-version
}}-${{
hashFiles('**/package.yaml')
}}
restore-keys: |
${{ runner.os }}-cabal-latest-store-
${{ runner.os }}-cabal-
- name: Set up GHC latest and Cabal
uses: haskell-actions/setup@v2.8.0
with:
ghc-version: latest
cabal-version: latest
cabal-update: true
- name: Configure with dump-ast flag
run: cabal configure --enable-test --allow-newer=base --flags=dump-ast
- name: Build
${{ runner.os }}-cabal-${{ steps.setup-ghc.outputs.ghc-version }}-
- name: Configure project
run: |
FLAGS=""
if [ "${MATRIX_GHC}" = "latest" ]; then
FLAGS="--allow-newer=base"
fi
cabal configure --enable-tests --flags=dump-ast $FLAGS --ghc-options="-Werror"
- name: Build project (GHC ${{ steps.setup-ghc.outputs.ghc-version }})
run: cabal build
- name: Run tests
- name: Run tests (GHC ${{ steps.setup-ghc.outputs.ghc-version }})
run: cabal test --test-show-details=direct
54 changes: 48 additions & 6 deletions .github/workflows/build-and-test-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:

jobs:
build-with-stack-windows:
name: Build and test with Stack
runs-on: windows-latest
steps:
- name: Checkout code
Expand All @@ -19,17 +20,58 @@ jobs:
~\AppData\Roaming\stack
.stack-work
key: >-
${{ runner.os }}-stack-${{ hashFiles(
'**/stack.yaml.lock',
'**/package.yaml'
)}}
restore-keys: |
${{ runner.os }}-stack-${{
hashFiles('**/stack.yaml.lock')
}}-${{
hashFiles('**/package.yaml')
}}
restore-keys: |-
${{ runner.os }}-stack-${{ hashFiles('**/stack.yaml.lock') }}-
${{ runner.os }}-stack-
- name: Set up GHC with Stack
run: stack setup
- name: Build project
run: >
run: >-
stack build --fast --hpack-force --lock-file=error-on-write
--ghc-options="-Werror"
- name: Run tests
run: stack test --fast
build-with-cabal-windows:
name: Build and test with Cabal (GHC latest, future-proof)
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up GHC latest and Cabal
id: setup-ghc
uses: haskell-actions/setup@v2.8.0
with:
ghc-version: latest
cabal-version: latest
cabal-update: true
- name: Log GHC and Cabal outputs
run: |
echo "GHC Version: ${{ steps.setup-ghc.outputs.ghc-version }}"
echo "Cabal Store Path: ${{ steps.setup-ghc.outputs.cabal-store }}"
- name: Cache GHC, Cabal store, and build artifacts
uses: actions/cache@v4.2.3
with:
path: |
dist-newstyle
${{ steps.setup-ghc.outputs.cabal-store }}
key: >-
${{ runner.os }}-cabal-${{
steps.setup-ghc.outputs.ghc-version
}}-${{
hashFiles('**/package.yaml')
}}
restore-keys: |
${{ runner.os }}-cabal-${{ steps.setup-ghc.outputs.ghc-version }}-
- name: Configure project
shell: pwsh
run: |
cabal configure --enable-tests --flags=dump-ast --allow-newer=base --ghc-options="-Werror"
- name: Build project (GHC latest)
run: cabal build
- name: Run tests (GHC latest)
run: cabal test --test-show-details=direct
1 change: 1 addition & 0 deletions .github/workflows/lint-and-format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:

jobs:
lint-and-format:
name: Lint and format
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand Down