@@ -0,0 +1,264 @@
1+# This GitHub workflow config has been generated by a script via
3+# haskell-ci 'github' 'entropy.cabal'
5+# To regenerate the script (for example after adjusting tested-with) run
7+# haskell-ci regenerate
9+# For more information, see https://github.com/andreasabel/haskell-ci
11+# version: 0.19.20241219
13+# REGENDATA ("0.19.20241219",["github","entropy.cabal"])
25+ name: Haskell-CI - Linux - ${{ matrix.compiler }}
26+ runs-on: ubuntu-20.04
30+ image: buildpack-deps:jammy
31+ continue-on-error: ${{ matrix.allow-failure }}
35+ - compiler: ghc-9.12.1
37+ compilerVersion: 9.12.1
40+ - compiler: ghc-9.10.1
42+ compilerVersion: 9.10.1
45+ - compiler: ghc-9.8.4
47+ compilerVersion: 9.8.4
50+ - compiler: ghc-9.6.6
52+ compilerVersion: 9.6.6
55+ - compiler: ghc-9.4.8
57+ compilerVersion: 9.4.8
60+ - compiler: ghc-9.2.8
62+ compilerVersion: 9.2.8
65+ - compiler: ghc-9.0.2
67+ compilerVersion: 9.0.2
70+ - compiler: ghc-8.10.7
72+ compilerVersion: 8.10.7
75+ - compiler: ghc-8.8.4
77+ compilerVersion: 8.8.4
80+ - compiler: ghc-8.6.5
82+ compilerVersion: 8.6.5
85+ - compiler: ghc-8.4.4
87+ compilerVersion: 8.4.4
90+ - compiler: ghc-8.2.2
92+ compilerVersion: 8.2.2
97+ - name: apt-get install
100+ apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev
101+ - name: Install GHCup
103+ mkdir -p "$HOME/.ghcup/bin"
104+ curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup"
105+ chmod a+x "$HOME/.ghcup/bin/ghcup"
106+ - name: Install cabal-install (prerelease)
108+ "$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml;
109+ "$HOME/.ghcup/bin/ghcup" install cabal 3.15.0.0.2024.10.3 || (cat "$HOME"/.ghcup/logs/*.* && false)
110+ echo "CABAL=$HOME/.ghcup/bin/cabal-3.15.0.0.2024.10.3 -vnormal+nowrap" >> "$GITHUB_ENV"
111+ - name: Install GHC (GHCup)
112+ if: matrix.setup-method == 'ghcup'
114+ "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
115+ HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
116+ HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
117+ HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
118+ echo "HC=$HC" >> "$GITHUB_ENV"
119+ echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
120+ echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
122+ HCKIND: ${{ matrix.compilerKind }}
123+ HCNAME: ${{ matrix.compiler }}
124+ HCVER: ${{ matrix.compilerVersion }}
125+ - name: Set PATH and environment variables
127+ echo "$HOME/.cabal/bin" >> $GITHUB_PATH
128+ echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
129+ echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
130+ echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
131+ HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
132+ echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
133+ echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
134+ echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
135+ if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi
136+ echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
138+ HCKIND: ${{ matrix.compilerKind }}
139+ HCNAME: ${{ matrix.compiler }}
140+ HCVER: ${{ matrix.compilerVersion }}
144+ - name: write cabal config
147+ cat >> $CABAL_CONFIG <<EOF
148+ remote-build-reporting: anonymous
149+ write-ghc-environment-files: never
150+ remote-repo-cache: $CABAL_DIR/packages
151+ logs-dir: $CABAL_DIR/logs
152+ world-file: $CABAL_DIR/world
153+ extra-prog-path: $CABAL_DIR/bin
154+ symlink-bindir: $CABAL_DIR/bin
155+ installdir: $CABAL_DIR/bin
156+ build-summary: $CABAL_DIR/logs/build.log
157+ store-dir: $CABAL_DIR/store
160+ repository hackage.haskell.org
161+ url: http://hackage.haskell.org/
163+ if $HEADHACKAGE; then
164+ cat >> $CABAL_CONFIG <<EOF
165+ repository head.hackage.ghc.haskell.org
166+ url: https://ghc.gitlab.haskell.org/head.hackage/
168+ root-keys: 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
169+ 26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
170+ f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
172+ active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
175+ cat >> $CABAL_CONFIG <<EOF
176+ program-default-options
177+ ghc-options: $GHCJOBS +RTS -M3G -RTS
182+ $HC --version || true
183+ $HC --print-project-git-commit-id || true
184+ $CABAL --version || true
185+ - name: update cabal index
188+ - name: install cabal-plan
190+ mkdir -p $HOME/.cabal/bin
191+ 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
192+ echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c -
193+ xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
195+ chmod a+x $HOME/.cabal/bin/cabal-plan
196+ cabal-plan --version
198+ uses: actions/checkout@v4
201+ - name: initial cabal.project for sdist
204+ echo "packages: $GITHUB_WORKSPACE/source/." >> cabal.project
209+ $CABAL sdist all --output-dir $GITHUB_WORKSPACE/sdist
213+ find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \;
214+ - name: generate cabal.project
216+ PKGDIR_entropy="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/entropy-[0-9.]*')"
217+ echo "PKGDIR_entropy=${PKGDIR_entropy}" >> "$GITHUB_ENV"
218+ rm -f cabal.project cabal.project.local
220+ touch cabal.project.local
221+ echo "packages: ${PKGDIR_entropy}" >> cabal.project
222+ echo "package entropy" >> cabal.project
223+ echo " ghc-options: -Werror=missing-methods" >> cabal.project
224+ cat >> cabal.project <<EOF
226+ if $HEADHACKAGE; then
227+ echo "allow-newer: $($HCPKG list --simple-output | sed -E 's/([a-zA-Z-]+)-[0-9.]+/*:\1,/g')" >> cabal.project
229+ $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(entropy)$/; }' >> cabal.project.local
231+ cat cabal.project.local
232+ - name: dump install plan
234+ $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
236+ - name: restore cache
237+ uses: actions/cache/restore@v4
239+ key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
240+ path: ~/.cabal/store
241+ restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-
242+ - name: install dependencies
244+ $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all
245+ $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all
246+ - name: build w/o tests
248+ $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
251+ $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
254+ $CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
255+ - name: unconstrained build
257+ rm -f cabal.project.local
258+ $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
261+ uses: actions/cache/save@v4
263+ key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
264+ path: ~/.cabal/store