diff --git a/.github/haskell-ci.patch b/.github/haskell-ci.patch new file mode 100644 index 0000000000..3d77e059f4 --- /dev/null +++ b/.github/haskell-ci.patch @@ -0,0 +1,19 @@ +--- workflows/haskell-ci.yml 2022-01-31 17:55:16.000000000 +0100 ++++ workflows/haskell-ci.yml-patched 2022-01-31 17:59:20.000000000 +0100 +@@ -14,8 +14,14 @@ + # + name: Haskell-CI + on: +- - push +- - pull_request ++ push: ++ branches: ++ - master ++ - experimental ++ pull_request: ++ branches: ++ - master ++ - experimental + jobs: + linux: + name: Haskell-CI - Linux - ${{ matrix.compiler }} diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index 3eef98ae73..f83b527faa 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -8,9 +8,9 @@ # # For more information, see https://github.com/haskell-CI/haskell-ci # -# version: 0.12.1 +# version: 0.14 # -# REGENDATA ("0.12.1",["github","--no-cabal-check","agda-stdlib-utils.cabal"]) +# REGENDATA ("0.14",["github","--no-cabal-check","agda-stdlib-utils.cabal"]) # name: Haskell-CI on: @@ -26,59 +26,111 @@ jobs: linux: name: Haskell-CI - Linux - ${{ matrix.compiler }} runs-on: ubuntu-18.04 + timeout-minutes: + 60 container: - image: buildpack-deps:xenial + image: buildpack-deps:bionic continue-on-error: ${{ matrix.allow-failure }} strategy: matrix: include: - - compiler: ghc-9.0.1 + - compiler: ghc-9.2.1 + compilerKind: ghc + compilerVersion: 9.2.1 + setup-method: ghcup allow-failure: false - - compiler: ghc-8.10.4 + - compiler: ghc-9.0.2 + compilerKind: ghc + compilerVersion: 9.0.2 + setup-method: ghcup + allow-failure: false + - compiler: ghc-8.10.7 + compilerKind: ghc + compilerVersion: 8.10.7 + setup-method: ghcup allow-failure: false - compiler: ghc-8.8.4 + compilerKind: ghc + compilerVersion: 8.8.4 + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.6.5 + compilerKind: ghc + compilerVersion: 8.6.5 + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.4.4 + compilerKind: ghc + compilerVersion: 8.4.4 + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.2.2 + compilerKind: ghc + compilerVersion: 8.2.2 + setup-method: hvr-ppa allow-failure: false - compiler: ghc-8.0.2 + compilerKind: ghc + compilerVersion: 8.0.2 + setup-method: hvr-ppa allow-failure: false fail-fast: false steps: - name: apt run: | apt-get update - apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common - apt-add-repository -y 'ppa:hvr/ghc' - apt-get update - apt-get install -y $CC cabal-install-3.4 + apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 + if [ "${{ matrix.setup-method }}" = ghcup ]; then + mkdir -p "$HOME/.ghcup/bin" + curl -sL https://downloads.haskell.org/ghcup/0.1.17.3/x86_64-linux-ghcup-0.1.17.3 > "$HOME/.ghcup/bin/ghcup" + chmod a+x "$HOME/.ghcup/bin/ghcup" + "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" + "$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0 + else + apt-add-repository -y 'ppa:hvr/ghc' + apt-get update + apt-get install -y "$HCNAME" + mkdir -p "$HOME/.ghcup/bin" + curl -sL https://downloads.haskell.org/ghcup/0.1.17.3/x86_64-linux-ghcup-0.1.17.3 > "$HOME/.ghcup/bin/ghcup" + chmod a+x "$HOME/.ghcup/bin/ghcup" + "$HOME/.ghcup/bin/ghcup" install cabal 3.6.2.0 + fi env: - CC: ${{ matrix.compiler }} + 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 - HCDIR=$(echo "/opt/$CC" | sed 's/-/\//') - HCNAME=ghc - HC=$HCDIR/bin/$HCNAME - echo "HC=$HC" >> $GITHUB_ENV - echo "HCPKG=$HCDIR/bin/$HCNAME-pkg" >> $GITHUB_ENV - echo "HADDOCK=$HCDIR/bin/haddock" >> $GITHUB_ENV - echo "CABAL=/opt/cabal/3.4/bin/cabal -vnormal+nowrap" >> $GITHUB_ENV + 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/$HCKIND-$HCVER + echo "HC=$HC" >> "$GITHUB_ENV" + echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV" + echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV" + echo "CABAL=$HOME/.ghcup/bin/cabal-3.6.2.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.6.2.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 - echo "ARG_BENCH=--enable-benchmarks" >> $GITHUB_ENV - echo "HEADHACKAGE=false" >> $GITHUB_ENV - echo "ARG_COMPILER=--$HCNAME --with-compiler=$HC" >> $GITHUB_ENV - echo "GHCJSARITH=0" >> $GITHUB_ENV + 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: - CC: ${{ matrix.compiler }} + HCKIND: ${{ matrix.compilerKind }} + HCNAME: ${{ matrix.compiler }} + HCVER: ${{ matrix.compilerVersion }} - name: env run: | env @@ -101,6 +153,10 @@ jobs: repository hackage.haskell.org url: http://hackage.haskell.org/ EOF + cat >> $CABAL_CONFIG <> $GITHUB_ENV + echo "PKGDIR_agda_stdlib_utils=${PKGDIR_agda_stdlib_utils}" >> "$GITHUB_ENV" + rm -f cabal.project cabal.project.local touch cabal.project touch cabal.project.local echo "packages: ${PKGDIR_agda_stdlib_utils}" >> cabal.project diff --git a/HACKING.md b/HACKING.md index d185fec039..e3e30f69ab 100644 --- a/HACKING.md +++ b/HACKING.md @@ -235,3 +235,22 @@ Type-checking the README directory in the `standard-library.agda-lib` file. * Please do not include this change in your pull request. + + +Continuous Integration (CI) +=========================== + +Updating the Haskell-CI workflow +-------------------------------- + +The file `.github/workflows/haskell-ci.yml` is autogenerated by the +tool `haskell-ci` but has some custom modification which need to be +restored after each regeneration of this workflow. + +`haskell-ci` creates the workflow file from the contents of the +`tested-with` field in the `agda-stdlib-utils.cabal` file. After +updating this field, run the following: +``` +haskell-ci regenerate +patch --input=.github/haskell-ci.patch .github/workflows/haskell-ci.yml +``` diff --git a/agda-stdlib-utils.cabal b/agda-stdlib-utils.cabal index ceaabafdb0..502bb3eb97 100644 --- a/agda-stdlib-utils.cabal +++ b/agda-stdlib-utils.cabal @@ -9,8 +9,9 @@ tested-with: GHC == 8.0.2 GHC == 8.4.4 GHC == 8.6.5 GHC == 8.8.4 - GHC == 8.10.5 - GHC == 9.0.1 + GHC == 8.10.7 + GHC == 9.0.2 + GHC == 9.2.1 executable GenerateEverything hs-source-dirs: . @@ -21,7 +22,7 @@ executable GenerateEverything , directory >= 1.0.0.0 && < 1.4 , filemanip >= 0.3.6.2 && < 0.4 , filepath >= 1.4.1.0 && < 1.5 - , mtl >= 2.2.2 && < 2.3 + , mtl >= 2.2.2 && < 2.4 executable AllNonAsciiChars hs-source-dirs: . @@ -29,4 +30,4 @@ executable AllNonAsciiChars default-language: Haskell2010 build-depends: base >= 4.9.0.0 && < 4.17 , filemanip >= 0.3.6.2 && < 0.4 - , text >= 1.2.3.0 && < 1.3 + , text >= 1.2.3.0 && < 2.1 diff --git a/stack-8.10.7.yaml b/stack-8.10.7.yaml new file mode 100644 index 0000000000..a2489a943f --- /dev/null +++ b/stack-8.10.7.yaml @@ -0,0 +1,10 @@ +resolver: lts-18.23 +compiler: ghc-8.10.7 +compiler-check: match-exact + +# extra-deps: +# - filemanip-0.3.6.3 +# - unix-compat-0.5.2 + +packages: +- '.' diff --git a/stack-8.8.4.yaml b/stack-8.8.4.yaml new file mode 100644 index 0000000000..9e3d6a0b63 --- /dev/null +++ b/stack-8.8.4.yaml @@ -0,0 +1,6 @@ +resolver: lts-16.31 +compiler: ghc-8.8.4 +compiler-check: match-exact + +packages: +- '.' diff --git a/stack-9.0.2.yaml b/stack-9.0.2.yaml new file mode 100644 index 0000000000..76871b383c --- /dev/null +++ b/stack-9.0.2.yaml @@ -0,0 +1,10 @@ +resolver: nightly-2022-01-27 +compiler: ghc-9.0.2 +compiler-check: match-exact + +# extra-deps: +# - filemanip-0.3.6.3 +# - unix-compat-0.5.2 + +packages: +- '.'