Update Stack releases #136
This file contains 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: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- develop | |
- main | |
permissions: | |
contents: read | |
jobs: | |
config: | |
name: "Load configuration" | |
runs-on: ubuntu-latest | |
outputs: | |
ghcvers: ${{ steps.set-ghcvers.outputs.ghcvers }} | |
ghcvers_lower: ${{ steps.set-ghcvers.outputs.ghcvers_lower }} | |
ghcvers_upper: ${{ steps.set-ghcvers.outputs.ghcvers_upper }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set ghcvers | |
id: set-ghcvers | |
run: ./test-all.sh github >> $GITHUB_OUTPUT | |
cabal: | |
name: "Cabal: GHC ${{ matrix.ghc }}" | |
needs: config | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
ghc: ${{fromJSON(needs.config.outputs.ghcvers)}} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Haskell | |
uses: haskell-actions/setup@v2 | |
id: setup | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
cabal-version: latest | |
cabal-update: true | |
- name: Setup Environment | |
run: | | |
GHC_VERSION=$(ghc --numeric-version) | |
echo "GHC_VERSION=${GHC_VERSION}" | tee -a "${GITHUB_ENV}" | |
CABAL_VERSION=$(cabal --numeric-version) | |
echo "CABAL_VERSION=${CABAL_VERSION}" | tee -a "${GITHUB_ENV}" | |
CABAL_OPTS="--enable-tests --enable-benchmarks" | |
if [ -f "cabal-${GHC_VERSION}.project" ] ; then | |
CABAL_OPTS="--project-file=cabal-${GHC_VERSION}.project ${CABAL_OPTS}" | |
fi | |
echo "CABAL_OPTS=${CABAL_OPTS}" | tee -a "${GITHUB_ENV}" | |
CACHE_RESTORE_KEY="${RUNNER_OS}-$(date +%Y%m)-ghc-${GHC_VERSION}-cabal-${CABAL_VERSION}-" | |
echo "CACHE_RESTORE_KEY=${CACHE_RESTORE_KEY}" | tee -a "${GITHUB_ENV}" | |
- name: Configure Build | |
run: | | |
cabal v2-configure $CABAL_OPTS --disable-documentation | |
cabal v2-build --dry-run $CABAL_OPTS | |
- name: Restore Cached Dependencies | |
uses: actions/cache/restore@v4 | |
id: cache | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ env.CACHE_RESTORE_KEY }}plan-${{ hashFiles('**/plan.json') }} | |
restore-keys: ${{ env.CACHE_RESTORE_KEY }} | |
- name: Install Dependencies | |
run: cabal v2-build all $CABAL_OPTS --only-dependencies | |
- name: Save Cached Dependencies | |
uses: actions/cache/save@v4 | |
if: ${{ !steps.cache.outputs.cache-hit | |
|| steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }} | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ steps.cache.outputs.cache-primary-key }} | |
- name: Build | |
run: cabal v2-build all $CABAL_OPTS | |
- name: Test | |
run: cabal v2-test all $CABAL_OPTS | |
- name: Haddock | |
run: cabal v2-haddock all $CABAL_OPTS | |
- name: Examples | |
run: cabal v2-build exe:literatex -f examples $CABAL_OPTS | |
stack: | |
name: "Stack: GHC ${{ matrix.ghc }}" | |
needs: config | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
ghc: ${{fromJSON(needs.config.outputs.ghcvers)}} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Haskell | |
uses: haskell-actions/setup@v2 | |
id: setup | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
cabal-version: latest | |
cabal-update: true | |
enable-stack: true | |
stack-version: latest | |
- name: Setup Environment | |
run: | | |
GHC_VERSION=$(ghc --numeric-version) | |
echo "GHC_VERSION=${GHC_VERSION}" | tee -a "${GITHUB_ENV}" | |
CABAL_VERSION=$(cabal --numeric-version) | |
echo "CABAL_VERSION=${CABAL_VERSION}" | tee -a "${GITHUB_ENV}" | |
STACK_YAML="stack-${GHC_VERSION}.yaml" | |
echo "STACK_YAML=${STACK_YAML}" | tee -a "${GITHUB_ENV}" | |
CACHE_RESTORE_KEY="${RUNNER_OS}-$(date +%Y%m)-ghc-${GHC_VERSION}-stack-" | |
echo "CACHE_RESTORE_KEY=${CACHE_RESTORE_KEY}" | tee -a "${GITHUB_ENV}" | |
- name: Cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.stack | |
.stack-work | |
key: ${{ env.CACHE_RESTORE_KEY }}${{ hashFiles('ttc.cabal', env.STACK_YAML) }} | |
restore-keys: ${{ env.CACHE_RESTORE_KEY }} | |
- name: Build | |
run: stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks | |
- name: Test | |
run: stack test --system-ghc | |
- name: Haddock | |
run: stack haddock --system-ghc | |
############################################################################## | |
# NOTE Examples are currently disabled for Stack. | |
# | |
# The optparse-applicative_ge_0_18 flag needs to be set manually when using | |
# Stack, and this is done in the stack.yaml configuration files. Examples are | |
# built using a flag as well, though, and specifying a flag on the command | |
# line makes stack ignore the flag setting within the configuration file, | |
# resulting in build failures. | |
# | |
# - name: Examples | |
# run: stack build --system-ghc --flag literatex:examples | |
bounds-lower: | |
name: "Lower Bounds (GHC ${{ matrix.ghc }})" | |
needs: config | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
ghc: ${{fromJSON(needs.config.outputs.ghcvers_lower)}} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Haskell | |
uses: haskell-actions/setup@v2 | |
id: setup | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
cabal-version: latest | |
cabal-update: true | |
- name: Setup Environment | |
run: | | |
GHC_VERSION=$(ghc --numeric-version) | |
echo "GHC_VERSION=${GHC_VERSION}" | tee -a "${GITHUB_ENV}" | |
CABAL_VERSION=$(cabal --numeric-version) | |
echo "CABAL_VERSION=${CABAL_VERSION}" | tee -a "${GITHUB_ENV}" | |
CABAL_OPTS="--enable-tests --enable-benchmarks --project-file=cabal-bounds-lower.project" | |
echo "CABAL_OPTS=${CABAL_OPTS}" | tee -a "${GITHUB_ENV}" | |
CACHE_RESTORE_KEY="${RUNNER_OS}-$(date +%Y%m)-ghc-${GHC_VERSION}-cabal-${CABAL_VERSION}-" | |
echo "CACHE_RESTORE_KEY=${CACHE_RESTORE_KEY}" | tee -a "${GITHUB_ENV}" | |
- name: Configure Build | |
run: | | |
cabal v2-configure $CABAL_OPTS --disable-documentation | |
cabal v2-build --dry-run $CABAL_OPTS | |
- name: Restore Cached Dependencies | |
uses: actions/cache/restore@v4 | |
id: cache | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ env.CACHE_RESTORE_KEY }}plan-${{ hashFiles('**/plan.json') }} | |
restore-keys: ${{ env.CACHE_RESTORE_KEY }} | |
- name: Install Dependencies | |
run: cabal v2-build all $CABAL_OPTS --only-dependencies | |
- name: Save Cached Dependencies | |
uses: actions/cache/save@v4 | |
if: ${{ !steps.cache.outputs.cache-hit | |
|| steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }} | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ steps.cache.outputs.cache-primary-key }} | |
- name: Build | |
run: cabal v2-build all $CABAL_OPTS | |
- name: Test | |
run: cabal v2-test all $CABAL_OPTS | |
- name: Haddock | |
run: cabal v2-haddock all $CABAL_OPTS | |
- name: Examples | |
run: cabal v2-build exe:literatex -f examples $CABAL_OPTS | |
bounds-upper: | |
name: "Upper Bounds (GHC ${{ matrix.ghc }})" | |
needs: config | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
ghc: ${{fromJSON(needs.config.outputs.ghcvers_upper)}} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Haskell | |
uses: haskell-actions/setup@v2 | |
id: setup | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
cabal-version: latest | |
cabal-update: true | |
- name: Setup Environment | |
run: | | |
GHC_VERSION=$(ghc --numeric-version) | |
echo "GHC_VERSION=${GHC_VERSION}" | tee -a "${GITHUB_ENV}" | |
CABAL_VERSION=$(cabal --numeric-version) | |
echo "CABAL_VERSION=${CABAL_VERSION}" | tee -a "${GITHUB_ENV}" | |
CABAL_OPTS="--enable-tests --enable-benchmarks --project-file=cabal-bounds-upper.project" | |
echo "CABAL_OPTS=${CABAL_OPTS}" | tee -a "${GITHUB_ENV}" | |
CACHE_RESTORE_KEY="${RUNNER_OS}-$(date +%Y%m)-ghc-${GHC_VERSION}-cabal-${CABAL_VERSION}-" | |
echo "CACHE_RESTORE_KEY=${CACHE_RESTORE_KEY}" | tee -a "${GITHUB_ENV}" | |
- name: Configure Build | |
run: | | |
cabal v2-configure $CABAL_OPTS --disable-documentation | |
cabal v2-build --dry-run $CABAL_OPTS | |
- name: Restore Cached Dependencies | |
uses: actions/cache/restore@v4 | |
id: cache | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ env.CACHE_RESTORE_KEY }}plan-${{ hashFiles('**/plan.json') }} | |
restore-keys: ${{ env.CACHE_RESTORE_KEY }} | |
- name: Install Dependencies | |
run: cabal v2-build all $CABAL_OPTS --only-dependencies | |
- name: Save Cached Dependencies | |
uses: actions/cache/save@v4 | |
if: ${{ !steps.cache.outputs.cache-hit | |
|| steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }} | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ steps.cache.outputs.cache-primary-key }} | |
- name: Build | |
run: cabal v2-build all $CABAL_OPTS | |
- name: Test | |
run: cabal v2-test all $CABAL_OPTS | |
- name: Haddock | |
run: cabal v2-haddock all $CABAL_OPTS | |
- name: Examples | |
run: cabal v2-build exe:literatex -f examples $CABAL_OPTS | |
cabal-version: | |
name: "Cabal ${{ matrix.cabal }} (GHC ${{ matrix.ghc }})" | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
cabal: ['3.0.0.0'] | |
ghc: ['8.8.4'] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Haskell | |
uses: haskell-actions/setup@v2 | |
id: setup | |
with: | |
ghc-version: ${{ matrix.ghc }} | |
cabal-version: ${{ matrix.cabal }} | |
cabal-update: true | |
- name: Setup Environment | |
run: | | |
GHC_VERSION=$(ghc --numeric-version) | |
echo "GHC_VERSION=${GHC_VERSION}" | tee -a "${GITHUB_ENV}" | |
CABAL_VERSION=$(cabal --numeric-version) | |
echo "CABAL_VERSION=${CABAL_VERSION}" | tee -a "${GITHUB_ENV}" | |
CABAL_OPTS="--enable-tests --enable-benchmarks" | |
if [ -f "cabal-${GHC_VERSION}.project" ] ; then | |
CABAL_OPTS="--project-file=cabal-${GHC_VERSION}.project ${CABAL_OPTS}" | |
fi | |
echo "CABAL_OPTS=${CABAL_OPTS}" | tee -a "${GITHUB_ENV}" | |
CACHE_RESTORE_KEY="${RUNNER_OS}-$(date +%Y%m)-ghc-${GHC_VERSION}-cabal-${CABAL_VERSION}-" | |
echo "CACHE_RESTORE_KEY=${CACHE_RESTORE_KEY}" | tee -a "${GITHUB_ENV}" | |
- name: Configure Build | |
run: | | |
cabal v2-configure $CABAL_OPTS --disable-documentation | |
cabal v2-build --dry-run $CABAL_OPTS | |
- name: Restore Cached Dependencies | |
uses: actions/cache/restore@v4 | |
id: cache | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ env.CACHE_RESTORE_KEY }}plan-${{ hashFiles('**/plan.json') }} | |
restore-keys: ${{ env.CACHE_RESTORE_KEY }} | |
- name: Install Dependencies | |
run: cabal v2-build all $CABAL_OPTS --only-dependencies | |
- name: Save Cached Dependencies | |
uses: actions/cache/save@v4 | |
if: ${{ !steps.cache.outputs.cache-hit | |
|| steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }} | |
with: | |
path: ${{ steps.setup.outputs.cabal-store }} | |
key: ${{ steps.cache.outputs.cache-primary-key }} | |
- name: Build | |
run: cabal v2-build all $CABAL_OPTS | |
- name: Test | |
run: cabal v2-test all $CABAL_OPTS | |
- name: Haddock | |
run: cabal v2-haddock all $CABAL_OPTS | |
- name: Examples | |
run: cabal v2-build exe:literatex -f examples $CABAL_OPTS |