diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 3d28417d..4fe296d2 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -26,7 +26,6 @@ jobs: 60 container: image: buildpack-deps:jammy - continue-on-error: ${{ matrix.allow-failure }} strategy: matrix: include: @@ -70,6 +69,11 @@ jobs: compilerVersion: 8.2.2 setup-method: ghcup allow-failure: false + - compiler: ghc-head + compilerKind: ghc + compilerVersion: latest-nightly + setup-method: ghcup + allow-failure: true fail-fast: false steps: - name: apt @@ -79,6 +83,8 @@ jobs: mkdir -p "$HOME/.ghcup/bin" curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup" chmod a+x "$HOME/.ghcup/bin/ghcup" + "$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml; + "$HOME/.ghcup/bin/ghcup" config add-release-channel https://ghc.gitlab.haskell.org/ghcup-metadata/ghcup-nightlies-0.0.7.yaml; "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) "$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) env: @@ -103,7 +109,7 @@ jobs: echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV" echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV" echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV" - echo "HEADHACKAGE=false" >> "$GITHUB_ENV" + if [ $((HCNUMVER > 90405)) -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: @@ -132,6 +138,18 @@ jobs: repository hackage.haskell.org url: http://hackage.haskell.org/ EOF + if $HEADHACKAGE; then + cat >> $CABAL_CONFIG <> $CABAL_CONFIG <> cabal.project + fi $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(Cabal|Cabal-syntax|cabal-install-parsers|haskell-ci|parsec)$/; }' >> cabal.project.local cat cabal.project cat cabal.project.local @@ -241,19 +262,24 @@ jobs: path: ~/.cabal/store restore-keys: ${{ runner.os }}-${{ matrix.compiler }}- - name: install dependencies + continue-on-error: ${{ matrix.allow-failure }} run: | $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all - name: build w/o tests + continue-on-error: ${{ matrix.allow-failure }} run: | $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all - name: build + continue-on-error: ${{ matrix.allow-failure }} run: | $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always - name: tests + continue-on-error: ${{ matrix.allow-failure }} run: | $CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct - name: doctest + continue-on-error: ${{ matrix.allow-failure }} run: | perl -i -e 'while () { print unless /package-id\s+(base-compat-batteries|bs-cmpt-bttrs)-\d+(\.\d+)*/; }' .ghc.environment.* if [ $((HCNUMVER < 90000)) -ne 0 ] ; then cd ${PKGDIR_haskell_ci} || false ; fi @@ -261,19 +287,23 @@ jobs: if [ $((HCNUMVER < 90000)) -ne 0 ] ; then cd ${PKGDIR_cabal_install_parsers} || false ; fi if [ $((HCNUMVER < 90000)) -ne 0 ] ; then doctest --fast -XHaskell2010 src ; fi - name: docspec + continue-on-error: ${{ matrix.allow-failure }} run: | $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all cabal-docspec $ARG_COMPILER --verbose --timeout 2 - name: cabal check + continue-on-error: ${{ matrix.allow-failure }} run: | cd ${PKGDIR_haskell_ci} || false ${CABAL} -vnormal check cd ${PKGDIR_cabal_install_parsers} || false ${CABAL} -vnormal check - name: haddock + continue-on-error: ${{ matrix.allow-failure }} run: | $CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all - name: unconstrained build + continue-on-error: ${{ matrix.allow-failure }} run: | rm -f cabal.project.local $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all @@ -281,6 +311,7 @@ jobs: run: | rm -f cabal.project.local - name: constraint set deepseq-1.4 + continue-on-error: ${{ matrix.allow-failure }} run: | if [ $((HCNUMVER < 80400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='deepseq ==1.4.*' --constraint='binary installed' all --dry-run ; fi if [ $((HCNUMVER < 80400)) -ne 0 ] ; then cabal-plan topo | sort ; fi diff --git a/cabal.haskell-ci b/cabal.haskell-ci index 7bbf52db..15f2415d 100644 --- a/cabal.haskell-ci +++ b/cabal.haskell-ci @@ -15,7 +15,8 @@ jobs: 2:2 -- linux-jobs: >=8.10 -- Add GHC head job -ghc-head: False +-- https://www.haskell.org/ghcup/guide/#nightlies +ghc-head: True -- travis Caching -- cache: True diff --git a/fixtures/empty-line.github b/fixtures/empty-line.github index dc28541d..29ca3a79 100644 --- a/fixtures/empty-line.github +++ b/fixtures/empty-line.github @@ -183,6 +183,11 @@ jobs: compilerVersion: 7.8.1 setup-method: hvr-ppa allow-failure: false + - compiler: ghc-head + compilerKind: ghc + compilerVersion: latest-nightly + setup-method: ghcup + allow-failure: true fail-fast: false steps: - name: apt @@ -194,6 +199,7 @@ jobs: curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup" chmod a+x "$HOME/.ghcup/bin/ghcup" "$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml; + "$HOME/.ghcup/bin/ghcup" config add-release-channel https://ghc.gitlab.haskell.org/ghcup-metadata/ghcup-nightlies-0.0.7.yaml; "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) "$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) else @@ -204,6 +210,7 @@ jobs: curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup" chmod a+x "$HOME/.ghcup/bin/ghcup" "$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml; + "$HOME/.ghcup/bin/ghcup" config add-release-channel https://ghc.gitlab.haskell.org/ghcup-metadata/ghcup-nightlies-0.0.7.yaml; "$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) fi env: diff --git a/fixtures/messy.github b/fixtures/messy.github index 33f08872..273d8c96 100644 --- a/fixtures/messy.github +++ b/fixtures/messy.github @@ -183,6 +183,11 @@ jobs: compilerVersion: 7.8.1 setup-method: hvr-ppa allow-failure: false + - compiler: ghc-head + compilerKind: ghc + compilerVersion: latest-nightly + setup-method: ghcup + allow-failure: true fail-fast: false steps: - name: apt @@ -194,6 +199,7 @@ jobs: curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup" chmod a+x "$HOME/.ghcup/bin/ghcup" "$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml; + "$HOME/.ghcup/bin/ghcup" config add-release-channel https://ghc.gitlab.haskell.org/ghcup-metadata/ghcup-nightlies-0.0.7.yaml; "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) "$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) apt-get update @@ -206,6 +212,7 @@ jobs: curl -sL https://downloads.haskell.org/ghcup/0.1.19.5/x86_64-linux-ghcup-0.1.19.5 > "$HOME/.ghcup/bin/ghcup" chmod a+x "$HOME/.ghcup/bin/ghcup" "$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml; + "$HOME/.ghcup/bin/ghcup" config add-release-channel https://ghc.gitlab.haskell.org/ghcup-metadata/ghcup-nightlies-0.0.7.yaml; "$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) fi env: diff --git a/src/HaskellCI/Compiler.hs b/src/HaskellCI/Compiler.hs index 6b9ac8b4..3d845006 100644 --- a/src/HaskellCI/Compiler.hs +++ b/src/HaskellCI/Compiler.hs @@ -69,7 +69,7 @@ compilerKind (GHC _) = "ghc" compilerKind (GHCJS _) = "ghcjs" compilerVersion :: CompilerVersion -> String -compilerVersion GHCHead = "head" +compilerVersion GHCHead = "latest-nightly" -- https://ghc.gitlab.haskell.org/ghcup-metadata/ghcup-nightlies-0.0.7.yaml compilerVersion (GHC v) = C.prettyShow v compilerVersion (GHCJS v) = C.prettyShow v diff --git a/src/HaskellCI/GitHub.hs b/src/HaskellCI/GitHub.hs index 4e22638f..31eb06ba 100644 --- a/src/HaskellCI/GitHub.hs +++ b/src/HaskellCI/GitHub.hs @@ -155,9 +155,10 @@ makeGitHub _argv config@Config {..} gitconfig prj jobs@JobVersions {..} = do sh $ "chmod a+x \"$HOME/.ghcup/bin/ghcup\"" -- if any job uses prereleases, add release channel unconditionally. (HEADHACKAGE variable is set later) - when (anyJobUsesHeadHackage || previewCabal cfgCabalInstallVersion) $ + when (anyJobUsesHeadHackage || previewCabal cfgCabalInstallVersion) $ do sh "\"$HOME/.ghcup/bin/ghcup\" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.7.yaml;" - + sh "\"$HOME/.ghcup/bin/ghcup\" config add-release-channel https://ghc.gitlab.haskell.org/ghcup-metadata/ghcup-nightlies-0.0.7.yaml;" + installGhcupCabal :: ShM () installGhcupCabal = sh $ "\"$HOME/.ghcup/bin/ghcup\" install cabal " ++ cabalFullVer ++ " || (cat \"$HOME\"/.ghcup/logs/*.* && false)" @@ -643,8 +644,6 @@ makeGitHub _argv config@Config {..} gitconfig prj jobs@JobVersions {..} = do , ghmeSetupMethod = if isGHCUP compiler then GHCUP else HVRPPA } | compiler <- reverse $ toList linuxVersions - , compiler /= GHCHead -- TODO: Make this work - -- https://github.com/haskell-CI/haskell-ci/issues/458 ] }) unless (null cfgIrcChannels) $