From 57626b4d4101140e4dc1c6bf3449498008c92068 Mon Sep 17 00:00:00 2001 From: Oleg Grenrus Date: Sat, 9 Nov 2024 15:27:23 +0200 Subject: [PATCH] Support multiple setup methods In particular GHCup vanilla and prerelase channels are separate from GHCup default release channel setup method. This allows to use GHC-9.8.3 today (from vanilla release channel) --- .github/workflows/haskell-ci.yml | 53 +++-- CHANGELOG.md | 4 + .../cabal-install-parsers.cabal | 1 + fixtures/all-versions.bash | 4 +- fixtures/all-versions.github | 155 ++++++------ fixtures/all-versions.travis | 5 +- fixtures/copy-fields-all.github | 72 +++--- fixtures/copy-fields-none.github | 72 +++--- fixtures/copy-fields-some.github | 72 +++--- fixtures/doctest-version.bash | 4 +- fixtures/doctest-version.github | 161 ++++++------- fixtures/doctest-version.travis | 5 +- fixtures/doctest.bash | 4 +- fixtures/doctest.github | 161 ++++++------- fixtures/doctest.travis | 5 +- fixtures/empty-line.github | 87 ++++--- fixtures/enabled-jobs.bash | 4 +- fixtures/enabled-jobs.github | 155 ++++++------ fixtures/enabled-jobs.travis | 5 +- fixtures/fail-versions.github | 72 +++--- fixtures/irc-channels.github | 76 +++--- fixtures/messy.github | 88 ++++--- fixtures/psql.github | 72 +++--- fixtures/travis-patch.github | 72 +++--- haskell-ci.cabal | 3 +- haskell-ci.sh | 2 +- src/HaskellCI/Compiler.hs | 7 +- src/HaskellCI/Config.hs | 3 +- src/HaskellCI/Config/Grammar.hs | 8 +- src/HaskellCI/Config/History.hs | 15 +- src/HaskellCI/Config/Initial.hs | 3 + src/HaskellCI/Config/Type.hs | 3 + src/HaskellCI/GitHub.hs | 225 ++++++------------ src/HaskellCI/GitHub/Yaml.hs | 32 +-- 34 files changed, 837 insertions(+), 873 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index ede75a91..a86ded0d 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -35,6 +35,11 @@ jobs: compilerVersion: 9.10.1 setup-method: ghcup allow-failure: false + - compiler: ghc-9.8.3 + compilerKind: ghc + compilerVersion: 9.8.3 + setup-method: ghcup-vanilla + allow-failure: false - compiler: ghc-9.8.2 compilerKind: ghc compilerVersion: 9.8.2 @@ -77,41 +82,59 @@ jobs: allow-failure: 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 + - 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" - "$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 ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) + - name: Install cabal-install + run: | "$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -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) + 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 }} HCVER: ${{ matrix.compilerVersion }} - - name: Set PATH and environment variables + - name: Install GHC (GHCup vanilla) + if: matrix.setup-method == 'ghcup-vanilla' run: | - echo "$HOME/.cabal/bin" >> $GITHUB_PATH - 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 + "$HOME/.ghcup/bin/ghcup" -s https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-vanilla-0.0.8.yaml install ghc "$HCVER" || (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" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + env: + HCKIND: ${{ matrix.compilerKind }} + HCNAME: ${{ matrix.compiler }} + HCVER: ${{ matrix.compilerVersion }} + - name: Set PATH and environment variables + run: | + echo "$HOME/.cabal/bin" >> $GITHUB_PATH + echo "LANG=C.UTF-8" >> "$GITHUB_ENV" + echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV" + echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$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" >> "$GITHUB_ENV" - echo "GHCJSARITH=0" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -158,7 +181,7 @@ jobs: - name: cache (tools) uses: actions/cache/restore@v4 with: - key: ${{ runner.os }}-${{ matrix.compiler }}-tools-4fd5cdc7 + key: ${{ runner.os }}-${{ matrix.compiler }}-tools-c0a7f8fa path: ~/.haskell-ci-tools - name: install cabal-plan run: | @@ -183,10 +206,10 @@ jobs: if [ $((HCNUMVER < 90000)) -ne 0 ] ; then $CABAL --store-dir=$HOME/.haskell-ci-tools/store v2-install $ARG_COMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.22.0' ; fi if [ $((HCNUMVER < 90000)) -ne 0 ] ; then doctest --version ; fi - name: save cache (tools) - uses: actions/cache/save@v4 if: always() + uses: actions/cache/save@v4 with: - key: ${{ runner.os }}-${{ matrix.compiler }}-tools-4fd5cdc7 + key: ${{ runner.os }}-${{ matrix.compiler }}-tools-c0a7f8fa path: ~/.haskell-ci-tools - name: checkout uses: actions/checkout@v4 @@ -289,8 +312,8 @@ jobs: run: | rm -f cabal.project.local - name: save cache - uses: actions/cache/save@v4 if: always() + uses: actions/cache/save@v4 with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} path: ~/.cabal/store diff --git a/CHANGELOG.md b/CHANGELOG.md index a2d8d84b..ac05d9a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.20 + +- Add support for GHCup vanilla and prerelease channels (in a more principled way) + ## 0.18.1 - 2024-02-25 - Add GHC-9.8.2 diff --git a/cabal-install-parsers/cabal-install-parsers.cabal b/cabal-install-parsers/cabal-install-parsers.cabal index b626ef27..bf580145 100644 --- a/cabal-install-parsers/cabal-install-parsers.cabal +++ b/cabal-install-parsers/cabal-install-parsers.cabal @@ -33,6 +33,7 @@ tested-with: || ==9.4.8 || ==9.6.6 || ==9.8.2 + || ==9.8.3 || ==9.10.1 extra-source-files: diff --git a/fixtures/all-versions.bash b/fixtures/all-versions.bash index 831b21d9..b1f55fb2 100644 --- a/fixtures/all-versions.bash +++ b/fixtures/all-versions.bash @@ -1,5 +1,5 @@ # SUCCESS -# *INFO* Generating Bash script for testing for GHC versions: 8.0.1 8.0.2 8.2.1 8.2.2 8.4.1 8.4.2 8.4.3 8.4.4 8.6.1 8.6.2 8.6.3 8.6.4 8.6.5 8.8.1 8.8.2 8.8.3 8.8.4 8.10.1 8.10.2 8.10.3 8.10.4 8.10.5 8.10.6 8.10.7 9.0.1 9.0.2 9.2.1 9.2.2 9.2.3 9.2.4 9.2.5 9.2.6 9.2.7 9.2.8 9.4.1 9.4.2 9.4.3 9.4.4 9.4.5 9.4.6 9.4.7 9.4.8 9.6.1 9.6.2 9.6.3 9.6.4 9.6.5 9.6.6 9.8.1 9.8.2 9.10.1 9.12.1 ghcjs-8.4 +# *INFO* Generating Bash script for testing for GHC versions: 8.0.1 8.0.2 8.2.1 8.2.2 8.4.1 8.4.2 8.4.3 8.4.4 8.6.1 8.6.2 8.6.3 8.6.4 8.6.5 8.8.1 8.8.2 8.8.3 8.8.4 8.10.1 8.10.2 8.10.3 8.10.4 8.10.5 8.10.6 8.10.7 9.0.1 9.0.2 9.2.1 9.2.2 9.2.3 9.2.4 9.2.5 9.2.6 9.2.7 9.2.8 9.4.1 9.4.2 9.4.3 9.4.4 9.4.5 9.4.6 9.4.7 9.4.8 9.6.1 9.6.2 9.6.3 9.6.4 9.6.5 9.6.6 9.8.1 9.8.2 9.8.3 9.10.1 9.12.1 ghcjs-8.4 #!/bin/bash # shellcheck disable=SC2086,SC2016,SC2046 # REGENDATA ["bash","all-versions.project"] @@ -21,7 +21,7 @@ fi CFG_CABAL_STORE_CACHE="" CFG_CABAL_REPO_CACHE="" -CFG_JOBS="9.12.1 9.10.1 9.8.2 9.8.1 9.6.6 9.6.5 9.6.4 9.6.3 9.6.2 9.6.1 9.4.8 9.4.7 9.4.6 9.4.5 9.4.4 9.4.3 9.4.2 9.4.1 9.2.8 9.2.7 9.2.6 9.2.5 9.2.4 9.2.3 9.2.2 9.2.1 9.0.2 9.0.1 8.10.7 8.10.6 8.10.5 8.10.4 8.10.3 8.10.2 8.10.1 8.8.4 8.8.3 8.8.2 8.8.1 8.6.5 8.6.4 8.6.3 8.6.2 8.6.1 8.4.4 8.4.3 8.4.2 8.4.1 8.2.2 8.2.1 8.0.2 8.0.1" +CFG_JOBS="9.12.1 9.10.1 9.8.3 9.8.2 9.8.1 9.6.6 9.6.5 9.6.4 9.6.3 9.6.2 9.6.1 9.4.8 9.4.7 9.4.6 9.4.5 9.4.4 9.4.3 9.4.2 9.4.1 9.2.8 9.2.7 9.2.6 9.2.5 9.2.4 9.2.3 9.2.2 9.2.1 9.0.2 9.0.1 8.10.7 8.10.6 8.10.5 8.10.4 8.10.3 8.10.2 8.10.1 8.8.4 8.8.3 8.8.2 8.8.1 8.6.5 8.6.4 8.6.3 8.6.2 8.6.1 8.4.4 8.4.3 8.4.2 8.4.1 8.2.2 8.2.1 8.0.2 8.0.1" CFG_CABAL_UPDATE=false SCRIPT_NAME=$(basename "$0") diff --git a/fixtures/all-versions.github b/fixtures/all-versions.github index ff39c5da..cc4b8246 100644 --- a/fixtures/all-versions.github +++ b/fixtures/all-versions.github @@ -1,5 +1,5 @@ # SUCCESS -# *INFO* Generating GitHub config for testing for GHC versions: 8.0.1 8.0.2 8.2.1 8.2.2 8.4.1 8.4.2 8.4.3 8.4.4 8.6.1 8.6.2 8.6.3 8.6.4 8.6.5 8.8.1 8.8.2 8.8.3 8.8.4 8.10.1 8.10.2 8.10.3 8.10.4 8.10.5 8.10.6 8.10.7 9.0.1 9.0.2 9.2.1 9.2.2 9.2.3 9.2.4 9.2.5 9.2.6 9.2.7 9.2.8 9.4.1 9.4.2 9.4.3 9.4.4 9.4.5 9.4.6 9.4.7 9.4.8 9.6.1 9.6.2 9.6.3 9.6.4 9.6.5 9.6.6 9.8.1 9.8.2 9.10.1 9.12.1 ghcjs-8.4 +# *INFO* Generating GitHub config for testing for GHC versions: 8.0.1 8.0.2 8.2.1 8.2.2 8.4.1 8.4.2 8.4.3 8.4.4 8.6.1 8.6.2 8.6.3 8.6.4 8.6.5 8.8.1 8.8.2 8.8.3 8.8.4 8.10.1 8.10.2 8.10.3 8.10.4 8.10.5 8.10.6 8.10.7 9.0.1 9.0.2 9.2.1 9.2.2 9.2.3 9.2.4 9.2.5 9.2.6 9.2.7 9.2.8 9.4.1 9.4.2 9.4.3 9.4.4 9.4.5 9.4.6 9.4.7 9.4.8 9.6.1 9.6.2 9.6.3 9.6.4 9.6.5 9.6.6 9.8.1 9.8.2 9.8.3 9.10.1 9.12.1 ghcjs-8.4 # This GitHub workflow config has been generated by a script via # # haskell-ci 'github' 'all-versions.project' @@ -28,21 +28,21 @@ jobs: strategy: matrix: include: - - compiler: ghcjs-8.4 - compilerKind: ghcjs - compilerVersion: "8.4" - setup-method: hvr-ppa - allow-failure: false - compiler: ghc-9.12.0.20241031 compilerKind: ghc compilerVersion: 9.12.0.20241031 - setup-method: ghcup + setup-method: ghcup-prerelease allow-failure: false - compiler: ghc-9.10.1 compilerKind: ghc compilerVersion: 9.10.1 setup-method: ghcup allow-failure: false + - compiler: ghc-9.8.3 + compilerKind: ghc + compilerVersion: 9.8.3 + setup-method: ghcup-vanilla + allow-failure: false - compiler: ghc-9.8.2 compilerKind: ghc compilerVersion: 9.8.2 @@ -253,85 +253,94 @@ jobs: compilerVersion: 8.6.1 setup-method: ghcup allow-failure: false - - compiler: ghc-8.4.4 - compilerKind: ghc - compilerVersion: 8.4.4 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.3 - compilerKind: ghc - compilerVersion: 8.4.3 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.2 - compilerKind: ghc - compilerVersion: 8.4.2 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.1 - compilerKind: ghc - compilerVersion: 8.4.1 - setup-method: ghcup - allow-failure: false - compiler: ghc-8.2.2 compilerKind: ghc compilerVersion: 8.2.2 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.2.1 compilerKind: ghc compilerVersion: 8.2.1 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.0.2 compilerKind: ghc compilerVersion: 8.0.2 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.0.1 compilerKind: ghc compilerVersion: 8.0.1 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false fail-fast: false steps: - - name: Set GHCJS environment variables + - name: apt-get install run: | - if [ $HCKIND = ghcjs ]; then - echo "GHCJS=true" >> "$GITHUB_ENV" - echo "GHCJSARITH=1" >> "$GITHUB_ENV" - else - echo "GHCJS=false" >> "$GITHUB_ENV" - echo "GHCJSARITH=0" >> "$GITHUB_ENV" - fi + apt-get update + 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 + run: | + "$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + - name: Install GHC (hvr-ppa) + if: matrix.setup-method == 'hvr-ppa' + run: | + apt-add-repository -y 'ppa:hvr/ghc' + apt-get update + apt-get install -y "$HCNAME" + HC=$HCDIR/bin/$HCKIND + echo "HC=$HC" >> "$GITHUB_ENV" + echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV" + echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} HCVER: ${{ matrix.compilerVersion }} - - name: apt + - name: Install GHC (GHCup) + if: matrix.setup-method == 'ghcup' run: | - apt-get update - apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev - if [ "${{ matrix.setup-method }}" = ghcup ]; then - 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" - "$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 ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) - "$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) - else - apt-add-repository -y 'ppa:hvr/ghc' - if [ $((GHCJSARITH)) -ne 0 ] ; then apt-add-repository -y 'ppa:hvr/ghcjs' ; fi - if [ $((GHCJSARITH)) -ne 0 ] ; then curl -sSL "https://deb.nodesource.com/gpgkey/nodesource.gpg.key" | apt-key add - ; fi - if [ $((GHCJSARITH)) -ne 0 ] ; then apt-add-repository -y 'deb https://deb.nodesource.com/node_10.x jammy main' ; fi - apt-get update - if [ $((GHCJSARITH)) -ne 0 ] ; then apt-get install -y "$HCNAME" ghc-8.4.4 nodejs ; else apt-get install -y "$HCNAME" ; fi - 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" - "$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.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) - fi + "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (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 }} + HCVER: ${{ matrix.compilerVersion }} + - name: Install GHC (GHCup vanilla) + if: matrix.setup-method == 'ghcup-vanilla' + run: | + "$HOME/.ghcup/bin/ghcup" -s https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-vanilla-0.0.8.yaml install ghc "$HCVER" || (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 }} + HCVER: ${{ matrix.compilerVersion }} + - name: Install GHC (GHCup prerelease) + if: matrix.setup-method == 'ghcup-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 ghc "$HCVER" || (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 }} @@ -339,27 +348,9 @@ jobs: - name: Set PATH and environment variables run: | echo "$HOME/.cabal/bin" >> $GITHUB_PATH - if [ $((GHCJSARITH)) -ne 0 ] ; then echo "/opt/ghc/8.4.4/bin" >> $GITHUB_PATH ; fi 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 - if [ "${{ matrix.setup-method }}" = ghcup ]; then - 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" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" - else - HC=$HCDIR/bin/$HCKIND - echo "HC=$HC" >> "$GITHUB_ENV" - echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV" - echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" - fi - 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" @@ -414,8 +405,6 @@ jobs: $HC --version || true $HC --print-project-git-commit-id || true $CABAL --version || true - if [ $((GHCJSARITH)) -ne 0 ] ; then node --version ; fi - if [ $((GHCJSARITH)) -ne 0 ] ; then echo $GHCJS ; fi - name: update cabal index run: | $CABAL v2-update -v @@ -498,8 +487,8 @@ jobs: rm -f cabal.project.local $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all - name: save cache - uses: actions/cache/save@v4 if: always() + uses: actions/cache/save@v4 with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} path: ~/.cabal/store diff --git a/fixtures/all-versions.travis b/fixtures/all-versions.travis index 33adf573..8dcd14c0 100644 --- a/fixtures/all-versions.travis +++ b/fixtures/all-versions.travis @@ -1,5 +1,5 @@ # SUCCESS -# *INFO* Generating Travis-CI config for testing for GHC versions: 8.0.1 8.0.2 8.2.1 8.2.2 8.4.1 8.4.2 8.4.3 8.4.4 8.6.1 8.6.2 8.6.3 8.6.4 8.6.5 8.8.1 8.8.2 8.8.3 8.8.4 8.10.1 8.10.2 8.10.3 8.10.4 8.10.5 8.10.6 8.10.7 9.0.1 9.0.2 9.2.1 9.2.2 9.2.3 9.2.4 9.2.5 9.2.6 9.2.7 9.2.8 9.4.1 9.4.2 9.4.3 9.4.4 9.4.5 9.4.6 9.4.7 9.4.8 9.6.1 9.6.2 9.6.3 9.6.4 9.6.5 9.6.6 9.8.1 9.8.2 9.10.1 9.12.1 ghcjs-8.4 +# *INFO* Generating Travis-CI config for testing for GHC versions: 8.0.1 8.0.2 8.2.1 8.2.2 8.4.1 8.4.2 8.4.3 8.4.4 8.6.1 8.6.2 8.6.3 8.6.4 8.6.5 8.8.1 8.8.2 8.8.3 8.8.4 8.10.1 8.10.2 8.10.3 8.10.4 8.10.5 8.10.6 8.10.7 9.0.1 9.0.2 9.2.1 9.2.2 9.2.3 9.2.4 9.2.5 9.2.6 9.2.7 9.2.8 9.4.1 9.4.2 9.4.3 9.4.4 9.4.5 9.4.6 9.4.7 9.4.8 9.6.1 9.6.2 9.6.3 9.6.4 9.6.5 9.6.6 9.8.1 9.8.2 9.8.3 9.10.1 9.12.1 ghcjs-8.4 # This Travis job script has been generated by a script via # # haskell-ci 'travis' 'all-versions.project' @@ -42,6 +42,9 @@ jobs: - compiler: ghc-9.10.1 addons: {"apt":{"packages":["ghc-9.10.1","cabal-install-3.12.1.0"],"sources":[{"key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286","sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu jammy main"}]}} os: linux + - compiler: ghc-9.8.3 + addons: {"apt":{"packages":["ghc-9.8.3","cabal-install-3.12.1.0"],"sources":[{"key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286","sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu jammy main"}]}} + os: linux - compiler: ghc-9.8.2 addons: {"apt":{"packages":["ghc-9.8.2","cabal-install-3.12.1.0"],"sources":[{"key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286","sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu jammy main"}]}} os: linux diff --git a/fixtures/copy-fields-all.github b/fixtures/copy-fields-all.github index c08ea432..bda77160 100644 --- a/fixtures/copy-fields-all.github +++ b/fixtures/copy-fields-all.github @@ -108,83 +108,81 @@ jobs: compilerVersion: 8.6.1 setup-method: ghcup allow-failure: false - - compiler: ghc-8.4.4 - compilerKind: ghc - compilerVersion: 8.4.4 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.3 - compilerKind: ghc - compilerVersion: 8.4.3 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.2 - compilerKind: ghc - compilerVersion: 8.4.2 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.1 - compilerKind: ghc - compilerVersion: 8.4.1 - setup-method: ghcup - allow-failure: false - compiler: ghc-8.2.2 compilerKind: ghc compilerVersion: 8.2.2 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.2.1 compilerKind: ghc compilerVersion: 8.2.1 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.0.2 compilerKind: ghc compilerVersion: 8.0.2 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.0.1 compilerKind: ghc compilerVersion: 8.0.1 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: 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 libnuma-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" - "$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 ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) + - name: Install cabal-install + run: | "$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + - name: Install GHC (hvr-ppa) + if: matrix.setup-method == 'hvr-ppa' + run: | + apt-add-repository -y 'ppa:hvr/ghc' + apt-get update + apt-get install -y "$HCNAME" + HC=$HCDIR/bin/$HCKIND + echo "HC=$HC" >> "$GITHUB_ENV" + echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV" + echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} HCVER: ${{ matrix.compilerVersion }} - - name: Set PATH and environment variables + - name: Install GHC (GHCup) + if: matrix.setup-method == 'ghcup' run: | - echo "$HOME/.cabal/bin" >> $GITHUB_PATH - 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 + "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (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" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + env: + HCKIND: ${{ matrix.compilerKind }} + HCNAME: ${{ matrix.compiler }} + HCVER: ${{ matrix.compilerVersion }} + - name: Set PATH and environment variables + run: | + echo "$HOME/.cabal/bin" >> $GITHUB_PATH + echo "LANG=C.UTF-8" >> "$GITHUB_ENV" + echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV" + echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$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" >> "$GITHUB_ENV" - echo "GHCJSARITH=0" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -335,8 +333,8 @@ jobs: rm -f cabal.project.local $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all - name: save cache - uses: actions/cache/save@v4 if: always() + uses: actions/cache/save@v4 with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} path: ~/.cabal/store diff --git a/fixtures/copy-fields-none.github b/fixtures/copy-fields-none.github index 48576a07..63e23dc0 100644 --- a/fixtures/copy-fields-none.github +++ b/fixtures/copy-fields-none.github @@ -108,83 +108,81 @@ jobs: compilerVersion: 8.6.1 setup-method: ghcup allow-failure: false - - compiler: ghc-8.4.4 - compilerKind: ghc - compilerVersion: 8.4.4 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.3 - compilerKind: ghc - compilerVersion: 8.4.3 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.2 - compilerKind: ghc - compilerVersion: 8.4.2 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.1 - compilerKind: ghc - compilerVersion: 8.4.1 - setup-method: ghcup - allow-failure: false - compiler: ghc-8.2.2 compilerKind: ghc compilerVersion: 8.2.2 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.2.1 compilerKind: ghc compilerVersion: 8.2.1 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.0.2 compilerKind: ghc compilerVersion: 8.0.2 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.0.1 compilerKind: ghc compilerVersion: 8.0.1 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: 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 libnuma-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" - "$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 ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) + - name: Install cabal-install + run: | "$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + - name: Install GHC (hvr-ppa) + if: matrix.setup-method == 'hvr-ppa' + run: | + apt-add-repository -y 'ppa:hvr/ghc' + apt-get update + apt-get install -y "$HCNAME" + HC=$HCDIR/bin/$HCKIND + echo "HC=$HC" >> "$GITHUB_ENV" + echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV" + echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} HCVER: ${{ matrix.compilerVersion }} - - name: Set PATH and environment variables + - name: Install GHC (GHCup) + if: matrix.setup-method == 'ghcup' run: | - echo "$HOME/.cabal/bin" >> $GITHUB_PATH - 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 + "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (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" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + env: + HCKIND: ${{ matrix.compilerKind }} + HCNAME: ${{ matrix.compiler }} + HCVER: ${{ matrix.compilerVersion }} + - name: Set PATH and environment variables + run: | + echo "$HOME/.cabal/bin" >> $GITHUB_PATH + echo "LANG=C.UTF-8" >> "$GITHUB_ENV" + echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV" + echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$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" >> "$GITHUB_ENV" - echo "GHCJSARITH=0" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -324,8 +322,8 @@ jobs: rm -f cabal.project.local $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all - name: save cache - uses: actions/cache/save@v4 if: always() + uses: actions/cache/save@v4 with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} path: ~/.cabal/store diff --git a/fixtures/copy-fields-some.github b/fixtures/copy-fields-some.github index c175594d..4a603e13 100644 --- a/fixtures/copy-fields-some.github +++ b/fixtures/copy-fields-some.github @@ -108,83 +108,81 @@ jobs: compilerVersion: 8.6.1 setup-method: ghcup allow-failure: false - - compiler: ghc-8.4.4 - compilerKind: ghc - compilerVersion: 8.4.4 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.3 - compilerKind: ghc - compilerVersion: 8.4.3 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.2 - compilerKind: ghc - compilerVersion: 8.4.2 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.1 - compilerKind: ghc - compilerVersion: 8.4.1 - setup-method: ghcup - allow-failure: false - compiler: ghc-8.2.2 compilerKind: ghc compilerVersion: 8.2.2 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.2.1 compilerKind: ghc compilerVersion: 8.2.1 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.0.2 compilerKind: ghc compilerVersion: 8.0.2 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.0.1 compilerKind: ghc compilerVersion: 8.0.1 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: 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 libnuma-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" - "$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 ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) + - name: Install cabal-install + run: | "$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + - name: Install GHC (hvr-ppa) + if: matrix.setup-method == 'hvr-ppa' + run: | + apt-add-repository -y 'ppa:hvr/ghc' + apt-get update + apt-get install -y "$HCNAME" + HC=$HCDIR/bin/$HCKIND + echo "HC=$HC" >> "$GITHUB_ENV" + echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV" + echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} HCVER: ${{ matrix.compilerVersion }} - - name: Set PATH and environment variables + - name: Install GHC (GHCup) + if: matrix.setup-method == 'ghcup' run: | - echo "$HOME/.cabal/bin" >> $GITHUB_PATH - 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 + "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (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" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + env: + HCKIND: ${{ matrix.compilerKind }} + HCNAME: ${{ matrix.compiler }} + HCVER: ${{ matrix.compilerVersion }} + - name: Set PATH and environment variables + run: | + echo "$HOME/.cabal/bin" >> $GITHUB_PATH + echo "LANG=C.UTF-8" >> "$GITHUB_ENV" + echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV" + echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$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" >> "$GITHUB_ENV" - echo "GHCJSARITH=0" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -327,8 +325,8 @@ jobs: rm -f cabal.project.local $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all - name: save cache - uses: actions/cache/save@v4 if: always() + uses: actions/cache/save@v4 with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} path: ~/.cabal/store diff --git a/fixtures/doctest-version.bash b/fixtures/doctest-version.bash index 6c23e1c0..97be596e 100644 --- a/fixtures/doctest-version.bash +++ b/fixtures/doctest-version.bash @@ -1,5 +1,5 @@ # SUCCESS -# *INFO* Generating Bash script for testing for GHC versions: 8.0.1 8.0.2 8.2.1 8.2.2 8.4.1 8.4.2 8.4.3 8.4.4 8.6.1 8.6.2 8.6.3 8.6.4 8.6.5 8.8.1 8.8.2 8.8.3 8.8.4 8.10.1 8.10.2 8.10.3 8.10.4 8.10.5 8.10.6 8.10.7 9.0.1 9.0.2 9.2.1 9.2.2 9.2.3 9.2.4 9.2.5 9.2.6 9.2.7 9.2.8 9.4.1 9.4.2 9.4.3 9.4.4 9.4.5 9.4.6 9.4.7 9.4.8 9.6.1 9.6.2 9.6.3 9.6.4 9.6.5 9.6.6 9.8.1 9.8.2 9.10.1 9.12.1 ghcjs-8.4 +# *INFO* Generating Bash script for testing for GHC versions: 8.0.1 8.0.2 8.2.1 8.2.2 8.4.1 8.4.2 8.4.3 8.4.4 8.6.1 8.6.2 8.6.3 8.6.4 8.6.5 8.8.1 8.8.2 8.8.3 8.8.4 8.10.1 8.10.2 8.10.3 8.10.4 8.10.5 8.10.6 8.10.7 9.0.1 9.0.2 9.2.1 9.2.2 9.2.3 9.2.4 9.2.5 9.2.6 9.2.7 9.2.8 9.4.1 9.4.2 9.4.3 9.4.4 9.4.5 9.4.6 9.4.7 9.4.8 9.6.1 9.6.2 9.6.3 9.6.4 9.6.5 9.6.6 9.8.1 9.8.2 9.8.3 9.10.1 9.12.1 ghcjs-8.4 #!/bin/bash # shellcheck disable=SC2086,SC2016,SC2046 # REGENDATA ["--doctest","--doctest-version=^>=0.20","bash","doctest-version.project"] @@ -21,7 +21,7 @@ fi CFG_CABAL_STORE_CACHE="" CFG_CABAL_REPO_CACHE="" -CFG_JOBS="9.12.1 9.10.1 9.8.2 9.8.1 9.6.6 9.6.5 9.6.4 9.6.3 9.6.2 9.6.1 9.4.8 9.4.7 9.4.6 9.4.5 9.4.4 9.4.3 9.4.2 9.4.1 9.2.8 9.2.7 9.2.6 9.2.5 9.2.4 9.2.3 9.2.2 9.2.1 9.0.2 9.0.1 8.10.7 8.10.6 8.10.5 8.10.4 8.10.3 8.10.2 8.10.1 8.8.4 8.8.3 8.8.2 8.8.1 8.6.5 8.6.4 8.6.3 8.6.2 8.6.1 8.4.4 8.4.3 8.4.2 8.4.1 8.2.2 8.2.1 8.0.2 8.0.1" +CFG_JOBS="9.12.1 9.10.1 9.8.3 9.8.2 9.8.1 9.6.6 9.6.5 9.6.4 9.6.3 9.6.2 9.6.1 9.4.8 9.4.7 9.4.6 9.4.5 9.4.4 9.4.3 9.4.2 9.4.1 9.2.8 9.2.7 9.2.6 9.2.5 9.2.4 9.2.3 9.2.2 9.2.1 9.0.2 9.0.1 8.10.7 8.10.6 8.10.5 8.10.4 8.10.3 8.10.2 8.10.1 8.8.4 8.8.3 8.8.2 8.8.1 8.6.5 8.6.4 8.6.3 8.6.2 8.6.1 8.4.4 8.4.3 8.4.2 8.4.1 8.2.2 8.2.1 8.0.2 8.0.1" CFG_CABAL_UPDATE=false SCRIPT_NAME=$(basename "$0") diff --git a/fixtures/doctest-version.github b/fixtures/doctest-version.github index 03e2c409..a40f0786 100644 --- a/fixtures/doctest-version.github +++ b/fixtures/doctest-version.github @@ -1,5 +1,5 @@ # SUCCESS -# *INFO* Generating GitHub config for testing for GHC versions: 8.0.1 8.0.2 8.2.1 8.2.2 8.4.1 8.4.2 8.4.3 8.4.4 8.6.1 8.6.2 8.6.3 8.6.4 8.6.5 8.8.1 8.8.2 8.8.3 8.8.4 8.10.1 8.10.2 8.10.3 8.10.4 8.10.5 8.10.6 8.10.7 9.0.1 9.0.2 9.2.1 9.2.2 9.2.3 9.2.4 9.2.5 9.2.6 9.2.7 9.2.8 9.4.1 9.4.2 9.4.3 9.4.4 9.4.5 9.4.6 9.4.7 9.4.8 9.6.1 9.6.2 9.6.3 9.6.4 9.6.5 9.6.6 9.8.1 9.8.2 9.10.1 9.12.1 ghcjs-8.4 +# *INFO* Generating GitHub config for testing for GHC versions: 8.0.1 8.0.2 8.2.1 8.2.2 8.4.1 8.4.2 8.4.3 8.4.4 8.6.1 8.6.2 8.6.3 8.6.4 8.6.5 8.8.1 8.8.2 8.8.3 8.8.4 8.10.1 8.10.2 8.10.3 8.10.4 8.10.5 8.10.6 8.10.7 9.0.1 9.0.2 9.2.1 9.2.2 9.2.3 9.2.4 9.2.5 9.2.6 9.2.7 9.2.8 9.4.1 9.4.2 9.4.3 9.4.4 9.4.5 9.4.6 9.4.7 9.4.8 9.6.1 9.6.2 9.6.3 9.6.4 9.6.5 9.6.6 9.8.1 9.8.2 9.8.3 9.10.1 9.12.1 ghcjs-8.4 # This GitHub workflow config has been generated by a script via # # haskell-ci '--doctest' '--doctest-version=^>=0.20' 'github' 'doctest-version.project' @@ -28,21 +28,21 @@ jobs: strategy: matrix: include: - - compiler: ghcjs-8.4 - compilerKind: ghcjs - compilerVersion: "8.4" - setup-method: hvr-ppa - allow-failure: false - compiler: ghc-9.12.0.20241031 compilerKind: ghc compilerVersion: 9.12.0.20241031 - setup-method: ghcup + setup-method: ghcup-prerelease allow-failure: false - compiler: ghc-9.10.1 compilerKind: ghc compilerVersion: 9.10.1 setup-method: ghcup allow-failure: false + - compiler: ghc-9.8.3 + compilerKind: ghc + compilerVersion: 9.8.3 + setup-method: ghcup-vanilla + allow-failure: false - compiler: ghc-9.8.2 compilerKind: ghc compilerVersion: 9.8.2 @@ -253,85 +253,94 @@ jobs: compilerVersion: 8.6.1 setup-method: ghcup allow-failure: false - - compiler: ghc-8.4.4 - compilerKind: ghc - compilerVersion: 8.4.4 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.3 - compilerKind: ghc - compilerVersion: 8.4.3 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.2 - compilerKind: ghc - compilerVersion: 8.4.2 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.1 - compilerKind: ghc - compilerVersion: 8.4.1 - setup-method: ghcup - allow-failure: false - compiler: ghc-8.2.2 compilerKind: ghc compilerVersion: 8.2.2 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.2.1 compilerKind: ghc compilerVersion: 8.2.1 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.0.2 compilerKind: ghc compilerVersion: 8.0.2 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.0.1 compilerKind: ghc compilerVersion: 8.0.1 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false fail-fast: false steps: - - name: Set GHCJS environment variables + - name: apt-get install run: | - if [ $HCKIND = ghcjs ]; then - echo "GHCJS=true" >> "$GITHUB_ENV" - echo "GHCJSARITH=1" >> "$GITHUB_ENV" - else - echo "GHCJS=false" >> "$GITHUB_ENV" - echo "GHCJSARITH=0" >> "$GITHUB_ENV" - fi + apt-get update + 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 + run: | + "$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + - name: Install GHC (hvr-ppa) + if: matrix.setup-method == 'hvr-ppa' + run: | + apt-add-repository -y 'ppa:hvr/ghc' + apt-get update + apt-get install -y "$HCNAME" + HC=$HCDIR/bin/$HCKIND + echo "HC=$HC" >> "$GITHUB_ENV" + echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV" + echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} HCVER: ${{ matrix.compilerVersion }} - - name: apt + - name: Install GHC (GHCup) + if: matrix.setup-method == 'ghcup' run: | - apt-get update - apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev - if [ "${{ matrix.setup-method }}" = ghcup ]; then - 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" - "$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 ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) - "$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) - else - apt-add-repository -y 'ppa:hvr/ghc' - if [ $((GHCJSARITH)) -ne 0 ] ; then apt-add-repository -y 'ppa:hvr/ghcjs' ; fi - if [ $((GHCJSARITH)) -ne 0 ] ; then curl -sSL "https://deb.nodesource.com/gpgkey/nodesource.gpg.key" | apt-key add - ; fi - if [ $((GHCJSARITH)) -ne 0 ] ; then apt-add-repository -y 'deb https://deb.nodesource.com/node_10.x jammy main' ; fi - apt-get update - if [ $((GHCJSARITH)) -ne 0 ] ; then apt-get install -y "$HCNAME" ghc-8.4.4 nodejs ; else apt-get install -y "$HCNAME" ; fi - 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" - "$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.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) - fi + "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (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 }} + HCVER: ${{ matrix.compilerVersion }} + - name: Install GHC (GHCup vanilla) + if: matrix.setup-method == 'ghcup-vanilla' + run: | + "$HOME/.ghcup/bin/ghcup" -s https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-vanilla-0.0.8.yaml install ghc "$HCVER" || (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 }} + HCVER: ${{ matrix.compilerVersion }} + - name: Install GHC (GHCup prerelease) + if: matrix.setup-method == 'ghcup-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 ghc "$HCVER" || (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 }} @@ -339,27 +348,9 @@ jobs: - name: Set PATH and environment variables run: | echo "$HOME/.cabal/bin" >> $GITHUB_PATH - if [ $((GHCJSARITH)) -ne 0 ] ; then echo "/opt/ghc/8.4.4/bin" >> $GITHUB_PATH ; fi 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 - if [ "${{ matrix.setup-method }}" = ghcup ]; then - 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" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" - else - HC=$HCDIR/bin/$HCKIND - echo "HC=$HC" >> "$GITHUB_ENV" - echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV" - echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" - fi - 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" @@ -414,15 +405,13 @@ jobs: $HC --version || true $HC --print-project-git-commit-id || true $CABAL --version || true - if [ $((GHCJSARITH)) -ne 0 ] ; then node --version ; fi - if [ $((GHCJSARITH)) -ne 0 ] ; then echo $GHCJS ; fi - name: update cabal index run: | $CABAL v2-update -v - name: cache (tools) uses: actions/cache/restore@v4 with: - key: ${{ runner.os }}-${{ matrix.compiler }}-tools-9ea05c43 + key: ${{ runner.os }}-${{ matrix.compiler }}-tools-1e171e27 path: ~/.haskell-ci-tools - name: install cabal-plan run: | @@ -438,10 +427,10 @@ jobs: if [ $((! GHCJSARITH)) -ne 0 ] ; then $CABAL --store-dir=$HOME/.haskell-ci-tools/store v2-install $ARG_COMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.20' ; fi if [ $((! GHCJSARITH)) -ne 0 ] ; then doctest --version ; fi - name: save cache (tools) - uses: actions/cache/save@v4 if: always() + uses: actions/cache/save@v4 with: - key: ${{ runner.os }}-${{ matrix.compiler }}-tools-9ea05c43 + key: ${{ runner.os }}-${{ matrix.compiler }}-tools-1e171e27 path: ~/.haskell-ci-tools - name: checkout uses: actions/checkout@v4 @@ -517,8 +506,8 @@ jobs: rm -f cabal.project.local $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all - name: save cache - uses: actions/cache/save@v4 if: always() + uses: actions/cache/save@v4 with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} path: ~/.cabal/store diff --git a/fixtures/doctest-version.travis b/fixtures/doctest-version.travis index d82fac03..f6f56103 100644 --- a/fixtures/doctest-version.travis +++ b/fixtures/doctest-version.travis @@ -1,5 +1,5 @@ # SUCCESS -# *INFO* Generating Travis-CI config for testing for GHC versions: 8.0.1 8.0.2 8.2.1 8.2.2 8.4.1 8.4.2 8.4.3 8.4.4 8.6.1 8.6.2 8.6.3 8.6.4 8.6.5 8.8.1 8.8.2 8.8.3 8.8.4 8.10.1 8.10.2 8.10.3 8.10.4 8.10.5 8.10.6 8.10.7 9.0.1 9.0.2 9.2.1 9.2.2 9.2.3 9.2.4 9.2.5 9.2.6 9.2.7 9.2.8 9.4.1 9.4.2 9.4.3 9.4.4 9.4.5 9.4.6 9.4.7 9.4.8 9.6.1 9.6.2 9.6.3 9.6.4 9.6.5 9.6.6 9.8.1 9.8.2 9.10.1 9.12.1 ghcjs-8.4 +# *INFO* Generating Travis-CI config for testing for GHC versions: 8.0.1 8.0.2 8.2.1 8.2.2 8.4.1 8.4.2 8.4.3 8.4.4 8.6.1 8.6.2 8.6.3 8.6.4 8.6.5 8.8.1 8.8.2 8.8.3 8.8.4 8.10.1 8.10.2 8.10.3 8.10.4 8.10.5 8.10.6 8.10.7 9.0.1 9.0.2 9.2.1 9.2.2 9.2.3 9.2.4 9.2.5 9.2.6 9.2.7 9.2.8 9.4.1 9.4.2 9.4.3 9.4.4 9.4.5 9.4.6 9.4.7 9.4.8 9.6.1 9.6.2 9.6.3 9.6.4 9.6.5 9.6.6 9.8.1 9.8.2 9.8.3 9.10.1 9.12.1 ghcjs-8.4 # This Travis job script has been generated by a script via # # haskell-ci '--doctest' '--doctest-version=^>=0.20' 'travis' 'doctest-version.project' @@ -42,6 +42,9 @@ jobs: - compiler: ghc-9.10.1 addons: {"apt":{"packages":["ghc-9.10.1","cabal-install-3.12.1.0"],"sources":[{"key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286","sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu jammy main"}]}} os: linux + - compiler: ghc-9.8.3 + addons: {"apt":{"packages":["ghc-9.8.3","cabal-install-3.12.1.0"],"sources":[{"key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286","sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu jammy main"}]}} + os: linux - compiler: ghc-9.8.2 addons: {"apt":{"packages":["ghc-9.8.2","cabal-install-3.12.1.0"],"sources":[{"key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286","sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu jammy main"}]}} os: linux diff --git a/fixtures/doctest.bash b/fixtures/doctest.bash index d9bf8a24..7aafd4f0 100644 --- a/fixtures/doctest.bash +++ b/fixtures/doctest.bash @@ -1,5 +1,5 @@ # SUCCESS -# *INFO* Generating Bash script for testing for GHC versions: 8.0.1 8.0.2 8.2.1 8.2.2 8.4.1 8.4.2 8.4.3 8.4.4 8.6.1 8.6.2 8.6.3 8.6.4 8.6.5 8.8.1 8.8.2 8.8.3 8.8.4 8.10.1 8.10.2 8.10.3 8.10.4 8.10.5 8.10.6 8.10.7 9.0.1 9.0.2 9.2.1 9.2.2 9.2.3 9.2.4 9.2.5 9.2.6 9.2.7 9.2.8 9.4.1 9.4.2 9.4.3 9.4.4 9.4.5 9.4.6 9.4.7 9.4.8 9.6.1 9.6.2 9.6.3 9.6.4 9.6.5 9.6.6 9.8.1 9.8.2 9.10.1 9.12.1 ghcjs-8.4 +# *INFO* Generating Bash script for testing for GHC versions: 8.0.1 8.0.2 8.2.1 8.2.2 8.4.1 8.4.2 8.4.3 8.4.4 8.6.1 8.6.2 8.6.3 8.6.4 8.6.5 8.8.1 8.8.2 8.8.3 8.8.4 8.10.1 8.10.2 8.10.3 8.10.4 8.10.5 8.10.6 8.10.7 9.0.1 9.0.2 9.2.1 9.2.2 9.2.3 9.2.4 9.2.5 9.2.6 9.2.7 9.2.8 9.4.1 9.4.2 9.4.3 9.4.4 9.4.5 9.4.6 9.4.7 9.4.8 9.6.1 9.6.2 9.6.3 9.6.4 9.6.5 9.6.6 9.8.1 9.8.2 9.8.3 9.10.1 9.12.1 ghcjs-8.4 #!/bin/bash # shellcheck disable=SC2086,SC2016,SC2046 # REGENDATA ["--doctest","bash","doctest.project"] @@ -21,7 +21,7 @@ fi CFG_CABAL_STORE_CACHE="" CFG_CABAL_REPO_CACHE="" -CFG_JOBS="9.12.1 9.10.1 9.8.2 9.8.1 9.6.6 9.6.5 9.6.4 9.6.3 9.6.2 9.6.1 9.4.8 9.4.7 9.4.6 9.4.5 9.4.4 9.4.3 9.4.2 9.4.1 9.2.8 9.2.7 9.2.6 9.2.5 9.2.4 9.2.3 9.2.2 9.2.1 9.0.2 9.0.1 8.10.7 8.10.6 8.10.5 8.10.4 8.10.3 8.10.2 8.10.1 8.8.4 8.8.3 8.8.2 8.8.1 8.6.5 8.6.4 8.6.3 8.6.2 8.6.1 8.4.4 8.4.3 8.4.2 8.4.1 8.2.2 8.2.1 8.0.2 8.0.1" +CFG_JOBS="9.12.1 9.10.1 9.8.3 9.8.2 9.8.1 9.6.6 9.6.5 9.6.4 9.6.3 9.6.2 9.6.1 9.4.8 9.4.7 9.4.6 9.4.5 9.4.4 9.4.3 9.4.2 9.4.1 9.2.8 9.2.7 9.2.6 9.2.5 9.2.4 9.2.3 9.2.2 9.2.1 9.0.2 9.0.1 8.10.7 8.10.6 8.10.5 8.10.4 8.10.3 8.10.2 8.10.1 8.8.4 8.8.3 8.8.2 8.8.1 8.6.5 8.6.4 8.6.3 8.6.2 8.6.1 8.4.4 8.4.3 8.4.2 8.4.1 8.2.2 8.2.1 8.0.2 8.0.1" CFG_CABAL_UPDATE=false SCRIPT_NAME=$(basename "$0") diff --git a/fixtures/doctest.github b/fixtures/doctest.github index ded514d5..2abb6523 100644 --- a/fixtures/doctest.github +++ b/fixtures/doctest.github @@ -1,5 +1,5 @@ # SUCCESS -# *INFO* Generating GitHub config for testing for GHC versions: 8.0.1 8.0.2 8.2.1 8.2.2 8.4.1 8.4.2 8.4.3 8.4.4 8.6.1 8.6.2 8.6.3 8.6.4 8.6.5 8.8.1 8.8.2 8.8.3 8.8.4 8.10.1 8.10.2 8.10.3 8.10.4 8.10.5 8.10.6 8.10.7 9.0.1 9.0.2 9.2.1 9.2.2 9.2.3 9.2.4 9.2.5 9.2.6 9.2.7 9.2.8 9.4.1 9.4.2 9.4.3 9.4.4 9.4.5 9.4.6 9.4.7 9.4.8 9.6.1 9.6.2 9.6.3 9.6.4 9.6.5 9.6.6 9.8.1 9.8.2 9.10.1 9.12.1 ghcjs-8.4 +# *INFO* Generating GitHub config for testing for GHC versions: 8.0.1 8.0.2 8.2.1 8.2.2 8.4.1 8.4.2 8.4.3 8.4.4 8.6.1 8.6.2 8.6.3 8.6.4 8.6.5 8.8.1 8.8.2 8.8.3 8.8.4 8.10.1 8.10.2 8.10.3 8.10.4 8.10.5 8.10.6 8.10.7 9.0.1 9.0.2 9.2.1 9.2.2 9.2.3 9.2.4 9.2.5 9.2.6 9.2.7 9.2.8 9.4.1 9.4.2 9.4.3 9.4.4 9.4.5 9.4.6 9.4.7 9.4.8 9.6.1 9.6.2 9.6.3 9.6.4 9.6.5 9.6.6 9.8.1 9.8.2 9.8.3 9.10.1 9.12.1 ghcjs-8.4 # This GitHub workflow config has been generated by a script via # # haskell-ci '--doctest' 'github' 'doctest.project' @@ -28,21 +28,21 @@ jobs: strategy: matrix: include: - - compiler: ghcjs-8.4 - compilerKind: ghcjs - compilerVersion: "8.4" - setup-method: hvr-ppa - allow-failure: false - compiler: ghc-9.12.0.20241031 compilerKind: ghc compilerVersion: 9.12.0.20241031 - setup-method: ghcup + setup-method: ghcup-prerelease allow-failure: false - compiler: ghc-9.10.1 compilerKind: ghc compilerVersion: 9.10.1 setup-method: ghcup allow-failure: false + - compiler: ghc-9.8.3 + compilerKind: ghc + compilerVersion: 9.8.3 + setup-method: ghcup-vanilla + allow-failure: false - compiler: ghc-9.8.2 compilerKind: ghc compilerVersion: 9.8.2 @@ -253,85 +253,94 @@ jobs: compilerVersion: 8.6.1 setup-method: ghcup allow-failure: false - - compiler: ghc-8.4.4 - compilerKind: ghc - compilerVersion: 8.4.4 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.3 - compilerKind: ghc - compilerVersion: 8.4.3 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.2 - compilerKind: ghc - compilerVersion: 8.4.2 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.1 - compilerKind: ghc - compilerVersion: 8.4.1 - setup-method: ghcup - allow-failure: false - compiler: ghc-8.2.2 compilerKind: ghc compilerVersion: 8.2.2 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.2.1 compilerKind: ghc compilerVersion: 8.2.1 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.0.2 compilerKind: ghc compilerVersion: 8.0.2 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.0.1 compilerKind: ghc compilerVersion: 8.0.1 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false fail-fast: false steps: - - name: Set GHCJS environment variables + - name: apt-get install run: | - if [ $HCKIND = ghcjs ]; then - echo "GHCJS=true" >> "$GITHUB_ENV" - echo "GHCJSARITH=1" >> "$GITHUB_ENV" - else - echo "GHCJS=false" >> "$GITHUB_ENV" - echo "GHCJSARITH=0" >> "$GITHUB_ENV" - fi + apt-get update + 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 + run: | + "$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + - name: Install GHC (hvr-ppa) + if: matrix.setup-method == 'hvr-ppa' + run: | + apt-add-repository -y 'ppa:hvr/ghc' + apt-get update + apt-get install -y "$HCNAME" + HC=$HCDIR/bin/$HCKIND + echo "HC=$HC" >> "$GITHUB_ENV" + echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV" + echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} HCVER: ${{ matrix.compilerVersion }} - - name: apt + - name: Install GHC (GHCup) + if: matrix.setup-method == 'ghcup' run: | - apt-get update - apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev - if [ "${{ matrix.setup-method }}" = ghcup ]; then - 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" - "$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 ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) - "$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) - else - apt-add-repository -y 'ppa:hvr/ghc' - if [ $((GHCJSARITH)) -ne 0 ] ; then apt-add-repository -y 'ppa:hvr/ghcjs' ; fi - if [ $((GHCJSARITH)) -ne 0 ] ; then curl -sSL "https://deb.nodesource.com/gpgkey/nodesource.gpg.key" | apt-key add - ; fi - if [ $((GHCJSARITH)) -ne 0 ] ; then apt-add-repository -y 'deb https://deb.nodesource.com/node_10.x jammy main' ; fi - apt-get update - if [ $((GHCJSARITH)) -ne 0 ] ; then apt-get install -y "$HCNAME" ghc-8.4.4 nodejs ; else apt-get install -y "$HCNAME" ; fi - 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" - "$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.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) - fi + "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (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 }} + HCVER: ${{ matrix.compilerVersion }} + - name: Install GHC (GHCup vanilla) + if: matrix.setup-method == 'ghcup-vanilla' + run: | + "$HOME/.ghcup/bin/ghcup" -s https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-vanilla-0.0.8.yaml install ghc "$HCVER" || (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 }} + HCVER: ${{ matrix.compilerVersion }} + - name: Install GHC (GHCup prerelease) + if: matrix.setup-method == 'ghcup-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 ghc "$HCVER" || (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 }} @@ -339,27 +348,9 @@ jobs: - name: Set PATH and environment variables run: | echo "$HOME/.cabal/bin" >> $GITHUB_PATH - if [ $((GHCJSARITH)) -ne 0 ] ; then echo "/opt/ghc/8.4.4/bin" >> $GITHUB_PATH ; fi 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 - if [ "${{ matrix.setup-method }}" = ghcup ]; then - 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" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" - else - HC=$HCDIR/bin/$HCKIND - echo "HC=$HC" >> "$GITHUB_ENV" - echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV" - echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" - fi - 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" @@ -414,15 +405,13 @@ jobs: $HC --version || true $HC --print-project-git-commit-id || true $CABAL --version || true - if [ $((GHCJSARITH)) -ne 0 ] ; then node --version ; fi - if [ $((GHCJSARITH)) -ne 0 ] ; then echo $GHCJS ; fi - name: update cabal index run: | $CABAL v2-update -v - name: cache (tools) uses: actions/cache/restore@v4 with: - key: ${{ runner.os }}-${{ matrix.compiler }}-tools-ac1dc7e1 + key: ${{ runner.os }}-${{ matrix.compiler }}-tools-2c3ba78a path: ~/.haskell-ci-tools - name: install cabal-plan run: | @@ -438,10 +427,10 @@ jobs: if [ $((! GHCJSARITH)) -ne 0 ] ; then $CABAL --store-dir=$HOME/.haskell-ci-tools/store v2-install $ARG_COMPILER --ignore-project -j2 doctest --constraint='doctest ^>=0.22.0' ; fi if [ $((! GHCJSARITH)) -ne 0 ] ; then doctest --version ; fi - name: save cache (tools) - uses: actions/cache/save@v4 if: always() + uses: actions/cache/save@v4 with: - key: ${{ runner.os }}-${{ matrix.compiler }}-tools-ac1dc7e1 + key: ${{ runner.os }}-${{ matrix.compiler }}-tools-2c3ba78a path: ~/.haskell-ci-tools - name: checkout uses: actions/checkout@v4 @@ -517,8 +506,8 @@ jobs: rm -f cabal.project.local $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all - name: save cache - uses: actions/cache/save@v4 if: always() + uses: actions/cache/save@v4 with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} path: ~/.cabal/store diff --git a/fixtures/doctest.travis b/fixtures/doctest.travis index 66f43032..5fc77232 100644 --- a/fixtures/doctest.travis +++ b/fixtures/doctest.travis @@ -1,5 +1,5 @@ # SUCCESS -# *INFO* Generating Travis-CI config for testing for GHC versions: 8.0.1 8.0.2 8.2.1 8.2.2 8.4.1 8.4.2 8.4.3 8.4.4 8.6.1 8.6.2 8.6.3 8.6.4 8.6.5 8.8.1 8.8.2 8.8.3 8.8.4 8.10.1 8.10.2 8.10.3 8.10.4 8.10.5 8.10.6 8.10.7 9.0.1 9.0.2 9.2.1 9.2.2 9.2.3 9.2.4 9.2.5 9.2.6 9.2.7 9.2.8 9.4.1 9.4.2 9.4.3 9.4.4 9.4.5 9.4.6 9.4.7 9.4.8 9.6.1 9.6.2 9.6.3 9.6.4 9.6.5 9.6.6 9.8.1 9.8.2 9.10.1 9.12.1 ghcjs-8.4 +# *INFO* Generating Travis-CI config for testing for GHC versions: 8.0.1 8.0.2 8.2.1 8.2.2 8.4.1 8.4.2 8.4.3 8.4.4 8.6.1 8.6.2 8.6.3 8.6.4 8.6.5 8.8.1 8.8.2 8.8.3 8.8.4 8.10.1 8.10.2 8.10.3 8.10.4 8.10.5 8.10.6 8.10.7 9.0.1 9.0.2 9.2.1 9.2.2 9.2.3 9.2.4 9.2.5 9.2.6 9.2.7 9.2.8 9.4.1 9.4.2 9.4.3 9.4.4 9.4.5 9.4.6 9.4.7 9.4.8 9.6.1 9.6.2 9.6.3 9.6.4 9.6.5 9.6.6 9.8.1 9.8.2 9.8.3 9.10.1 9.12.1 ghcjs-8.4 # This Travis job script has been generated by a script via # # haskell-ci '--doctest' 'travis' 'doctest.project' @@ -42,6 +42,9 @@ jobs: - compiler: ghc-9.10.1 addons: {"apt":{"packages":["ghc-9.10.1","cabal-install-3.12.1.0"],"sources":[{"key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286","sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu jammy main"}]}} os: linux + - compiler: ghc-9.8.3 + addons: {"apt":{"packages":["ghc-9.8.3","cabal-install-3.12.1.0"],"sources":[{"key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286","sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu jammy main"}]}} + os: linux - compiler: ghc-9.8.2 addons: {"apt":{"packages":["ghc-9.8.2","cabal-install-3.12.1.0"],"sources":[{"key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286","sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu jammy main"}]}} os: linux diff --git a/fixtures/empty-line.github b/fixtures/empty-line.github index e80f308d..f0a37bbe 100644 --- a/fixtures/empty-line.github +++ b/fixtures/empty-line.github @@ -108,83 +108,96 @@ jobs: compilerVersion: 8.6.1 setup-method: ghcup allow-failure: false - - compiler: ghc-8.4.4 - compilerKind: ghc - compilerVersion: 8.4.4 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.3 - compilerKind: ghc - compilerVersion: 8.4.3 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.2 - compilerKind: ghc - compilerVersion: 8.4.2 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.1 - compilerKind: ghc - compilerVersion: 8.4.1 - setup-method: ghcup - allow-failure: false - compiler: ghc-8.2.2 compilerKind: ghc compilerVersion: 8.2.2 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.2.1 compilerKind: ghc compilerVersion: 8.2.1 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.0.2 compilerKind: ghc compilerVersion: 8.0.2 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.0.1 compilerKind: ghc compilerVersion: 8.0.1 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: 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 libnuma-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" - "$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 ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) + - name: Install cabal-install + run: | "$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + - name: Install GHC (hvr-ppa) + if: matrix.setup-method == 'hvr-ppa' + run: | + apt-add-repository -y 'ppa:hvr/ghc' + apt-get update + apt-get install -y "$HCNAME" + HC=$HCDIR/bin/$HCKIND + echo "HC=$HC" >> "$GITHUB_ENV" + echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV" + echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} HCVER: ${{ matrix.compilerVersion }} - - name: Set PATH and environment variables + - name: Install GHC (GHCup) + if: matrix.setup-method == 'ghcup' run: | - echo "$HOME/.cabal/bin" >> $GITHUB_PATH - 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 + "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (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" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + env: + HCKIND: ${{ matrix.compilerKind }} + HCNAME: ${{ matrix.compiler }} + HCVER: ${{ matrix.compilerVersion }} + - name: Install GHC (GHCup prerelease) + if: matrix.setup-method == 'ghcup-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 ghc "$HCVER" || (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 }} + HCVER: ${{ matrix.compilerVersion }} + - name: Set PATH and environment variables + run: | + echo "$HOME/.cabal/bin" >> $GITHUB_PATH + echo "LANG=C.UTF-8" >> "$GITHUB_ENV" + echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV" + echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$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" if [ $((HCNUMVER > 81007)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV" - echo "GHCJSARITH=0" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -342,8 +355,8 @@ jobs: rm -f cabal.project.local $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all - name: save cache - uses: actions/cache/save@v4 if: always() + uses: actions/cache/save@v4 with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} path: ~/.cabal/store diff --git a/fixtures/enabled-jobs.bash b/fixtures/enabled-jobs.bash index 0911252f..4a465656 100644 --- a/fixtures/enabled-jobs.bash +++ b/fixtures/enabled-jobs.bash @@ -1,5 +1,5 @@ # SUCCESS -# *INFO* Generating Bash script for testing for GHC versions: 8.0.1 8.0.2 8.2.1 8.2.2 8.4.1 8.4.2 8.4.3 8.4.4 8.6.1 8.6.2 8.6.3 8.6.4 8.6.5 8.8.1 8.8.2 8.8.3 8.8.4 8.10.1 8.10.2 8.10.3 8.10.4 8.10.5 8.10.6 8.10.7 9.0.1 9.0.2 9.2.1 9.2.2 9.2.3 9.2.4 9.2.5 9.2.6 9.2.7 9.2.8 9.4.1 9.4.2 9.4.3 9.4.4 9.4.5 9.4.6 9.4.7 9.4.8 9.6.1 9.6.2 9.6.3 9.6.4 9.6.5 9.6.6 9.8.1 9.8.2 9.10.1 9.12.1 ghcjs-8.4 +# *INFO* Generating Bash script for testing for GHC versions: 8.0.1 8.0.2 8.2.1 8.2.2 8.4.1 8.4.2 8.4.3 8.4.4 8.6.1 8.6.2 8.6.3 8.6.4 8.6.5 8.8.1 8.8.2 8.8.3 8.8.4 8.10.1 8.10.2 8.10.3 8.10.4 8.10.5 8.10.6 8.10.7 9.0.1 9.0.2 9.2.1 9.2.2 9.2.3 9.2.4 9.2.5 9.2.6 9.2.7 9.2.8 9.4.1 9.4.2 9.4.3 9.4.4 9.4.5 9.4.6 9.4.7 9.4.8 9.6.1 9.6.2 9.6.3 9.6.4 9.6.5 9.6.6 9.8.1 9.8.2 9.8.3 9.10.1 9.12.1 ghcjs-8.4 #!/bin/bash # shellcheck disable=SC2086,SC2016,SC2046 # REGENDATA ["--enabled-jobs=>=8","bash","enabled-jobs.project"] @@ -21,7 +21,7 @@ fi CFG_CABAL_STORE_CACHE="" CFG_CABAL_REPO_CACHE="" -CFG_JOBS="9.12.1 9.10.1 9.8.2 9.8.1 9.6.6 9.6.5 9.6.4 9.6.3 9.6.2 9.6.1 9.4.8 9.4.7 9.4.6 9.4.5 9.4.4 9.4.3 9.4.2 9.4.1 9.2.8 9.2.7 9.2.6 9.2.5 9.2.4 9.2.3 9.2.2 9.2.1 9.0.2 9.0.1 8.10.7 8.10.6 8.10.5 8.10.4 8.10.3 8.10.2 8.10.1 8.8.4 8.8.3 8.8.2 8.8.1 8.6.5 8.6.4 8.6.3 8.6.2 8.6.1 8.4.4 8.4.3 8.4.2 8.4.1 8.2.2 8.2.1 8.0.2 8.0.1" +CFG_JOBS="9.12.1 9.10.1 9.8.3 9.8.2 9.8.1 9.6.6 9.6.5 9.6.4 9.6.3 9.6.2 9.6.1 9.4.8 9.4.7 9.4.6 9.4.5 9.4.4 9.4.3 9.4.2 9.4.1 9.2.8 9.2.7 9.2.6 9.2.5 9.2.4 9.2.3 9.2.2 9.2.1 9.0.2 9.0.1 8.10.7 8.10.6 8.10.5 8.10.4 8.10.3 8.10.2 8.10.1 8.8.4 8.8.3 8.8.2 8.8.1 8.6.5 8.6.4 8.6.3 8.6.2 8.6.1 8.4.4 8.4.3 8.4.2 8.4.1 8.2.2 8.2.1 8.0.2 8.0.1" CFG_CABAL_UPDATE=false SCRIPT_NAME=$(basename "$0") diff --git a/fixtures/enabled-jobs.github b/fixtures/enabled-jobs.github index 5e8e041d..58590c4e 100644 --- a/fixtures/enabled-jobs.github +++ b/fixtures/enabled-jobs.github @@ -1,5 +1,5 @@ # SUCCESS -# *INFO* Generating GitHub config for testing for GHC versions: 8.0.1 8.0.2 8.2.1 8.2.2 8.4.1 8.4.2 8.4.3 8.4.4 8.6.1 8.6.2 8.6.3 8.6.4 8.6.5 8.8.1 8.8.2 8.8.3 8.8.4 8.10.1 8.10.2 8.10.3 8.10.4 8.10.5 8.10.6 8.10.7 9.0.1 9.0.2 9.2.1 9.2.2 9.2.3 9.2.4 9.2.5 9.2.6 9.2.7 9.2.8 9.4.1 9.4.2 9.4.3 9.4.4 9.4.5 9.4.6 9.4.7 9.4.8 9.6.1 9.6.2 9.6.3 9.6.4 9.6.5 9.6.6 9.8.1 9.8.2 9.10.1 9.12.1 ghcjs-8.4 +# *INFO* Generating GitHub config for testing for GHC versions: 8.0.1 8.0.2 8.2.1 8.2.2 8.4.1 8.4.2 8.4.3 8.4.4 8.6.1 8.6.2 8.6.3 8.6.4 8.6.5 8.8.1 8.8.2 8.8.3 8.8.4 8.10.1 8.10.2 8.10.3 8.10.4 8.10.5 8.10.6 8.10.7 9.0.1 9.0.2 9.2.1 9.2.2 9.2.3 9.2.4 9.2.5 9.2.6 9.2.7 9.2.8 9.4.1 9.4.2 9.4.3 9.4.4 9.4.5 9.4.6 9.4.7 9.4.8 9.6.1 9.6.2 9.6.3 9.6.4 9.6.5 9.6.6 9.8.1 9.8.2 9.8.3 9.10.1 9.12.1 ghcjs-8.4 # This GitHub workflow config has been generated by a script via # # haskell-ci '--enabled-jobs=>=8' 'github' 'enabled-jobs.project' @@ -28,21 +28,21 @@ jobs: strategy: matrix: include: - - compiler: ghcjs-8.4 - compilerKind: ghcjs - compilerVersion: "8.4" - setup-method: hvr-ppa - allow-failure: false - compiler: ghc-9.12.0.20241031 compilerKind: ghc compilerVersion: 9.12.0.20241031 - setup-method: ghcup + setup-method: ghcup-prerelease allow-failure: false - compiler: ghc-9.10.1 compilerKind: ghc compilerVersion: 9.10.1 setup-method: ghcup allow-failure: false + - compiler: ghc-9.8.3 + compilerKind: ghc + compilerVersion: 9.8.3 + setup-method: ghcup-vanilla + allow-failure: false - compiler: ghc-9.8.2 compilerKind: ghc compilerVersion: 9.8.2 @@ -253,85 +253,94 @@ jobs: compilerVersion: 8.6.1 setup-method: ghcup allow-failure: false - - compiler: ghc-8.4.4 - compilerKind: ghc - compilerVersion: 8.4.4 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.3 - compilerKind: ghc - compilerVersion: 8.4.3 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.2 - compilerKind: ghc - compilerVersion: 8.4.2 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.1 - compilerKind: ghc - compilerVersion: 8.4.1 - setup-method: ghcup - allow-failure: false - compiler: ghc-8.2.2 compilerKind: ghc compilerVersion: 8.2.2 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.2.1 compilerKind: ghc compilerVersion: 8.2.1 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.0.2 compilerKind: ghc compilerVersion: 8.0.2 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.0.1 compilerKind: ghc compilerVersion: 8.0.1 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false fail-fast: false steps: - - name: Set GHCJS environment variables + - name: apt-get install run: | - if [ $HCKIND = ghcjs ]; then - echo "GHCJS=true" >> "$GITHUB_ENV" - echo "GHCJSARITH=1" >> "$GITHUB_ENV" - else - echo "GHCJS=false" >> "$GITHUB_ENV" - echo "GHCJSARITH=0" >> "$GITHUB_ENV" - fi + apt-get update + 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 + run: | + "$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + - name: Install GHC (hvr-ppa) + if: matrix.setup-method == 'hvr-ppa' + run: | + apt-add-repository -y 'ppa:hvr/ghc' + apt-get update + apt-get install -y "$HCNAME" + HC=$HCDIR/bin/$HCKIND + echo "HC=$HC" >> "$GITHUB_ENV" + echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV" + echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} HCVER: ${{ matrix.compilerVersion }} - - name: apt + - name: Install GHC (GHCup) + if: matrix.setup-method == 'ghcup' run: | - apt-get update - apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev - if [ "${{ matrix.setup-method }}" = ghcup ]; then - 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" - "$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 ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) - "$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) - else - apt-add-repository -y 'ppa:hvr/ghc' - if [ $((GHCJSARITH)) -ne 0 ] ; then apt-add-repository -y 'ppa:hvr/ghcjs' ; fi - if [ $((GHCJSARITH)) -ne 0 ] ; then curl -sSL "https://deb.nodesource.com/gpgkey/nodesource.gpg.key" | apt-key add - ; fi - if [ $((GHCJSARITH)) -ne 0 ] ; then apt-add-repository -y 'deb https://deb.nodesource.com/node_10.x jammy main' ; fi - apt-get update - if [ $((GHCJSARITH)) -ne 0 ] ; then apt-get install -y "$HCNAME" ghc-8.4.4 nodejs ; else apt-get install -y "$HCNAME" ; fi - 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" - "$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.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) - fi + "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (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 }} + HCVER: ${{ matrix.compilerVersion }} + - name: Install GHC (GHCup vanilla) + if: matrix.setup-method == 'ghcup-vanilla' + run: | + "$HOME/.ghcup/bin/ghcup" -s https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-vanilla-0.0.8.yaml install ghc "$HCVER" || (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 }} + HCVER: ${{ matrix.compilerVersion }} + - name: Install GHC (GHCup prerelease) + if: matrix.setup-method == 'ghcup-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 ghc "$HCVER" || (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 }} @@ -339,27 +348,9 @@ jobs: - name: Set PATH and environment variables run: | echo "$HOME/.cabal/bin" >> $GITHUB_PATH - if [ $((GHCJSARITH)) -ne 0 ] ; then echo "/opt/ghc/8.4.4/bin" >> $GITHUB_PATH ; fi 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 - if [ "${{ matrix.setup-method }}" = ghcup ]; then - 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" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" - else - HC=$HCDIR/bin/$HCKIND - echo "HC=$HC" >> "$GITHUB_ENV" - echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV" - echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" - fi - 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" @@ -414,8 +405,6 @@ jobs: $HC --version || true $HC --print-project-git-commit-id || true $CABAL --version || true - if [ $((GHCJSARITH)) -ne 0 ] ; then node --version ; fi - if [ $((GHCJSARITH)) -ne 0 ] ; then echo $GHCJS ; fi - name: update cabal index run: | $CABAL v2-update -v @@ -498,8 +487,8 @@ jobs: rm -f cabal.project.local $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all - name: save cache - uses: actions/cache/save@v4 if: always() + uses: actions/cache/save@v4 with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} path: ~/.cabal/store diff --git a/fixtures/enabled-jobs.travis b/fixtures/enabled-jobs.travis index 5d5e348d..ed83506f 100644 --- a/fixtures/enabled-jobs.travis +++ b/fixtures/enabled-jobs.travis @@ -1,5 +1,5 @@ # SUCCESS -# *INFO* Generating Travis-CI config for testing for GHC versions: 8.0.1 8.0.2 8.2.1 8.2.2 8.4.1 8.4.2 8.4.3 8.4.4 8.6.1 8.6.2 8.6.3 8.6.4 8.6.5 8.8.1 8.8.2 8.8.3 8.8.4 8.10.1 8.10.2 8.10.3 8.10.4 8.10.5 8.10.6 8.10.7 9.0.1 9.0.2 9.2.1 9.2.2 9.2.3 9.2.4 9.2.5 9.2.6 9.2.7 9.2.8 9.4.1 9.4.2 9.4.3 9.4.4 9.4.5 9.4.6 9.4.7 9.4.8 9.6.1 9.6.2 9.6.3 9.6.4 9.6.5 9.6.6 9.8.1 9.8.2 9.10.1 9.12.1 ghcjs-8.4 +# *INFO* Generating Travis-CI config for testing for GHC versions: 8.0.1 8.0.2 8.2.1 8.2.2 8.4.1 8.4.2 8.4.3 8.4.4 8.6.1 8.6.2 8.6.3 8.6.4 8.6.5 8.8.1 8.8.2 8.8.3 8.8.4 8.10.1 8.10.2 8.10.3 8.10.4 8.10.5 8.10.6 8.10.7 9.0.1 9.0.2 9.2.1 9.2.2 9.2.3 9.2.4 9.2.5 9.2.6 9.2.7 9.2.8 9.4.1 9.4.2 9.4.3 9.4.4 9.4.5 9.4.6 9.4.7 9.4.8 9.6.1 9.6.2 9.6.3 9.6.4 9.6.5 9.6.6 9.8.1 9.8.2 9.8.3 9.10.1 9.12.1 ghcjs-8.4 # This Travis job script has been generated by a script via # # haskell-ci '--enabled-jobs=>=8' 'travis' 'enabled-jobs.project' @@ -42,6 +42,9 @@ jobs: - compiler: ghc-9.10.1 addons: {"apt":{"packages":["ghc-9.10.1","cabal-install-3.12.1.0"],"sources":[{"key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286","sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu jammy main"}]}} os: linux + - compiler: ghc-9.8.3 + addons: {"apt":{"packages":["ghc-9.8.3","cabal-install-3.12.1.0"],"sources":[{"key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286","sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu jammy main"}]}} + os: linux - compiler: ghc-9.8.2 addons: {"apt":{"packages":["ghc-9.8.2","cabal-install-3.12.1.0"],"sources":[{"key_url":"https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x063dab2bdc0b3f9fcebc378bff3aeacef6f88286","sourceline":"deb http://ppa.launchpad.net/hvr/ghc/ubuntu jammy main"}]}} os: linux diff --git a/fixtures/fail-versions.github b/fixtures/fail-versions.github index 7698a18f..680f55ae 100644 --- a/fixtures/fail-versions.github +++ b/fixtures/fail-versions.github @@ -108,83 +108,81 @@ jobs: compilerVersion: 8.6.1 setup-method: ghcup allow-failure: false - - compiler: ghc-8.4.4 - compilerKind: ghc - compilerVersion: 8.4.4 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.3 - compilerKind: ghc - compilerVersion: 8.4.3 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.2 - compilerKind: ghc - compilerVersion: 8.4.2 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.1 - compilerKind: ghc - compilerVersion: 8.4.1 - setup-method: ghcup - allow-failure: false - compiler: ghc-8.2.2 compilerKind: ghc compilerVersion: 8.2.2 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.2.1 compilerKind: ghc compilerVersion: 8.2.1 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.0.2 compilerKind: ghc compilerVersion: 8.0.2 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.0.1 compilerKind: ghc compilerVersion: 8.0.1 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: 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 libnuma-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" - "$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 ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) + - name: Install cabal-install + run: | "$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + - name: Install GHC (hvr-ppa) + if: matrix.setup-method == 'hvr-ppa' + run: | + apt-add-repository -y 'ppa:hvr/ghc' + apt-get update + apt-get install -y "$HCNAME" + HC=$HCDIR/bin/$HCKIND + echo "HC=$HC" >> "$GITHUB_ENV" + echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV" + echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} HCVER: ${{ matrix.compilerVersion }} - - name: Set PATH and environment variables + - name: Install GHC (GHCup) + if: matrix.setup-method == 'ghcup' run: | - echo "$HOME/.cabal/bin" >> $GITHUB_PATH - 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 + "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (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" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + env: + HCKIND: ${{ matrix.compilerKind }} + HCNAME: ${{ matrix.compiler }} + HCVER: ${{ matrix.compilerVersion }} + - name: Set PATH and environment variables + run: | + echo "$HOME/.cabal/bin" >> $GITHUB_PATH + echo "LANG=C.UTF-8" >> "$GITHUB_ENV" + echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV" + echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$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" >> "$GITHUB_ENV" - echo "GHCJSARITH=0" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -340,8 +338,8 @@ jobs: rm -f cabal.project.local $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all - name: save cache - uses: actions/cache/save@v4 if: always() + uses: actions/cache/save@v4 with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} path: ~/.cabal/store diff --git a/fixtures/irc-channels.github b/fixtures/irc-channels.github index 7dae3448..fba57f37 100644 --- a/fixtures/irc-channels.github +++ b/fixtures/irc-channels.github @@ -29,16 +29,16 @@ jobs: fail-fast: false steps: - name: IRC success notification (irc.libera.chat#mychannel) - uses: Gottox/irc-message-action@v2 if: needs.linux.result == 'success' + uses: Gottox/irc-message-action@v2 with: channel: "#mychannel" message: "\x0313servant\x03/\x0306${{ github.ref }}\x03 \x0314${{ github.sha }}\x03 https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} The build succeeded." nickname: github-actions server: irc.libera.chat - name: IRC failure notification (irc.libera.chat#mychannel) - uses: Gottox/irc-message-action@v2 if: needs.linux.result != 'success' + uses: Gottox/irc-message-action@v2 with: channel: "#mychannel" message: "\x0313servant\x03/\x0306${{ github.ref }}\x03 \x0314${{ github.sha }}\x03 https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} The build failed." @@ -135,83 +135,81 @@ jobs: compilerVersion: 8.6.1 setup-method: ghcup allow-failure: false - - compiler: ghc-8.4.4 - compilerKind: ghc - compilerVersion: 8.4.4 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.3 - compilerKind: ghc - compilerVersion: 8.4.3 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.2 - compilerKind: ghc - compilerVersion: 8.4.2 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.1 - compilerKind: ghc - compilerVersion: 8.4.1 - setup-method: ghcup - allow-failure: false - compiler: ghc-8.2.2 compilerKind: ghc compilerVersion: 8.2.2 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.2.1 compilerKind: ghc compilerVersion: 8.2.1 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.0.2 compilerKind: ghc compilerVersion: 8.0.2 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.0.1 compilerKind: ghc compilerVersion: 8.0.1 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: 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 libnuma-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" - "$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 ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) + - name: Install cabal-install + run: | "$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + - name: Install GHC (hvr-ppa) + if: matrix.setup-method == 'hvr-ppa' + run: | + apt-add-repository -y 'ppa:hvr/ghc' + apt-get update + apt-get install -y "$HCNAME" + HC=$HCDIR/bin/$HCKIND + echo "HC=$HC" >> "$GITHUB_ENV" + echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV" + echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} HCVER: ${{ matrix.compilerVersion }} - - name: Set PATH and environment variables + - name: Install GHC (GHCup) + if: matrix.setup-method == 'ghcup' run: | - echo "$HOME/.cabal/bin" >> $GITHUB_PATH - 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 + "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (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" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + env: + HCKIND: ${{ matrix.compilerKind }} + HCNAME: ${{ matrix.compiler }} + HCVER: ${{ matrix.compilerVersion }} + - name: Set PATH and environment variables + run: | + echo "$HOME/.cabal/bin" >> $GITHUB_PATH + echo "LANG=C.UTF-8" >> "$GITHUB_ENV" + echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV" + echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$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" >> "$GITHUB_ENV" - echo "GHCJSARITH=0" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -327,8 +325,8 @@ jobs: rm -f cabal.project.local $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all - name: save cache - uses: actions/cache/save@v4 if: always() + uses: actions/cache/save@v4 with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} path: ~/.cabal/store diff --git a/fixtures/messy.github b/fixtures/messy.github index 6aa8b2c8..0a44d5a1 100644 --- a/fixtures/messy.github +++ b/fixtures/messy.github @@ -108,85 +108,97 @@ jobs: compilerVersion: 8.6.1 setup-method: ghcup allow-failure: false - - compiler: ghc-8.4.4 - compilerKind: ghc - compilerVersion: 8.4.4 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.3 - compilerKind: ghc - compilerVersion: 8.4.3 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.2 - compilerKind: ghc - compilerVersion: 8.4.2 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.1 - compilerKind: ghc - compilerVersion: 8.4.1 - setup-method: ghcup - allow-failure: false - compiler: ghc-8.2.2 compilerKind: ghc compilerVersion: 8.2.2 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.2.1 compilerKind: ghc compilerVersion: 8.2.1 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.0.2 compilerKind: ghc compilerVersion: 8.0.2 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.0.1 compilerKind: ghc compilerVersion: 8.0.1 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: 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 libnuma-dev + apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 + apt-get install -y fftw3-dev + - 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" - "$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 ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) + - name: Install cabal-install + run: | "$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + - name: Install GHC (hvr-ppa) + if: matrix.setup-method == 'hvr-ppa' + run: | + apt-add-repository -y 'ppa:hvr/ghc' apt-get update - apt-get install -y fftw3-dev + apt-get install -y "$HCNAME" + HC=$HCDIR/bin/$HCKIND + echo "HC=$HC" >> "$GITHUB_ENV" + echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV" + echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} HCVER: ${{ matrix.compilerVersion }} - - name: Set PATH and environment variables + - name: Install GHC (GHCup) + if: matrix.setup-method == 'ghcup' run: | - echo "$HOME/.cabal/bin" >> $GITHUB_PATH - 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 + "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (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" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + env: + HCKIND: ${{ matrix.compilerKind }} + HCNAME: ${{ matrix.compiler }} + HCVER: ${{ matrix.compilerVersion }} + - name: Install GHC (GHCup prerelease) + if: matrix.setup-method == 'ghcup-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 ghc "$HCVER" || (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 }} + HCVER: ${{ matrix.compilerVersion }} + - name: Set PATH and environment variables + run: | + echo "$HOME/.cabal/bin" >> $GITHUB_PATH + echo "LANG=C.UTF-8" >> "$GITHUB_ENV" + echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV" + echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$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" if [ $((HCNUMVER > 81007)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV" - echo "GHCJSARITH=0" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -343,8 +355,8 @@ jobs: rm -f cabal.project.local $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all - name: save cache - uses: actions/cache/save@v4 if: always() + uses: actions/cache/save@v4 with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} path: ~/.cabal/store diff --git a/fixtures/psql.github b/fixtures/psql.github index 3fad05e7..3c554516 100644 --- a/fixtures/psql.github +++ b/fixtures/psql.github @@ -114,83 +114,81 @@ jobs: compilerVersion: 8.6.1 setup-method: ghcup allow-failure: false - - compiler: ghc-8.4.4 - compilerKind: ghc - compilerVersion: 8.4.4 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.3 - compilerKind: ghc - compilerVersion: 8.4.3 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.2 - compilerKind: ghc - compilerVersion: 8.4.2 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.1 - compilerKind: ghc - compilerVersion: 8.4.1 - setup-method: ghcup - allow-failure: false - compiler: ghc-8.2.2 compilerKind: ghc compilerVersion: 8.2.2 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.2.1 compilerKind: ghc compilerVersion: 8.2.1 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.0.2 compilerKind: ghc compilerVersion: 8.0.2 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.0.1 compilerKind: ghc compilerVersion: 8.0.1 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: 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 libnuma-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" - "$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 ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) + - name: Install cabal-install + run: | "$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + - name: Install GHC (hvr-ppa) + if: matrix.setup-method == 'hvr-ppa' + run: | + apt-add-repository -y 'ppa:hvr/ghc' + apt-get update + apt-get install -y "$HCNAME" + HC=$HCDIR/bin/$HCKIND + echo "HC=$HC" >> "$GITHUB_ENV" + echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV" + echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} HCVER: ${{ matrix.compilerVersion }} - - name: Set PATH and environment variables + - name: Install GHC (GHCup) + if: matrix.setup-method == 'ghcup' run: | - echo "$HOME/.cabal/bin" >> $GITHUB_PATH - 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 + "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (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" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + env: + HCKIND: ${{ matrix.compilerKind }} + HCNAME: ${{ matrix.compiler }} + HCVER: ${{ matrix.compilerVersion }} + - name: Set PATH and environment variables + run: | + echo "$HOME/.cabal/bin" >> $GITHUB_PATH + echo "LANG=C.UTF-8" >> "$GITHUB_ENV" + echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV" + echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$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" >> "$GITHUB_ENV" - echo "GHCJSARITH=0" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -306,8 +304,8 @@ jobs: rm -f cabal.project.local $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all - name: save cache - uses: actions/cache/save@v4 if: always() + uses: actions/cache/save@v4 with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} path: ~/.cabal/store diff --git a/fixtures/travis-patch.github b/fixtures/travis-patch.github index e9673bb2..c792e6f6 100644 --- a/fixtures/travis-patch.github +++ b/fixtures/travis-patch.github @@ -108,83 +108,81 @@ jobs: compilerVersion: 8.6.1 setup-method: ghcup allow-failure: false - - compiler: ghc-8.4.4 - compilerKind: ghc - compilerVersion: 8.4.4 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.3 - compilerKind: ghc - compilerVersion: 8.4.3 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.2 - compilerKind: ghc - compilerVersion: 8.4.2 - setup-method: ghcup - allow-failure: false - - compiler: ghc-8.4.1 - compilerKind: ghc - compilerVersion: 8.4.1 - setup-method: ghcup - allow-failure: false - compiler: ghc-8.2.2 compilerKind: ghc compilerVersion: 8.2.2 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.2.1 compilerKind: ghc compilerVersion: 8.2.1 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.0.2 compilerKind: ghc compilerVersion: 8.0.2 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.0.1 compilerKind: ghc compilerVersion: 8.0.1 - setup-method: ghcup + setup-method: hvr-ppa allow-failure: 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 libnuma-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" - "$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 ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) + - name: Install cabal-install + run: | "$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + - name: Install GHC (hvr-ppa) + if: matrix.setup-method == 'hvr-ppa' + run: | + apt-add-repository -y 'ppa:hvr/ghc' + apt-get update + apt-get install -y "$HCNAME" + HC=$HCDIR/bin/$HCKIND + echo "HC=$HC" >> "$GITHUB_ENV" + echo "HCPKG=$HCDIR/bin/$HCKIND-pkg" >> "$GITHUB_ENV" + echo "HADDOCK=$HCDIR/bin/haddock" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} HCVER: ${{ matrix.compilerVersion }} - - name: Set PATH and environment variables + - name: Install GHC (GHCup) + if: matrix.setup-method == 'ghcup' run: | - echo "$HOME/.cabal/bin" >> $GITHUB_PATH - 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 + "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (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" - echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + env: + HCKIND: ${{ matrix.compilerKind }} + HCNAME: ${{ matrix.compiler }} + HCVER: ${{ matrix.compilerVersion }} + - name: Set PATH and environment variables + run: | + echo "$HOME/.cabal/bin" >> $GITHUB_PATH + echo "LANG=C.UTF-8" >> "$GITHUB_ENV" + echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV" + echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$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" >> "$GITHUB_ENV" - echo "GHCJSARITH=0" >> "$GITHUB_ENV" env: HCKIND: ${{ matrix.compilerKind }} HCNAME: ${{ matrix.compiler }} @@ -300,8 +298,8 @@ jobs: rm -f cabal.project.local $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all - name: save cache - uses: actions/cache/save@v4 if: always() + uses: actions/cache/save@v4 with: key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} path: ~/.cabal/store diff --git a/haskell-ci.cabal b/haskell-ci.cabal index fd7c480a..e9396dcc 100644 --- a/haskell-ci.cabal +++ b/haskell-ci.cabal @@ -1,6 +1,6 @@ cabal-version: 2.2 name: haskell-ci -version: 0.19.20241109 +version: 0.19.20241111 synopsis: Cabal package script generator for Travis-CI description: Script generator (@haskell-ci@) for @@ -41,6 +41,7 @@ tested-with: || ==9.4.8 || ==9.6.6 || ==9.8.2 + || ==9.8.3 || ==9.10.1 extra-source-files: CHANGELOG.md diff --git a/haskell-ci.sh b/haskell-ci.sh index 1eccd9de..99ad1259 100755 --- a/haskell-ci.sh +++ b/haskell-ci.sh @@ -19,7 +19,7 @@ fi CFG_CABAL_STORE_CACHE="" CFG_CABAL_REPO_CACHE="" -CFG_JOBS="9.10.1 9.8.2 9.6.6 9.4.8 9.2.8 9.0.2 8.10.7 8.8.4 8.6.5" +CFG_JOBS="9.10.1 9.8.3 9.8.2 9.6.6 9.4.8 9.2.8 9.0.2 8.10.7 8.8.4 8.6.5" CFG_CABAL_UPDATE=false SCRIPT_NAME=$(basename "$0") diff --git a/src/HaskellCI/Compiler.hs b/src/HaskellCI/Compiler.hs index d522f5d5..9c3e0ad4 100644 --- a/src/HaskellCI/Compiler.hs +++ b/src/HaskellCI/Compiler.hs @@ -16,7 +16,9 @@ module HaskellCI.Compiler ( -- * Compiler version range CompilerRange (..), compilerWithinRange, + compilerWithinGhcRange, invertCompilerRange, + invertVersionRange, -- * Known versions knownGhcVersions, knownGhcjsVersions, @@ -113,6 +115,9 @@ compilerWithinRange GHCHead RangeGHCJS = False compilerWithinRange (GHCJS _) RangeGHCJS = True compilerWithinRange v (RangePoints vs) = S.member v vs +compilerWithinGhcRange :: CompilerVersion -> VersionRange -> Bool +compilerWithinGhcRange v vr = compilerWithinRange v (RangeGHC /\ Range vr) + invertCompilerRange :: CompilerRange -> CompilerRange invertCompilerRange (Range vr) = Range (invertVersionRange vr) invertCompilerRange RangeGHC = RangeGHCJS @@ -140,7 +145,7 @@ knownGhcVersions = fmap mkVersion , [9,2,1], [9,2,2], [9,2,3], [9,2,4], [9,2,5], [9,2,6], [9,2,7], [9,2,8] , [9,4,1], [9,4,2], [9,4,3], [9,4,4], [9,4,5], [9,4,6], [9,4,7], [9,4,8] , [9,6,1], [9,6,2], [9,6,3], [9,6,4], [9,6,5], [9,6,6] - , [9,8,1], [9,8,2] + , [9,8,1], [9,8,2], [9,8,3] , [9,10,1] , [9,12,1] ] diff --git a/src/HaskellCI/Config.hs b/src/HaskellCI/Config.hs index 9b41e4de..1a811fd2 100644 --- a/src/HaskellCI/Config.hs +++ b/src/HaskellCI/Config.hs @@ -62,8 +62,7 @@ parseConfigFile fields0 = do postprocessConfig :: Config -> Config postprocessConfig cfg - -- on yammy the only install option is ghcup - | cfgUbuntu cfg >= Jammy = cfg { cfgGhcupJobs = anyVersion } + | cfgUbuntu cfg >= Jammy = cfg | otherwise = cfg ------------------------------------------------------------------------------- diff --git a/src/HaskellCI/Config/Grammar.hs b/src/HaskellCI/Config/Grammar.hs index c97d03b5..167ad7e0 100644 --- a/src/HaskellCI/Config/Grammar.hs +++ b/src/HaskellCI/Config/Grammar.hs @@ -138,8 +138,14 @@ configGrammar = Config ^^^ metahelp "RANGE" "Jobs to additionally build with OSX" <*> booleanFieldDef "ghcup-cabal" (field @"cfgGhcupCabal") defaultConfig ^^^ help "Use (or don't) ghcup to install cabal" + <*> rangeField "hvr-ppa-jobs" (field @"cfgHvrPpaJobs") defaultConfig + ^^^ metahelp "RANGE" "(Linux) jobs to use hvr-ppa to install ghc" <*> rangeField "ghcup-jobs" (field @"cfgGhcupJobs") defaultConfig - ^^^ metahelp "RANGE" "(Linux) jobs to use ghcup to install tools" + ^^^ metahelp "RANGE" "(Linux) jobs to use ghcup to install ghc" + <*> rangeField "ghcup-vanilla-jobs" (field @"cfgGhcupVanillaJobs") defaultConfig + ^^^ metahelp "RANGE" "(Linux) jobs to use ghcup-vanilla to install ghc" + <*> rangeField "ghcup-prerelease-jobs" (field @"cfgGhcupPrereleaseJobs") defaultConfig + ^^^ metahelp "RANGE" "(Linux) jobs to use ghcup-prerelease to install ghc" <*> optionalFieldDef "ghcup-version" (field @"cfgGhcupVersion") defaultConfig ^^^ metahelp "VERSION" "ghcup version" <*> monoidalFieldAla "apt" (alaSet' C.NoCommaFSep C.Token') (field @"cfgApt") diff --git a/src/HaskellCI/Config/History.hs b/src/HaskellCI/Config/History.hs index c71efbff..b3c41225 100644 --- a/src/HaskellCI/Config/History.hs +++ b/src/HaskellCI/Config/History.hs @@ -1,6 +1,9 @@ {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeApplications #-} -module HaskellCI.Config.History where +module HaskellCI.Config.History ( + configHistory, + defaultConfig, +) where import HaskellCI.Prelude @@ -10,6 +13,11 @@ import HaskellCI.Config.Initial import HaskellCI.Config.Type import HaskellCI.Config.Ubuntu +import HaskellCI.Compiler (invertVersionRange) + +ghcupNormalRange :: VersionRange +ghcupNormalRange = C.laterVersion (mkVersion [8,4,4]) + configHistory :: [([Int], Config -> Config)] configHistory = [ ver 0 19 20240414 := \cfg -> cfg @@ -25,6 +33,11 @@ configHistory = & field @"cfgDocspec" . field @"cfgDocspecHash" .~ "48bf3b7fd2f7f0caa6162afee57a755be8523e7f467b694900eb420f5f9a7b76" , ver 0 19 20240708 := \cfg -> cfg & field @"cfgGhcupVersion" .~ C.mkVersion [0,1,30,0] + , ver 0 19 20241111 := \cfg -> cfg + & field @"cfgHvrPpaJobs" .~ C.earlierVersion (C.mkVersion [8,4]) + & field @"cfgGhcupJobs" .~ C.simplifyVersionRange (C.intersectVersionRanges (C.intersectVersionRanges ghcupNormalRange (C.earlierVersion (C.mkVersion [9,12,0]))) (invertVersionRange (C.withinVersion (C.mkVersion [9,8,3])))) + & field @"cfgGhcupVanillaJobs" .~ C.withinVersion (C.mkVersion [9,8,3]) + & field @"cfgGhcupPrereleaseJobs" .~ C.orLaterVersion (C.mkVersion [9,12,0]) ] where ver x y z = [x, y, z] diff --git a/src/HaskellCI/Config/Initial.hs b/src/HaskellCI/Config/Initial.hs index 943fcfe8..067057ca 100644 --- a/src/HaskellCI/Config/Initial.hs +++ b/src/HaskellCI/Config/Initial.hs @@ -61,7 +61,10 @@ initialConfig = Config , cfgLinuxJobs = anyVersion , cfgMacosJobs = noVersion , cfgGhcupCabal = True + , cfgHvrPpaJobs = noVersion , cfgGhcupJobs = C.unionVersionRanges (C.intersectVersionRanges (C.laterVersion (mkVersion [8,10,4])) (C.earlierVersion (mkVersion [9]))) (C.laterVersion (mkVersion [9,0,1])) + , cfgGhcupVanillaJobs = noVersion -- TODO -- include GHC-9.8.3 + , cfgGhcupPrereleaseJobs = C.orLaterVersion (mkVersion ([9,11,0])) , cfgGhcupVersion = initialGhcupVersion , cfgApt = mempty , cfgTravisPatches = [] diff --git a/src/HaskellCI/Config/Type.hs b/src/HaskellCI/Config/Type.hs index 1875a345..4a2328bf 100644 --- a/src/HaskellCI/Config/Type.hs +++ b/src/HaskellCI/Config/Type.hs @@ -66,7 +66,10 @@ data Config = Config , cfgLinuxJobs :: !VersionRange , cfgMacosJobs :: !VersionRange , cfgGhcupCabal :: !Bool + , cfgHvrPpaJobs :: !VersionRange , cfgGhcupJobs :: !VersionRange + , cfgGhcupVanillaJobs :: !VersionRange + , cfgGhcupPrereleaseJobs :: !VersionRange , cfgGhcupVersion :: !Version , cfgApt :: S.Set String , cfgTravisPatches :: [FilePath] diff --git a/src/HaskellCI/GitHub.hs b/src/HaskellCI/GitHub.hs index cd3fe70b..304746c1 100644 --- a/src/HaskellCI/GitHub.hs +++ b/src/HaskellCI/GitHub.hs @@ -115,19 +115,7 @@ makeGitHub _argv config@Config {..} gitconfig prj jobs@JobVersions {..} = do ] steps <- sequence $ buildList $ do - -- This have to be first, since the packages we install depend on - -- whether we need GHCJS or not. - when anyGHCJS $ githubRun' "Set GHCJS environment variables" envEnv $ sh $ intercalate "\n" - [ "if [ $HCKIND = ghcjs ]; then" - , tell_env' "GHCJS" "true" - , tell_env' "GHCJSARITH" "1" - , "else" - , tell_env' "GHCJS" "false" - , tell_env' "GHCJSARITH" "0" - , "fi" - ] - - githubRun' "apt" envEnv $ do + githubRun "apt-get install" $ do sh "apt-get update" let corePkgs :: [String] corePkgs = @@ -145,89 +133,65 @@ makeGitHub _argv config@Config {..} gitconfig prj jobs@JobVersions {..} = do | GHC (C.mkVersion [8,4,4]) `elem` allVersions , GHC (C.mkVersion [8,4,4]) & isGHCUP ] - sh $ "apt-get install -y --no-install-recommends " ++ unwords corePkgs - let installGhcup :: ShM () - installGhcup = do - let ghcupVer = C.prettyShow cfgGhcupVersion - sh $ "mkdir -p \"$HOME/.ghcup/bin\"" - sh $ "curl -sL https://downloads.haskell.org/ghcup/" ++ ghcupVer ++ "/x86_64-linux-ghcup-" ++ ghcupVer ++ " > \"$HOME/.ghcup/bin/ghcup\"" - sh $ "chmod a+x \"$HOME/.ghcup/bin/ghcup\"" - - -- if any job uses prereleases, add release channel unconditionally. (HEADHACKAGE variable is set later) - when (anyJobUsesPreviewGHC || previewCabal cfgCabalInstallVersion) $ - sh "\"$HOME/.ghcup/bin/ghcup\" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml;" - - installGhcupCabal :: ShM () - installGhcupCabal = - sh $ "\"$HOME/.ghcup/bin/ghcup\" install cabal " ++ cabalFullVer ++ " || (cat \"$HOME\"/.ghcup/logs/*.* && false)" - - hvrppa <- runSh $ do - sh "apt-add-repository -y 'ppa:hvr/ghc'" - when anyGHCJS $ do - sh_if RangeGHCJS "apt-add-repository -y 'ppa:hvr/ghcjs'" - sh_if RangeGHCJS "curl -sSL \"https://deb.nodesource.com/gpgkey/nodesource.gpg.key\" | apt-key add -" - sh_if RangeGHCJS $ "apt-add-repository -y 'deb https://deb.nodesource.com/node_10.x " ++ ubuntuVer ++ " main'" - sh "apt-get update" - let basePackages = ["\"$HCNAME\"" ] ++ S.toList cfgApt - ghcjsPackages = ["ghc-8.4.4", "nodejs"] - baseInstall = "apt-get install -y " ++ unwords basePackages - ghcjsInstall = "apt-get install -y " ++ unwords (basePackages ++ ghcjsPackages) - if anyGHCJS - then if_then_else RangeGHCJS ghcjsInstall baseInstall - else sh baseInstall - - installGhcup - installGhcupCabal - - ghcup <- runSh $ do - installGhcup - - sh $ "\"$HOME/.ghcup/bin/ghcup\" install ghc \"$HCVER\" || (cat \"$HOME\"/.ghcup/logs/*.* && false)" - installGhcupCabal - unless (null cfgApt) $ do - sh "apt-get update" - sh $ "apt-get install -y " ++ unwords (S.toList cfgApt) - - setup hvrppa ghcup - - githubRun' "Set PATH and environment variables" envEnv $ do - echo_to "$GITHUB_PATH" "$HOME/.cabal/bin" + sh $ "apt-get install -y --no-install-recommends " ++ unwords corePkgs - -- Hack: happy needs ghc. Let's install version matching GHCJS. - -- At the moment, there is only GHCJS-8.4, so we install GHC-8.4.4 - when anyGHCJS $ - echo_if_to RangeGHCJS "$GITHUB_PATH" "/opt/ghc/8.4.4/bin" + -- additional packages + unless (null cfgApt) $ sh $ "apt-get install -y " ++ unwords (S.toList cfgApt) - tell_env "LANG" "C.UTF-8" + githubRun "Install GHCup" $ do + let ghcupVer = C.prettyShow cfgGhcupVersion + sh $ "mkdir -p \"$HOME/.ghcup/bin\"" + sh $ "curl -sL https://downloads.haskell.org/ghcup/" ++ ghcupVer ++ "/x86_64-linux-ghcup-" ++ ghcupVer ++ " > \"$HOME/.ghcup/bin/ghcup\"" + sh $ "chmod a+x \"$HOME/.ghcup/bin/ghcup\"" - tell_env "CABAL_DIR" "$HOME/.cabal" - tell_env "CABAL_CONFIG" "$HOME/.cabal/config" + githubRun "Install cabal-install" $ do + sh $ "\"$HOME/.ghcup/bin/ghcup\" install cabal " ++ cabalFullVer ++ " || (cat \"$HOME\"/.ghcup/logs/*.* && false)" + tell_env "CABAL" $ "$HOME/.ghcup/bin/cabal-" ++ cabalFullVer ++ " -vnormal+nowrap" - sh "HCDIR=/opt/$HCKIND/$HCVER" + -- todo: when any job uses hvr-ppa + let whenWithinGhcRange :: Applicative f => VersionRange -> f () -> f () + whenWithinGhcRange vr m = when (any (`compilerWithinGhcRange` vr) allVersions) m - let ghcupCabalPath = tell_env "CABAL" $ "$HOME/.ghcup/bin/cabal-" ++ cabalFullVer ++ " -vnormal+nowrap" + whenWithinGhcRange cfgHvrPpaJobs $ githubRunIf' "Install GHC (hvr-ppa)" "matrix.setup-method == 'hvr-ppa'" envEnv $ do + sh "apt-add-repository -y 'ppa:hvr/ghc'" + sh "apt-get update" + sh $ "apt-get install -y \"$HCNAME\"" - hvrppa <- runSh $ do - let hc = "$HCDIR/bin/$HCKIND" - sh $ "HC=" ++ hc -- HC is an absolute path. - tell_env "HC" "$HC" - tell_env "HCPKG" $ hc ++ "-pkg" - tell_env "HADDOCK" "$HCDIR/bin/haddock" - if cfgGhcupCabal - then ghcupCabalPath - else tell_env "CABAL" $ "/opt/cabal/" ++ cabalVer ++ "/bin/cabal -vnormal+nowrap" + let hc = "$HCDIR/bin/$HCKIND" + sh $ "HC=" ++ hc -- HC is an absolute path. + tell_env "HC" "$HC" + tell_env "HCPKG" $ hc ++ "-pkg" + tell_env "HADDOCK" "$HCDIR/bin/haddock" - ghcup <- runSh $ do + let ghcupGhcEnv = do sh $ "HC=$(\"$HOME/.ghcup/bin/ghcup\" whereis ghc \"$HCVER\")" sh $ "HCPKG=$(echo \"$HC\" | sed 's#ghc$#ghc-pkg#')" sh $ "HADDOCK=$(echo \"$HC\" | sed 's#ghc$#haddock#')" tell_env "HC" "$HC" tell_env "HCPKG" "$HCPKG" tell_env "HADDOCK" "$HADDOCK" - ghcupCabalPath - setup hvrppa ghcup + whenWithinGhcRange cfgGhcupJobs $ githubRunIf' "Install GHC (GHCup)" "matrix.setup-method == 'ghcup'" envEnv $ do + sh $ "\"$HOME/.ghcup/bin/ghcup\" install ghc \"$HCVER\" || (cat \"$HOME\"/.ghcup/logs/*.* && false)" + ghcupGhcEnv + + whenWithinGhcRange cfgGhcupVanillaJobs $ githubRunIf' "Install GHC (GHCup vanilla)" "matrix.setup-method == 'ghcup-vanilla'" envEnv $ do + sh $ "\"$HOME/.ghcup/bin/ghcup\" -s https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-vanilla-0.0.8.yaml install ghc \"$HCVER\" || (cat \"$HOME\"/.ghcup/logs/*.* && false)" + ghcupGhcEnv + + whenWithinGhcRange cfgGhcupPrereleaseJobs $ githubRunIf' "Install GHC (GHCup prerelease)" "matrix.setup-method == 'ghcup-prerelease'" envEnv $ do + sh "\"$HOME/.ghcup/bin/ghcup\" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml;" + sh $ "\"$HOME/.ghcup/bin/ghcup\" install ghc \"$HCVER\" || (cat \"$HOME\"/.ghcup/logs/*.* && false)" + ghcupGhcEnv + + githubRun' "Set PATH and environment variables" envEnv $ do + echo_to "$GITHUB_PATH" "$HOME/.cabal/bin" + + tell_env "LANG" "C.UTF-8" + + tell_env "CABAL_DIR" "$HOME/.cabal" + tell_env "CABAL_CONFIG" "$HOME/.cabal/config" sh "HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\\d+)\\.(\\d+)\\.(\\d+)(\\.(\\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')" tell_env "HCNUMVER" "$HCNUMVER" @@ -244,9 +208,6 @@ makeGitHub _argv config@Config {..} gitconfig prj jobs@JobVersions {..} = do tell_env "ARG_COMPILER" "--$HCKIND --with-compiler=$HC" - unless anyGHCJS $ - tell_env "GHCJSARITH" "0" - githubRun "env" $ do sh "env" @@ -298,9 +259,6 @@ makeGitHub _argv config@Config {..} gitconfig prj jobs@JobVersions {..} = do sh "$HC --version || true" sh "$HC --print-project-git-commit-id || true" sh "$CABAL --version || true" - when anyGHCJS $ do - sh_if RangeGHCJS "node --version" - sh_if RangeGHCJS "echo $GHCJS" githubRun "update cabal index" $ do sh "$CABAL v2-update -v" @@ -324,10 +282,6 @@ makeGitHub _argv config@Config {..} gitconfig prj jobs@JobVersions {..} = do sh "chmod a+x $HOME/.cabal/bin/cabal-plan" sh "cabal-plan --version" - when anyGHCJS $ githubRun "install happy" $ do - for_ cfgGhcjsTools $ \t -> - sh_if RangeGHCJS $ "$CABAL v2-install -w ghc-8.4.4 --ignore-project -j2" ++ C.prettyShow t - when docspecEnabled $ githubRun "install cabal-docspec" $ do let hash = cfgDocspecHash cfgDocspec url = cfgDocspecUrl cfgDocspec @@ -467,26 +421,6 @@ makeGitHub _argv config@Config {..} gitconfig prj jobs@JobVersions {..} = do let range = RangeGHC /\ Range (cfgTests /\ cfgRunTests) /\ hasTests sh_if range $ "$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all" ++ testShowDetails - when (anyGHCJS && cfgGhcjsTests) $ sh $ unlines $ - [ "pkgdir() {" - , " case $1 in" - ] ++ - [ " " ++ pkgName ++ ") echo " ++ pkgNameDirVariable pkgName ++ " ;;" - | Pkg{pkgName} <- pkgs - ] ++ - [ " esac" - , "}" - ] - - when cfgGhcjsTests $ sh_if (RangeGHCJS /\ hasTests) $ unwords - [ "cabal-plan list-bins '*:test:*' | while read -r line; do" - , "testpkg=$(echo \"$line\" | perl -pe 's/:.*//');" - , "testexe=$(echo \"$line\" | awk '{ print $2 }');" - , "echo \"testing $textexe in package $textpkg\";" - , "(cd \"$(pkgdir $testpkg)\" && nodejs \"$testexe\".jsexe/all.js);" - , "done" - ] - -- doctest when doctestEnabled $ githubRun "doctest" $ do let doctestOptions = unwords $ cfgDoctestOptions cfgDoctest @@ -594,19 +528,29 @@ makeGitHub _argv config@Config {..} gitconfig prj jobs@JobVersions {..} = do , ghjServices = mconcat [ Map.singleton "postgres" postgresService | cfgPostgres ] , ghjTimeout = max 10 cfgTimeoutMinutes - , ghjMatrix = - [ GitHubMatrixEntry + , ghjMatrix = concat $ + -- we can have multiple setup methods for the same + -- compiler version, if jobs overlap. + [ [ GitHubMatrixEntry { ghmeCompiler = translateCompilerVersion $ compiler , ghmeAllowFailure = isGHCHead compiler || maybeGHC False (`C.withinRange` cfgAllowFailures) compiler - , ghmeSetupMethod = if isGHCUP compiler then GHCUP else HVRPPA + , ghmeSetupMethod = sp } - | compiler <- reverse $ toList linuxVersions - , compiler /= GHCHead -- TODO: Make this work + | sp <- [GHCUP, GHCUPvanilla, GHCUPprerelease, HVRPPA] + , compilerWithinGhcRange compiler $ case sp of + GHCUP -> cfgGhcupJobs + GHCUPvanilla -> cfgGhcupVanillaJobs + GHCUPprerelease -> cfgGhcupPrereleaseJobs + HVRPPA -> cfgHvrPpaJobs + ] + | compiler <- reverse $ toList linuxVersions + , compiler /= GHCHead -- TODO: Make this work -- https://github.com/haskell-CI/haskell-ci/issues/458 - ] + ] }) + unless (null cfgIrcChannels) $ ircJob actionName mainJobName projectName config gitconfig } @@ -615,37 +559,10 @@ makeGitHub _argv config@Config {..} gitconfig prj jobs@JobVersions {..} = do mainJobName = "linux" ubuntuVer = showUbuntu cfgUbuntu - cabalVer = dispCabalVersion cfgCabalInstallVersion cabalFullVer = dispCabalVersion cfgCabalInstallVersion Auxiliary {..} = auxiliary config prj jobs - anyGHCJS = any isGHCJS allVersions - anyGHCUP = any isGHCUP allVersions - allGHCUP = all isGHCUP allVersions - - -- Generate a setup block for hvr-ppa or ghcup, or both. - setup :: [Sh] -> [Sh] -> ShM () - setup hvrppa ghcup - | allGHCUP = traverse_ liftSh ghcup - | not anyGHCUP = traverse_ liftSh hvrppa - -- SC2192: ${{ ...}} will match (ShellCheck think it doesn't) - -- SC2129: individual redirects - -- SC2296: Parameter expansions can't start with {. Double check syntax. -- ${{ }} in YAML templating. - | otherwise = sh' [2193, 2129, 2296] $ unlines $ - [ "if [ \"${{ matrix.setup-method }}\" = ghcup ]; then" - ] ++ - [ " " ++ shToString s - | s <- ghcup - ] ++ - [ "else" - ] ++ - [ " " ++ shToString s - | s <- hvrppa - ] ++ - [ "fi" - ] - -- job to be setup with ghcup isGHCUP :: CompilerVersion -> Bool isGHCUP v = compilerWithinRange v (RangeGHC /\ Range cfgGhcupJobs) @@ -654,18 +571,23 @@ makeGitHub _argv config@Config {..} gitconfig prj jobs@JobVersions {..} = do githubRun' :: String -> Map.Map String String -> ShM () -> ListBuilder (Either HsCiError GitHubStep) () githubRun' name env shm = item $ do shs <- runSh shm - return $ GitHubStep name $ Left $ GitHubRun shs env + return $ GitHubStep name Nothing $ Left $ GitHubRun shs env githubRun :: String -> ShM () -> ListBuilder (Either HsCiError GitHubStep) () githubRun name = githubRun' name mempty + githubRunIf' :: String -> String -> Map.Map String String -> ShM () -> ListBuilder (Either HsCiError GitHubStep) () + githubRunIf' name if_ env shm = item $ do + shs <- runSh shm + return $ GitHubStep name (Just if_) $ Left $ GitHubRun shs env + githubUses :: String -> String -> [(String, String)] -> ListBuilder (Either HsCiError GitHubStep) () githubUses name action with = item $ return $ - GitHubStep name $ Right $ GitHubUses action Nothing (Map.fromList with) + GitHubStep name Nothing $ Right $ GitHubUses action (Map.fromList with) githubUsesIf :: String -> String -> String -> [(String, String)] -> ListBuilder (Either HsCiError GitHubStep) () githubUsesIf name action if_ with = item $ return $ - GitHubStep name $ Right $ GitHubUses action (Just if_) (Map.fromList with) + GitHubStep name (Just if_) $ Right $ GitHubUses action (Map.fromList with) -- shell primitives echo_to' :: FilePath -> String -> String @@ -782,11 +704,13 @@ ircJob actionName mainJobName projectName cfg gitconfig = item ("irc", GitHubJob | otherwise = "failed" eqCheck | success = "==" - | otherwise = "!=" in + | otherwise = "!=" - GitHubStep ("IRC " ++ result ++ " notification (" ++ serverChannelName ++ ")") $ Right $ + condition = "needs." ++ mainJobName ++ ".result " ++ eqCheck ++ " 'success'" in + + GitHubStep ("IRC " ++ result ++ " notification (" ++ serverChannelName ++ ")") (Just condition) $ Right $ GitHubUses "Gottox/irc-message-action@v2" - (Just $ "needs." ++ mainJobName ++ ".result " ++ eqCheck ++ " 'success'") $ + $ Map.fromList $ buildList $ do item ("server", serverName) item ("channel", channelName) @@ -798,6 +722,7 @@ ircJob actionName mainJobName projectName cfg gitconfig = item ("irc", GitHubJob ++ "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} " ++ "The build " ++ resultPastTense ++ ".") + catCmd :: FilePath -> String -> String catCmd path contents = concat [ "cat >> " ++ path ++ " < ylistFilt [] (map toYaml $ filter notEmptyStep ghjSteps) instance ToYaml SetupMethod where - toYaml HVRPPA = "hvr-ppa" - toYaml GHCUP = "ghcup" + toYaml HVRPPA = "hvr-ppa" + toYaml GHCUP = "ghcup" + toYaml GHCUPvanilla = "ghcup-vanilla" + toYaml GHCUPprerelease = "ghcup-prerelease" instance ToYaml GitHubMatrixEntry where toYaml GitHubMatrixEntry {..} = ykeyValuesFilt [] @@ -143,22 +145,22 @@ instance ToYaml GitHubMatrixEntry where ] instance ToYaml GitHubStep where - toYaml GitHubStep {..} = ykeyValuesFilt [] $ - [ "name" ~> fromString ghsName - ] ++ case ghsStep of - Left GitHubRun {..} -> - [ "run" ~> fromString (shlistToString ghsRun) - , "env" ~> mapToYaml ghsEnv - ] + toYaml GitHubStep {..} = ykeyValuesFilt [] $ buildList $ do + item $ "name" ~> fromString ghsName + for_ ghsIf $ \if_ -> item $ "if" ~> fromString if_ + + case ghsStep of + Left GitHubRun {..} -> do + item $ "run" ~> fromString (shlistToString ghsRun) + item $ "env" ~> mapToYaml ghsEnv - Right GitHubUses {..} -> buildList $ do + Right GitHubUses {..} -> do item $ "uses" ~> fromString ghsAction - for_ ghsIf $ \if_ -> item $ "if" ~> fromString if_ item $ "with" ~> mapToYaml ghsWith notEmptyStep :: GitHubStep -> Bool -notEmptyStep (GitHubStep _ (Left (GitHubRun [] _))) = False -notEmptyStep _ = True +notEmptyStep (GitHubStep _ _ (Left (GitHubRun [] _))) = False +notEmptyStep _ = True instance ToYaml GitHubService where toYaml GitHubService {..} = ykeyValuesFilt [] $ buildList $ do