Skip to content

Commit

Permalink
Regenerate CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikolaj committed Dec 21, 2024
1 parent d13b753 commit 27c72fe
Showing 1 changed file with 79 additions and 68 deletions.
147 changes: 79 additions & 68 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.14.1
# version: 0.19.20241219
#
# REGENDATA ("0.14.1",["github","horde-ad.cabal"])
# REGENDATA ("0.19.20241219",["github","horde-ad.cabal"])
#

name: Haskell-CI
on:
- push
Expand All @@ -24,42 +23,57 @@ jobs:
timeout-minutes:
60
container:
image: buildpack-deps:bionic
image: buildpack-deps:jammy
continue-on-error: ${{ matrix.allow-failure }}
strategy:
matrix:
include:
- compiler: ghc-9.8.3
- compiler: ghc-9.12.1
compilerKind: ghc
compilerVersion: 9.8.3
compilerVersion: 9.12.1
setup-method: ghcup
allow-failure: false
tests-short: true
- compiler: ghc-9.8.3-nn
- compiler: ghc-9.10.1
compilerKind: ghc
compilerVersion: 9.8.3
compilerVersion: 9.10.1
setup-method: ghcup
allow-failure: false
tests-short: false
- compiler: ghc-9.6.6
- compiler: ghc-9.8.4
compilerKind: ghc
compilerVersion: 9.6.6
compilerVersion: 9.8.4
setup-method: ghcup
allow-failure: false
tests-short: true
- compiler: ghc-9.6.6-nn
- compiler: ghc-9.6.6
compilerKind: ghc
compilerVersion: 9.6.6
setup-method: ghcup
allow-failure: false
tests-short: false
fail-fast: false
steps:
- name: apt
- name: apt-get install
run: |
apt-get update
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libgsl0-dev liblapack-dev libatlas-base-dev
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
- name: Install GHCup
run: |
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
- name: Install cabal-install (prerelease)
run: |
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml;
"$HOME/.ghcup/bin/ghcup" install cabal 3.15.0.0.2024.10.3 || (cat "$HOME"/.ghcup/logs/*.* && false)
echo "CABAL=$HOME/.ghcup/bin/cabal-3.15.0.0.2024.10.3 -vnormal+nowrap" >> "$GITHUB_ENV"
- name: Install GHC (GHCup)
if: matrix.setup-method == 'ghcup'
run: |
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -70,19 +84,12 @@ jobs:
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
HCDIR=/opt/$HCKIND/$HCVER
HC=$HOME/.ghcup/bin/$HCKIND-$HCVER
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC --allow-older=strict-containers:containers" >> "$GITHUB_ENV"
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -109,6 +116,18 @@ jobs:
repository hackage.haskell.org
url: http://hackage.haskell.org/
EOF
if $HEADHACKAGE; then
cat >> $CABAL_CONFIG <<EOF
repository head.hackage.ghc.haskell.org
url: https://ghc.gitlab.haskell.org/head.hackage/
secure: True
root-keys: 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
key-threshold: 3
active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
EOF
fi
cat >> $CABAL_CONFIG <<EOF
program-default-options
ghc-options: $GHCJOBS +RTS -M3G -RTS
Expand All @@ -125,8 +144,8 @@ jobs:
- name: install cabal-plan
run: |
mkdir -p $HOME/.cabal/bin
curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz
echo 'de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz' | sha256sum -c -
curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.7.3.0/cabal-plan-0.7.3.0-x86_64-linux.xz > cabal-plan.xz
echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c -
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
rm -f cabal-plan.xz
chmod a+x $HOME/.cabal/bin/cabal-plan
Expand All @@ -135,9 +154,10 @@ jobs:
uses: actions/checkout@v4
with:
path: source
- name: checkout ox-arrays
- name: checkout ox-arrays and dependent-enummap
run:
git clone --branch=singletons https://git.tomsmeding.com/ox-arrays $GITHUB_WORKSPACE/source/ox-arrays
git clone https://git.tomsmeding.com/dependent-enummap $GITHUB_WORKSPACE/source/dependent-enummap
- name: initial cabal.project for sdist
run: |
touch cabal.project
Expand All @@ -154,69 +174,60 @@ jobs:
- name: generate cabal.project
run: |
PKGDIR_horde_ad="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/horde-ad-[0-9.]*')"
PKGDIR_ox_arrays="$(find "$GITHUB_WORKSPACE/source" -maxdepth 1 -type d -regex '.*/ox-arrays')"
PKGDIR_ox_arrays="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/ox-arrays-[0-9.]*')"
PKGDIR_dependent_enummap="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/dependent-enummap-[0-9.]*')"
echo "PKGDIR_horde_ad=${PKGDIR_horde_ad}" >> "$GITHUB_ENV"
echo "PKGDIR_ox_arrays=${PKGDIR_ox_arrays}" >> "$GITHUB_ENV"
rm -f cabal.project cabal.project.local
touch cabal.project
touch cabal.project.local
echo "packages: ${PKGDIR_horde_ad} ${PKGDIR_ox_arrays}" >> cabal.project
echo "packages: ${PKGDIR_horde_ad} ${PKGDIR_ox_arrays} ${PKGDIR_dependent_enummap}" >> cabal.project
echo "package horde-ad" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
cat >> cabal.project <<EOF
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(horde-ad)$/; }' >> cabal.project.local
if $HEADHACKAGE; then
echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
fi
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(horde-ad)$/; }' >> cabal.project.local
cat cabal.project
cat cabal.project.local
- name: dump install plan
run: |
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run --allow-newer all
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
cabal-plan
- name: cache
uses: actions/cache@v3
- name: restore cache
uses: actions/cache/restore@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-
- name: install dependencies
run: |
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 --allow-newer all
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 --allow-newer all
# - name: build w/o tests
# run: |
# $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --allow-newer -j1 --ghc-options=-fno-specialise-aggressively all
- name: build
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all
- name: build w/o tests
run: |
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --allow-newer -j1 --ghc-options=-fno-specialise-aggressively all --write-ghc-environment-files=always
- name: minimalTest
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
- name: build
run: |
$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH minimalTest --allow-newer -j1 --ghc-options=-fno-specialise-aggressively --test-options='-p "! /PP/"'
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
- name: tests
run: |
ln -s $GITHUB_WORKSPACE/source/samplesData ${PKGDIR_horde_ad}
if [ "${{ matrix.tests-short }}" = true ]; then
$CABAL v2-test --allow-newer -j1 --ghc-options=-fno-specialise-aggressively $ARG_COMPILER $ARG_TESTS $ARG_BENCH simplifiedOnlyTest -ftest_seq --test-options="-p Short_tests"
else
$CABAL v2-test --allow-newer -j1 --ghc-options=-fno-specialise-aggressively $ARG_COMPILER $ARG_TESTS $ARG_BENCH simplifiedOnlyTest -ftest_seq --test-options="-p Neural_network_tests"
fi
# - name: prod benches
# if: ${{ false }} # disable for now
# run: |
# $CABAL v2-bench --allow-newer -j1 --ghc-options=-fno-specialise-aggressively $ARG_COMPILER $ARG_TESTS $ARG_BENCH shortProdForCI
# - name: mnist benches
# if: ${{ false }} # disable for now
# run: |
# $CABAL v2-bench --allow-newer -j1 --ghc-options=-fno-specialise-aggressively $ARG_COMPILER $ARG_TESTS $ARG_BENCH shortMnistForCI
$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
- name: cabal check
if: matrix.tests-short
run: |
cd ${PKGDIR_horde_ad} || false
${CABAL} -vnormal check || true #until TypeAbstractions don't error
${CABAL} -vnormal check
- name: haddock
if: matrix.tests-short
run: |
$CABAL v2-haddock --allow-newer -j1 --ghc-options=-fno-specialise-aggressively --disable-documentation $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
# - name: unconstrained build
# run: |
# rm -f cabal.project.local
# $CABAL v2-build --allow-newer -j1 --ghc-options=-fno-specialise-aggressively $ARG_COMPILER --disable-tests --disable-benchmarks all
$CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
- name: unconstrained build
run: |
rm -f cabal.project.local
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
- name: save cache
if: always()
uses: actions/cache/save@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store

0 comments on commit 27c72fe

Please sign in to comment.