Skip to content

Commit

Permalink
agda-stdlib-tools: relax outdated bounds, update CI to 9.0.2 and 9.2.1 (
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasabel authored Feb 2, 2022
1 parent 08b40ff commit 43c3639
Show file tree
Hide file tree
Showing 7 changed files with 154 additions and 32 deletions.
19 changes: 19 additions & 0 deletions .github/haskell-ci.patch
Original file line number Diff line number Diff line change
@@ -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 }}
113 changes: 85 additions & 28 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.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:
Expand All @@ -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
Expand All @@ -101,6 +153,10 @@ jobs:
repository hackage.haskell.org
url: http://hackage.haskell.org/
EOF
cat >> $CABAL_CONFIG <<EOF
program-default-options
ghc-options: $GHCJOBS +RTS -M3G -RTS
EOF
cat $CABAL_CONFIG
- name: versions
run: |
Expand Down Expand Up @@ -139,7 +195,8 @@ jobs:
- name: generate cabal.project
run: |
PKGDIR_agda_stdlib_utils="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/agda-stdlib-utils-[0-9.]*')"
echo "PKGDIR_agda_stdlib_utils=${PKGDIR_agda_stdlib_utils}" >> $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
Expand Down
19 changes: 19 additions & 0 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
9 changes: 5 additions & 4 deletions agda-stdlib-utils.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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: .
Expand All @@ -21,12 +22,12 @@ 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: .
main-is: AllNonAsciiChars.hs
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
10 changes: 10 additions & 0 deletions stack-8.10.7.yaml
Original file line number Diff line number Diff line change
@@ -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:
- '.'
6 changes: 6 additions & 0 deletions stack-8.8.4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resolver: lts-16.31
compiler: ghc-8.8.4
compiler-check: match-exact

packages:
- '.'
10 changes: 10 additions & 0 deletions stack-9.0.2.yaml
Original file line number Diff line number Diff line change
@@ -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:
- '.'

0 comments on commit 43c3639

Please sign in to comment.