haskell-gha-1.0: tests/golden/old-ghc/expected.yaml
# Do not edit this file, it was generated by the following command:
# haskell-gha --generate
#
# To regenerate it, run from the root of the repository:
# haskell-gha
#
# For more information, see https://github.com/arybczak/haskell-gha
name: CI
on:
push:
branches:
- master
- main
pull_request:
merge_group:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow_ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
build:
name: GHC ${{ matrix.ghc }}
runs-on: ubuntu-26.04
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
ghc:
- '9.2.8'
- '9.4.8'
- '9.6.7'
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: Install the gold linker
if: contains(fromJSON('["9.2.8","9.4.8"]'), matrix.ghc)
run: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends binutils-gold
- name: Install GHC and cabal
id: setup
run: |
mkdir -p "$RUNNER_TEMP"/.ghcup/bin
curl -fsSL -o "$RUNNER_TEMP"/.ghcup/bin/ghcup "https://downloads.haskell.org/ghcup/$(uname -m)-linux-ghcup"
chmod +x "$RUNNER_TEMP"/.ghcup/bin/ghcup
export GHCUP_INSTALL_BASE_PREFIX="$RUNNER_TEMP" PATH="$RUNNER_TEMP/.ghcup/bin:$PATH"
echo "GHCUP_INSTALL_BASE_PREFIX=$RUNNER_TEMP" >> "$GITHUB_ENV"
echo "$RUNNER_TEMP/.ghcup/bin" >> "$GITHUB_PATH"
versions=$(ghcup -s vanilla list -t ghc -r)
if grep -qF -e 'ghc ${{ matrix.ghc }} ' -e 'ghc ${{ matrix.ghc }}.' <<< "$versions"; then
channel=vanilla
else
echo 'The vanilla channel of GHCup has no GHC ${{ matrix.ghc }}, so the step uses the prerelease channel.'
channel=prereleases
fi
ghcup -s "$channel" install ghc '${{ matrix.ghc }}' --set
ghcup -s vanilla install cabal 3.16.1.0 --set
cabal update
echo "ghc-version=$(ghc --numeric-version)" >> "$GITHUB_OUTPUT"
echo "cabal-version=$(cabal --numeric-version)" >> "$GITHUB_OUTPUT"
echo "cabal-store=$(cabal path -z --store-dir)" >> "$GITHUB_OUTPUT"
- name: Show the versions
id: versions
run: |
ghc --version
cabal --version
echo "GHC ${{ steps.setup.outputs.ghc-version }}, cabal ${{ steps.setup.outputs.cabal-version }}, image $ImageOS $ImageVersion" >> "$GITHUB_STEP_SUMMARY"
echo "image=$ImageOS" >> "$GITHUB_OUTPUT"
- name: Unpack the source tarballs
run: |
shopt -s extglob
cabal sdist all --output-directory="$RUNNER_TEMP"/haskell-gha-sdist
mkdir "$RUNNER_TEMP"/haskell-gha
for f in cabal.project cabal.project.freeze cabal.project.local; do
if [ -f "$f" ]; then cp "$f" "$RUNNER_TEMP"/haskell-gha; fi
done
tar -xzf "$RUNNER_TEMP"/haskell-gha-sdist/old-+([0-9.]).tar.gz --strip-components=1 -C "$RUNNER_TEMP"/haskell-gha
- name: Configure the project
working-directory: ${{ runner.temp }}/haskell-gha
run: |
if [ -f cabal.project.local ]; then
echo '::error::The repository contains cabal.project.local, which holds the settings of one developer. Move the settings to cabal.project or to the key cabal-project-local of the configuration of haskell-gha, and remove the file from the repository.'
exit 1
fi
cat >> cabal.project.local <<'EOF'
jobs: 4
tests: True
benchmarks: True
program-options
ghc-options: -Werror
EOF
- name: Enable parallel module builds for the local packages
working-directory: ${{ runner.temp }}/haskell-gha
run: |
cat >> cabal.project.local <<'EOF'
program-options
ghc-options: -j4
EOF
- name: Make the build plan
id: plan
working-directory: ${{ runner.temp }}/haskell-gha
run: |
cabal build all --dry-run
echo "hash=$(sha256sum dist-newstyle/cache/plan.json | cut -d ' ' -f 1)" >> "$GITHUB_OUTPUT"
- uses: actions/cache/restore@v6
id: cache
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: haskell-gha.yaml-v1-${{ runner.os }}-${{ runner.arch }}-${{ steps.versions.outputs.image }}-ghc-${{ steps.setup.outputs.ghc-version }}-newest-${{ steps.plan.outputs.hash }}
restore-keys: haskell-gha.yaml-v1-${{ runner.os }}-${{ runner.arch }}-${{ steps.versions.outputs.image }}-ghc-${{ steps.setup.outputs.ghc-version }}-newest-
- name: Build the dependencies
working-directory: ${{ runner.temp }}/haskell-gha
run: |
cabal build all --only-dependencies
- uses: actions/cache/save@v6
if: steps.cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ steps.cache.outputs.cache-primary-key }}
- name: Build
working-directory: ${{ runner.temp }}/haskell-gha
run: |
cabal build all
- name: Run the tests
working-directory: ${{ runner.temp }}/haskell-gha
run: |
cabal test all --test-show-details=direct
- name: Check the packages
working-directory: ${{ runner.temp }}/haskell-gha
run: |
failed=0
check() {
echo "Checking the package $1"
(cd "$2" && cabal check) || { echo "::error::cabal check failed for the package $1"; failed=1; }
}
check old .
exit "$failed"
- name: Build the documentation
working-directory: ${{ runner.temp }}/haskell-gha
run: |
cabal haddock all --disable-documentation --haddock-for-hackage