Skip to content

Commit

Permalink
CI attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
alanz committed May 16, 2024
1 parent 68ba2b8 commit 51fb0ce
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 deletions.
32 changes: 11 additions & 21 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.19.20240501
# version: 0.19.20240514
#
# REGENDATA ("0.19.20240501",["github","ghc-exactprint.cabal","--ghcup-jobs"])
# REGENDATA ("0.19.20240514",["github","ghc-exactprint.cabal","--ghcup-jobs"])
#
name: Haskell-CI
on:
Expand Down Expand Up @@ -43,8 +43,13 @@ jobs:
curl -sL https://downloads.haskell.org/ghcup/0.1.22.0/x86_64-linux-ghcup-0.1.22.0 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml
"$HOME/.ghcup/bin/ghcup" install Cabal 3.11.0.0.2024.4.19 || (cat "$HOME"/.ghcup/logs/*.* && false)
# From https://discourse.haskell.org/t/ann-cabal-3-12-0-0-released/9504
"$HOME/.ghcup/bin/ghcup" --no-cache install cabal -u 'https://gitlab.haskell.org/haskell/cabal/-/jobs/1848320/artifacts/raw/out/cabal-install-3.11.0.0-x86_64-linux-alpine3_12.tar.xz' 3.12.0.0-prerelease || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/cabal-3.12.0.0-prerelease" --version || true
cabal --version || true
# "$HOME/.ghcup/bin/ghcup" install cabal 3.11.0.0.2024.4.19 || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
# "$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -62,12 +67,12 @@ jobs:
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.0.0-prerelease -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=true" >> "$GITHUB_ENV"
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
env:
Expand Down Expand Up @@ -96,18 +101,6 @@ 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 Down Expand Up @@ -159,10 +152,7 @@ jobs:
echo " ghc-options: -Werror=missing-methods" >> cabal.project
cat >> cabal.project <<EOF
EOF
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: $_ installed\n" unless /^(ghc-exactprint)$/; }' >> cabal.project.local
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(ghc-exactprint)$/; }' >> cabal.project.local
cat cabal.project
cat cabal.project.local
- name: dump install plan
Expand Down
3 changes: 2 additions & 1 deletion configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -239,5 +239,6 @@ cabal configure -fdev -froundtrip --enable-tests --with-compiler=/opt/ghc/9.10.0
# cabal configure -fdev -froundtrip --enable-tests --with-compiler=/opt/ghc/9.10.1/bin/ghc --allow-newer

# Check final state
cabal configure -fdev --enable-tests --with-compiler=/opt/ghc/9.10.1/bin/ghc
cabal configure -fdev --enable-tests --with-compiler=ghc-9.10.1
# cabal configure -fdev --enable-tests --with-compiler=ghc-9.101 --allow-newer

0 comments on commit 51fb0ce

Please sign in to comment.