Skip to content

Commit

Permalink
CI stack: switch to 2-digit GHC versions and `compiler-check: newer-m…
Browse files Browse the repository at this point in the history
…inor`
  • Loading branch information
andreasabel committed Nov 12, 2023
1 parent 7974b73 commit 4272412
Show file tree
Hide file tree
Showing 27 changed files with 57 additions and 56 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [ master, 'ci-*' ]
tags: [ 'v*' ]
pull_request:
types: [ opened, synchronize]
types: [ opened, synchronize ]
workflow_dispatch:

# For making a release, we need write permissions.
Expand All @@ -23,13 +23,13 @@ jobs:
fail-fast: false
matrix:
# Note: check release logic below when changing the matrix!
ghc: [9.8.1, 9.6.3, 9.4.7, 9.2.8, 9.0.2, 8.10.7, 8.8.4, 8.6.5, 8.4.4, 8.2.2]
ghc: ['9.8', '9.6', '9.4', '9.2', '9.0', '8.10', '8.8', '8.6', '8.4', '8.2']
os: [ubuntu-latest]
include:
- os: macOS-latest
ghc: 9.8.1
ghc: '9.8'
- os: windows-latest
ghc: 9.8.1
ghc: '9.8'


# Needed for Windows to make piping (... >> ...) and evaluation ( $(...) ) work.
Expand All @@ -44,9 +44,9 @@ jobs:
uses: haskell-actions/setup@v2
id: haskell-setup # <-- self-chosen identifier
with:
ghc-version: ${{ matrix.ghc }}
enable-stack: true
# stack-version: latest
ghc-version: ${{ matrix.ghc }}
enable-stack: true
cabal-update: false

- name: Environment settings based on the Haskell setup
shell: bash
Expand All @@ -63,7 +63,7 @@ jobs:
GHC_VER=$(ghc --numeric-version)
CABAL_VER=$(cabal --numeric-version)
STACK_VER=$(stack --numeric-version)
STACK_FLAGS="--stack-yaml stack-${GHC_VER}.yaml --system-ghc --no-terminal --color always"
STACK_FLAGS="--stack-yaml stack-${{ matrix.ghc }}.yaml --system-ghc --no-terminal --color always"
TARGET=$(if [ "${{ runner.os }}" == "Windows" ]; then echo ":bnfc"; fi)
echo "GHC_VER = ${GHC_VER}"
echo "CABAL_VER = ${CABAL_VER}"
Expand All @@ -88,7 +88,7 @@ jobs:
# key: ${{ runner.os }}-${{ env.STACK_VER }}-${{ hashFiles('source/BNFC.cabal', format('stack-{0}.yaml', env.GHC_VER)) }}
with:
path: ${{ steps.haskell-setup.outputs.stack-root }}
key: ${{ env.key }}-resolver-${{ hashFiles(format('stack-{0}.yaml', env.GHC_VER)) }}
key: ${{ env.key }}-resolver-${{ hashFiles(format('stack-{0}.yaml', matrix.ghc)) }}
restore-keys: ${{ env.key }}-

- name: Build dependencies.
Expand Down Expand Up @@ -120,15 +120,15 @@ jobs:
# Conditional to ensure this deployment is only run once per action.
if: >-
startsWith(github.ref, 'refs/tags/v')
&& matrix.ghc == '9.8.1'
&& matrix.ghc == '9.8'
run: |
DIST_TGZ=$(cabal sdist source | tail -1)
echo "DIST_TGZ=${DIST_TGZ}" >> "${GITHUB_ENV}"
- name: Source tarball release.
if: >-
startsWith(github.ref, 'refs/tags/v')
&& matrix.ghc == '9.8.1'
&& matrix.ghc == '9.8'
uses: softprops/action-gh-release@v1
with:
draft: true
Expand All @@ -140,7 +140,7 @@ jobs:
if: >-
startsWith(github.ref, 'refs/tags/v')
&& runner.os == 'Linux'
&& matrix.ghc == '9.8.1'
&& matrix.ghc == '9.8'
run: |
BNFC_BIN=bnfc-${BNFC_VERSION}-linux.binary
cp -p "${BNFC_EXE}" "${BNFC_BIN}"
Expand All @@ -151,7 +151,7 @@ jobs:
if: >-
startsWith(github.ref, 'refs/tags/v')
&& runner.os == 'Linux'
&& matrix.ghc == '9.8.1'
&& matrix.ghc == '9.8'
uses: softprops/action-gh-release@v1
with:
draft: true
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ and then either
```
or
```
stack install --stack-yaml stack-8.10.7.yaml
stack install --stack-yaml stack-9.4.yaml
```
(replace `8.10.7` with your GHC version, and if you want to build with
(replace `9.4` with your GHC major version, and if you want to build with
your installed GHC then add flag `--system-ghc`).

Mini tutorial
Expand Down
21 changes: 11 additions & 10 deletions source/BNFC.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Description:
tested-with:
GHC == 9.8.1
GHC == 9.6.3
GHC == 9.4.7
GHC == 9.4.8
GHC == 9.2.8
GHC == 9.0.2
GHC == 8.10.7
Expand All @@ -55,15 +55,16 @@ extra-source-files:
src/BNFC.cf
src/Makefile
-- Support range when build with stack
stack-9.6.3.yaml
stack-9.4.7.yaml
stack-9.2.8.yaml
stack-9.0.2.yaml
stack-8.10.7.yaml
stack-8.8.4.yaml
stack-8.6.5.yaml
stack-8.4.4.yaml
stack-8.2.2.yaml
stack-9.8.yaml
stack-9.6.yaml
stack-9.4.yaml
stack-9.2.yaml
stack-9.0.yaml
stack-8.10.yaml
stack-8.8.yaml
stack-8.6.yaml
stack-8.4.yaml
stack-8.2.yaml

source-repository head
type: git
Expand Down
2 changes: 1 addition & 1 deletion source/stack-8.10.7.yaml → source/stack-8.10.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
resolver: lts-18.28
compiler: ghc-8.10.7
compiler-check: match-exact
compiler-check: newer-minor
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion source/stack-8.8.4.yaml → source/stack-8.8.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
resolver: lts-16.31
compiler: ghc-8.8.4
compiler-check: match-exact
compiler-check: newer-minor
2 changes: 1 addition & 1 deletion source/stack-9.0.2.yaml → source/stack-9.0.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
resolver: lts-19.33
compiler: ghc-9.0.2
compiler-check: match-exact
compiler-check: newer-minor
2 changes: 1 addition & 1 deletion source/stack-9.2.8.yaml → source/stack-9.2.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
resolver: lts-20.26
compiler: ghc-9.2.8
compiler-check: match-exact
compiler-check: newer-minor
3 changes: 0 additions & 3 deletions source/stack-9.4.7.yaml

This file was deleted.

3 changes: 3 additions & 0 deletions source/stack-9.4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resolver: lts-21.19
compiler: ghc-9.4.7
compiler-check: newer-minor
3 changes: 0 additions & 3 deletions source/stack-9.6.3.yaml

This file was deleted.

3 changes: 3 additions & 0 deletions source/stack-9.6.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resolver: nightly-2023-11-10
compiler: ghc-9.6.3
compiler-check: newer-minor
6 changes: 0 additions & 6 deletions source/stack-9.8.1.yaml

This file was deleted.

6 changes: 6 additions & 0 deletions source/stack-9.8.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resolver: nightly-2023-11-10
compiler: ghc-9.8.1
compiler-check: newer-minor

packages:
- .
2 changes: 1 addition & 1 deletion stack-8.10.7.yaml → stack-8.10.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resolver: lts-18.28
compiler: ghc-8.10.7
compiler-check: match-exact
compiler-check: newer-minor

packages:
- source
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion stack-8.8.4.yaml → stack-8.8.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resolver: lts-16.31
compiler: ghc-8.8.4
compiler-check: match-exact
compiler-check: newer-minor

packages:
- source
Expand Down
2 changes: 1 addition & 1 deletion stack-9.0.2.yaml → stack-9.0.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resolver: lts-19.33
compiler: ghc-9.0.2
compiler-check: match-exact
compiler-check: newer-minor

packages:
- source
Expand Down
2 changes: 1 addition & 1 deletion stack-9.2.8.yaml → stack-9.2.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resolver: lts-20.26
compiler: ghc-9.2.8
compiler-check: match-exact
compiler-check: newer-minor

packages:
- source
Expand Down
4 changes: 2 additions & 2 deletions stack-9.4.7.yaml → stack-9.4.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resolver: lts-21.17
resolver: lts-21.19
compiler: ghc-9.4.7
compiler-check: match-exact
compiler-check: newer-minor

packages:
- source
Expand Down
7 changes: 0 additions & 7 deletions stack-9.6.3.yaml

This file was deleted.

7 changes: 7 additions & 0 deletions stack-9.6.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
resolver: nightly-2023-11-10
compiler: ghc-9.6.3
compiler-check: newer-minor

packages:
- source
- testing
4 changes: 2 additions & 2 deletions stack-9.8.1.yaml → stack-9.8.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resolver: nightly-2023-10-26
resolver: nightly-2023-11-10
compiler: ghc-9.8.1
compiler-check: match-exact
compiler-check: newer-minor

packages:
- source
Expand Down

0 comments on commit 4272412

Please sign in to comment.