Skip to content

Commit 3561a6c

Browse files
authored
Merge pull request #32 from L0neGamer/update-network
Update network
2 parents 9144242 + b07e04c commit 3561a6c

File tree

4 files changed

+281
-193
lines changed

4 files changed

+281
-193
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 238 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,238 @@
1+
# This GitHub workflow config has been generated by a script via
2+
#
3+
# haskell-ci 'github' 'ekg-statsd.cabal'
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.18.1
12+
#
13+
# REGENDATA ("0.18.1",["github","ekg-statsd.cabal"])
14+
#
15+
name: Haskell-CI
16+
on:
17+
- push
18+
- pull_request
19+
jobs:
20+
linux:
21+
name: Haskell-CI - Linux - ${{ matrix.compiler }}
22+
runs-on: ubuntu-20.04
23+
timeout-minutes:
24+
60
25+
container:
26+
image: buildpack-deps:jammy
27+
continue-on-error: ${{ matrix.allow-failure }}
28+
strategy:
29+
matrix:
30+
include:
31+
- compiler: ghc-9.8.2
32+
compilerKind: ghc
33+
compilerVersion: 9.8.2
34+
setup-method: ghcup
35+
allow-failure: false
36+
- compiler: ghc-9.6.4
37+
compilerKind: ghc
38+
compilerVersion: 9.6.4
39+
setup-method: ghcup
40+
allow-failure: false
41+
- compiler: ghc-9.4.8
42+
compilerKind: ghc
43+
compilerVersion: 9.4.8
44+
setup-method: ghcup
45+
allow-failure: false
46+
- compiler: ghc-9.2.8
47+
compilerKind: ghc
48+
compilerVersion: 9.2.8
49+
setup-method: ghcup
50+
allow-failure: false
51+
- compiler: ghc-9.0.2
52+
compilerKind: ghc
53+
compilerVersion: 9.0.2
54+
setup-method: ghcup
55+
allow-failure: false
56+
- compiler: ghc-8.10.7
57+
compilerKind: ghc
58+
compilerVersion: 8.10.7
59+
setup-method: ghcup
60+
allow-failure: false
61+
- compiler: ghc-8.8.3
62+
compilerKind: ghc
63+
compilerVersion: 8.8.3
64+
setup-method: ghcup
65+
allow-failure: false
66+
- compiler: ghc-8.6.5
67+
compilerKind: ghc
68+
compilerVersion: 8.6.5
69+
setup-method: ghcup
70+
allow-failure: false
71+
- compiler: ghc-8.4.4
72+
compilerKind: ghc
73+
compilerVersion: 8.4.4
74+
setup-method: ghcup
75+
allow-failure: false
76+
- compiler: ghc-8.2.2
77+
compilerKind: ghc
78+
compilerVersion: 8.2.2
79+
setup-method: ghcup
80+
allow-failure: false
81+
- compiler: ghc-8.0.2
82+
compilerKind: ghc
83+
compilerVersion: 8.0.2
84+
setup-method: ghcup
85+
allow-failure: false
86+
fail-fast: false
87+
steps:
88+
- name: apt
89+
run: |
90+
apt-get update
91+
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev
92+
mkdir -p "$HOME/.ghcup/bin"
93+
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
94+
chmod a+x "$HOME/.ghcup/bin/ghcup"
95+
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
96+
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
97+
env:
98+
HCKIND: ${{ matrix.compilerKind }}
99+
HCNAME: ${{ matrix.compiler }}
100+
HCVER: ${{ matrix.compilerVersion }}
101+
- name: Set PATH and environment variables
102+
run: |
103+
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
104+
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
105+
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
106+
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
107+
HCDIR=/opt/$HCKIND/$HCVER
108+
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
109+
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
110+
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
111+
echo "HC=$HC" >> "$GITHUB_ENV"
112+
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
113+
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
114+
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
115+
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
116+
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
117+
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
118+
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
119+
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
120+
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
121+
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
122+
env:
123+
HCKIND: ${{ matrix.compilerKind }}
124+
HCNAME: ${{ matrix.compiler }}
125+
HCVER: ${{ matrix.compilerVersion }}
126+
- name: env
127+
run: |
128+
env
129+
- name: write cabal config
130+
run: |
131+
mkdir -p $CABAL_DIR
132+
cat >> $CABAL_CONFIG <<EOF
133+
remote-build-reporting: anonymous
134+
write-ghc-environment-files: never
135+
remote-repo-cache: $CABAL_DIR/packages
136+
logs-dir: $CABAL_DIR/logs
137+
world-file: $CABAL_DIR/world
138+
extra-prog-path: $CABAL_DIR/bin
139+
symlink-bindir: $CABAL_DIR/bin
140+
installdir: $CABAL_DIR/bin
141+
build-summary: $CABAL_DIR/logs/build.log
142+
store-dir: $CABAL_DIR/store
143+
install-dirs user
144+
prefix: $CABAL_DIR
145+
repository hackage.haskell.org
146+
url: http://hackage.haskell.org/
147+
EOF
148+
cat >> $CABAL_CONFIG <<EOF
149+
program-default-options
150+
ghc-options: $GHCJOBS +RTS -M3G -RTS
151+
EOF
152+
cat $CABAL_CONFIG
153+
- name: versions
154+
run: |
155+
$HC --version || true
156+
$HC --print-project-git-commit-id || true
157+
$CABAL --version || true
158+
- name: update cabal index
159+
run: |
160+
$CABAL v2-update -v
161+
- name: install cabal-plan
162+
run: |
163+
mkdir -p $HOME/.cabal/bin
164+
curl -sL https://github.com/haskell-hvr/cabal-plan/releases/download/v0.7.3.0/cabal-plan-0.7.3.0-x86_64-linux.xz > cabal-plan.xz
165+
echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c -
166+
xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan
167+
rm -f cabal-plan.xz
168+
chmod a+x $HOME/.cabal/bin/cabal-plan
169+
cabal-plan --version
170+
- name: checkout
171+
uses: actions/checkout@v3
172+
with:
173+
path: source
174+
- name: initial cabal.project for sdist
175+
run: |
176+
touch cabal.project
177+
echo "packages: $GITHUB_WORKSPACE/source/." >> cabal.project
178+
cat cabal.project
179+
- name: sdist
180+
run: |
181+
mkdir -p sdist
182+
$CABAL sdist all --output-dir $GITHUB_WORKSPACE/sdist
183+
- name: unpack
184+
run: |
185+
mkdir -p unpacked
186+
find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \;
187+
- name: generate cabal.project
188+
run: |
189+
PKGDIR_ekg_statsd="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/ekg-statsd-[0-9.]*')"
190+
echo "PKGDIR_ekg_statsd=${PKGDIR_ekg_statsd}" >> "$GITHUB_ENV"
191+
rm -f cabal.project cabal.project.local
192+
touch cabal.project
193+
touch cabal.project.local
194+
echo "packages: ${PKGDIR_ekg_statsd}" >> cabal.project
195+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package ekg-statsd" >> cabal.project ; fi
196+
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
197+
cat >> cabal.project <<EOF
198+
EOF
199+
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(ekg-statsd)$/; }' >> cabal.project.local
200+
cat cabal.project
201+
cat cabal.project.local
202+
- name: dump install plan
203+
run: |
204+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all
205+
cabal-plan
206+
- name: restore cache
207+
uses: actions/cache/restore@v3
208+
with:
209+
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
210+
path: ~/.cabal/store
211+
restore-keys: ${{ runner.os }}-${{ matrix.compiler }}-
212+
- name: install dependencies
213+
run: |
214+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all
215+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all
216+
- name: build w/o tests
217+
run: |
218+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
219+
- name: build
220+
run: |
221+
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always
222+
- name: cabal check
223+
run: |
224+
cd ${PKGDIR_ekg_statsd} || false
225+
${CABAL} -vnormal check
226+
- name: haddock
227+
run: |
228+
$CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all
229+
- name: unconstrained build
230+
run: |
231+
rm -f cabal.project.local
232+
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
233+
- name: save cache
234+
uses: actions/cache/save@v3
235+
if: always()
236+
with:
237+
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
238+
path: ~/.cabal/store

.travis.yml

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

0 commit comments

Comments
 (0)