Skip to content

Commit 669f1c9

Browse files
sjakobitreeowl
authored andcommitted
Update CI
* Add job with GHC 9.0.1 * Switch from Travis CI to GitHub Actions
1 parent 339866b commit 669f1c9

File tree

3 files changed

+191
-164
lines changed

3 files changed

+191
-164
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
# This GitHub workflow config has been generated by a script via
2+
#
3+
# haskell-ci 'github' '--benchmarks-jobs= >=7.10' '--installed=-containers' '--installed=-binary' 'unordered-containers.cabal' '--branches=master'
4+
#
5+
# To regenerate the script (for example after adjusting tested-with) run
6+
#
7+
# haskell-ci regenerate
8+
#
9+
# For more information, see https://github.com/haskell-CI/haskell-ci
10+
#
11+
# version: 0.13.20210525
12+
#
13+
# REGENDATA ("0.13.20210525",["github","--benchmarks-jobs= >=7.10","--installed=-containers","--installed=-binary","unordered-containers.cabal","--branches=master"])
14+
#
15+
name: Haskell-CI
16+
on:
17+
push:
18+
branches:
19+
- master
20+
pull_request:
21+
branches:
22+
- master
23+
jobs:
24+
linux:
25+
name: Haskell-CI - Linux - ${{ matrix.compiler }}
26+
runs-on: ubuntu-18.04
27+
container:
28+
image: buildpack-deps:bionic
29+
continue-on-error: ${{ matrix.allow-failure }}
30+
strategy:
31+
matrix:
32+
include:
33+
- compiler: ghc-9.0.1
34+
allow-failure: false
35+
- compiler: ghc-8.10.4
36+
allow-failure: false
37+
- compiler: ghc-8.8.4
38+
allow-failure: false
39+
- compiler: ghc-8.6.5
40+
allow-failure: false
41+
- compiler: ghc-8.4.4
42+
allow-failure: false
43+
- compiler: ghc-8.2.2
44+
allow-failure: false
45+
- compiler: ghc-8.0.2
46+
allow-failure: false
47+
- compiler: ghc-7.10.3
48+
allow-failure: false
49+
- compiler: ghc-7.8.4
50+
allow-failure: false
51+
fail-fast: false
52+
steps:
53+
- name: apt
54+
run: |
55+
apt-get update
56+
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common
57+
apt-add-repository -y 'ppa:hvr/ghc'
58+
apt-get update
59+
apt-get install -y $CC cabal-install-3.4
60+
env:
61+
CC: ${{ matrix.compiler }}
62+
- name: Set PATH and environment variables
63+
run: |
64+
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
65+
echo "LANG=C.UTF-8" >> $GITHUB_ENV
66+
echo "CABAL_DIR=$HOME/.cabal" >> $GITHUB_ENV
67+
echo "CABAL_CONFIG=$HOME/.cabal/config" >> $GITHUB_ENV
68+
HCDIR=$(echo "/opt/$CC" | sed 's/-/\//')
69+
HCNAME=ghc
70+
HC=$HCDIR/bin/$HCNAME
71+
echo "HC=$HC" >> $GITHUB_ENV
72+
echo "HCPKG=$HCDIR/bin/$HCNAME-pkg" >> $GITHUB_ENV
73+
echo "HADDOCK=$HCDIR/bin/haddock" >> $GITHUB_ENV
74+
echo "CABAL=/opt/cabal/3.4/bin/cabal -vnormal+nowrap" >> $GITHUB_ENV
75+
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
76+
echo "HCNUMVER=$HCNUMVER" >> $GITHUB_ENV
77+
echo "ARG_TESTS=--enable-tests" >> $GITHUB_ENV
78+
if [ $((HCNUMVER >= 71000)) -ne 0 ] ; then echo "ARG_BENCH=--enable-benchmarks" >> $GITHUB_ENV ; else echo "ARG_BENCH=--disable-benchmarks" >> $GITHUB_ENV ; fi
79+
echo "HEADHACKAGE=false" >> $GITHUB_ENV
80+
echo "ARG_COMPILER=--$HCNAME --with-compiler=$HC" >> $GITHUB_ENV
81+
echo "GHCJSARITH=0" >> $GITHUB_ENV
82+
env:
83+
CC: ${{ matrix.compiler }}
84+
- name: env
85+
run: |
86+
env
87+
- name: write cabal config
88+
run: |
89+
mkdir -p $CABAL_DIR
90+
cat >> $CABAL_CONFIG <<EOF
91+
remote-build-reporting: anonymous
92+
write-ghc-environment-files: never
93+
remote-repo-cache: $CABAL_DIR/packages
94+
logs-dir: $CABAL_DIR/logs
95+
world-file: $CABAL_DIR/world
96+
extra-prog-path: $CABAL_DIR/bin
97+
symlink-bindir: $CABAL_DIR/bin
98+
installdir: $CABAL_DIR/bin
99+
build-summary: $CABAL_DIR/logs/build.log
100+
store-dir: $CABAL_DIR/store
101+
install-dirs user
102+
prefix: $CABAL_DIR
103+
repository hackage.haskell.org
104+
url: http://hackage.haskell.org/
105+
EOF
106+
cat $CABAL_CONFIG
107+
- name: versions
108+
run: |
109+
$HC --version || true
110+
$HC --print-project-git-commit-id || true
111+
$CABAL --version || true
112+
- name: update cabal index
113+
run: |
114+
$CABAL v2-update -v
115+
- name: install cabal-plan
116+
run: |
117+
mkdir -p $HOME/.cabal/bin
118+
curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.6.2.0/cabal-plan-0.6.2.0-x86_64-linux.xz > cabal-plan.xz
119+
echo 'de73600b1836d3f55e32d80385acc055fd97f60eaa0ab68a755302685f5d81bc cabal-plan.xz' | sha256sum -c -
120+
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
121+
rm -f cabal-plan.xz
122+
chmod a+x $HOME/.cabal/bin/cabal-plan
123+
cabal-plan --version
124+
- name: checkout
125+
uses: actions/checkout@v2
126+
with:
127+
path: source
128+
- name: initial cabal.project for sdist
129+
run: |
130+
touch cabal.project
131+
echo "packages: $GITHUB_WORKSPACE/source/." >> cabal.project
132+
cat cabal.project
133+
- name: sdist
134+
run: |
135+
mkdir -p sdist
136+
$CABAL sdist all --output-dir $GITHUB_WORKSPACE/sdist
137+
- name: unpack
138+
run: |
139+
mkdir -p unpacked
140+
find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \;
141+
- name: generate cabal.project
142+
run: |
143+
PKGDIR_unordered_containers="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/unordered-containers-[0-9.]*')"
144+
echo "PKGDIR_unordered_containers=${PKGDIR_unordered_containers}" >> $GITHUB_ENV
145+
touch cabal.project
146+
touch cabal.project.local
147+
echo "packages: ${PKGDIR_unordered_containers}" >> cabal.project
148+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package unordered-containers" >> cabal.project ; fi
149+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
150+
cat >> cabal.project <<EOF
151+
EOF
152+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(binary|containers|unordered-containers)$/; }' >> cabal.project.local
153+
cat cabal.project
154+
cat cabal.project.local
155+
- name: dump install plan
156+
run: |
157+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
158+
cabal-plan
159+
- name: cache
160+
uses: actions/cache@v2
161+
with:
162+
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
163+
path: ~/.cabal/store
164+
restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-
165+
- name: install dependencies
166+
run: |
167+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all
168+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all
169+
- name: build w/o tests
170+
run: |
171+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
172+
- name: build
173+
run: |
174+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
175+
- name: tests
176+
run: |
177+
$CABAL v2-test $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --test-show-details=direct
178+
- name: cabal check
179+
run: |
180+
cd ${PKGDIR_unordered_containers} || false
181+
${CABAL} -vnormal check
182+
- name: haddock
183+
run: |
184+
$CABAL v2-haddock $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
185+
- name: unconstrained build
186+
run: |
187+
rm -f cabal.project.local
188+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all

.travis.yml

Lines changed: 0 additions & 162 deletions
This file was deleted.

unordered-containers.cabal

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ cabal-version: >=1.10
2222
extra-source-files: CHANGES.md
2323

2424
tested-with:
25-
GHC ==8.10.1
26-
|| ==8.8.3
25+
GHC ==9.0.1
26+
|| ==8.10.4
27+
|| ==8.8.4
2728
|| ==8.6.5
2829
|| ==8.4.4
2930
|| ==8.2.2

0 commit comments

Comments
 (0)