on master help sign in
Use packcheck 0.7.0
7f711f7Harendra Kumar
.circleci/config.yml+59−284
@@ -1,7 +1,7 @@
1version: 2.1
1version: 2.1
2
2
3#-----------------------------------------------------------------------------
3#-----------------------------------------------------------------------------
4−# packcheck-0.4.2
4+# packcheck-0.7.0
5# Packcheck global environment variables
5# Packcheck global environment variables
6#-----------------------------------------------------------------------------
6#-----------------------------------------------------------------------------
7
7
@@ -11,6 +11,8 @@ env: &env
11 # Common options
11 # Common options
12 # ------------------------------------------------------------------------
12 # ------------------------------------------------------------------------
13 # GHC_OPTIONS: "-Werror"
13 # GHC_OPTIONS: "-Werror"
14+ # For updating see: https://downloads.haskell.org/~ghcup/
15+ GHCUP_VERSION: 0.1.20.0
14 CABAL_REINIT_CONFIG: "y"
16 CABAL_REINIT_CONFIG: "y"
15 LC_ALL: "C.UTF-8"
17 LC_ALL: "C.UTF-8"
16
18
@@ -22,7 +24,6 @@ env: &env
22 # DISABLE_DOCS: "y"
24 # DISABLE_DOCS: "y"
23 # DISABLE_SDIST_BUILD: "y"
25 # DISABLE_SDIST_BUILD: "y"
24 # DISABLE_DIST_CHECKS: "y"
26 # DISABLE_DIST_CHECKS: "y"
25− ENABLE_INSTALL: "y"
26
27
27 # ------------------------------------------------------------------------
28 # ------------------------------------------------------------------------
28 # stack options
29 # stack options
@@ -38,15 +39,12 @@ env: &env
38 # cabal options
39 # cabal options
39 # ------------------------------------------------------------------------
40 # ------------------------------------------------------------------------
40 CABAL_CHECK_RELAX: "y"
41 CABAL_CHECK_RELAX: "y"
41− CABAL_NO_SANDBOX: "y"
42− CABAL_HACKAGE_MIRROR: "hackage.haskell.org:http://hackage.fpcomplete.com"
43 CABAL_BUILD_OPTIONS: "-j1 --flag limit-build-mem"
42 CABAL_BUILD_OPTIONS: "-j1 --flag limit-build-mem"
44
43
45 # ------------------------------------------------------------------------
44 # ------------------------------------------------------------------------
46 # Where to find the required tools
45 # Where to find the required tools
47 # ------------------------------------------------------------------------
46 # ------------------------------------------------------------------------
48− PATH: /opt/ghc/bin:/opt/ghcjs/bin:/sbin:/usr/sbin:/bin:/usr/bin
47+ PATH: /sbin:/usr/sbin:/bin:/usr/bin
49− TOOLS_DIR: /opt
50
48
51 # ------------------------------------------------------------------------
49 # ------------------------------------------------------------------------
52 # Location of packcheck.sh (the shell script invoked to perform CI tests ).
50 # Location of packcheck.sh (the shell script invoked to perform CI tests ).
@@ -59,15 +57,15 @@ env: &env
59 # If you have not committed packcheck.sh in your repo at PACKCHECK
57 # If you have not committed packcheck.sh in your repo at PACKCHECK
60 # then it is automatically pulled from this URL.
58 # then it is automatically pulled from this URL.
61 PACKCHECK_GITHUB_URL: "https://raw.githubusercontent.com/composewell/packcheck"
59 PACKCHECK_GITHUB_URL: "https://raw.githubusercontent.com/composewell/packcheck"
62− PACKCHECK_GITHUB_COMMIT: "a302772c8f3791c477edd1764b82f8d1f5b22fdf"
60+ PACKCHECK_GITHUB_COMMIT: "v0.7.0"
63
61
64executors:
62executors:
65 amd64-executor:
63 amd64-executor:
66 docker:
64 docker:
67− - image: ubuntu:xenial
65+ - image: ubuntu:latest
68 x86-executor:
66 x86-executor:
69 docker:
67 docker:
70− - image: i386/ubuntu:eoan
68+ - image: i386/ubuntu:focal
71
69
72#-----------------------------------------------------------------------------
70#-----------------------------------------------------------------------------
73# Common utility stuff, not to be modified usually
71# Common utility stuff, not to be modified usually
@@ -79,38 +77,50 @@ preinstall: &preinstall
79 # required for https/cache save and restore
77 # required for https/cache save and restore
80 apt-get install -y ca-certificates
78 apt-get install -y ca-certificates
81
79
82− # required to (re)generate the configure script
80+ # Alternative way of installing ghc and cabal, directly from
83− apt-get install -y autoconf
81+ # haskell.org instead of using ghcup. NOTE: this is for Debian
84−
82+ # only and is debian release specific.
85− # For ghc and cabal-install packages from hvr's ppa
86 # gnupg is required for apt-key to work
83 # gnupg is required for apt-key to work
87− apt-get install -y gnupg
84+ #apt-get install -y gnupg
88− apt-get install -y apt-transport-https
89− apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA3CBA3FFE22B574
85+ #apt-key adv --keyserver keyserver.ubuntu.com --recv-keys BA3CBA3FFE22B574
90− apt-get install -y software-properties-common
91− add-apt-repository -y ppa:hvr/ghc
92− # echo "deb http://downloads.haskell.org/debian stretch main" >> /etc/apt/sources.list
86+ #echo "deb http://downloads.haskell.org/debian buster main" >> /etc/apt/sources.list
93− echo "deb-src http://ppa.launchpad.net/hvr/ghc/ubuntu xenial main" >> /etc/apt/sources.list
94− apt-get update
87+ #apt-get update
95
88
96− # required for packcheck
89+ # required for outbound https for stack and for stack setup
90+ apt-get install -y netbase xz-utils make
97− apt-get install -y curl
91+ apt-get install -y zlib1g-dev
98
92
93+ # For ghcup to install ghc
94+ if test -n "$GHCUP_VERSION"
95+ then
96+ apt-get install -y gcc
97+ apt-get install -y g++
98+ fi
99+
99− # required for circleci.
100+ # libgmp required by ghc for linking
100− apt-get install -y libcurl4-gnutls-dev
101+ apt-get install -y libgmp-dev
101− apt-get install -y git
102 apt-get install -y libtinfo-dev
102 apt-get install -y libtinfo-dev
103
103
104− # required for outbound https for stack and for stack setup
104+ # Required by cabal when git URL is specified in project file
105+ apt-get install -y git
106+
107+ # Required for and by packcheck
105− apt-get install -y netbase xz-utils make
108+ apt-get install -y curl
106
109
107−project-preinstall: &project-preinstall
108− run: |
109 # Get packcheck if needed
110 # Get packcheck if needed
110− CURL=$(which curl)
111+ if test ! -e "$PACKCHECK"
112+ then
113+ if test -z "$PACKCHECK_GITHUB_COMMIT"
114+ then
115+ die "PACKCHECK_GITHUB_COMMIT is not specified."
116+ fi
111− PACKCHECK_URL=${PACKCHECK_GITHUB_URL}/${PACKCHECK_GITHUB_COMMIT}/packcheck.sh
117+ PACKCHECK_URL=${PACKCHECK_GITHUB_URL}/${PACKCHECK_GITHUB_COMMIT}/packcheck.sh
112− if test ! -e "$PACKCHECK"; then $CURL -sL -o "$PACKCHECK" $PACKCHECK_URL; fi;
118+ curl --fail -sL -o "$PACKCHECK" $PACKCHECK_URL || exit 1
119+ chmod +x $PACKCHECK
120+ elif test ! -x "$PACKCHECK"
121+ then
113− chmod +x $PACKCHECK
122+ chmod +x $PACKCHECK
123+ fi
114
124
115restore: &restore
125restore: &restore
116 # Needs to happen after installing ca-certificates
126 # Needs to happen after installing ca-certificates
@@ -126,266 +136,47 @@ save: &save
126 save_cache:
136 save_cache:
127 key: v1-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}
137 key: v1-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}
128 paths:
138 paths:
129− - ~/.cabal
130− - ~/.ghc
131 - ~/.local
139 - ~/.local
140+ - ~/.cabal
132 - ~/.stack
141 - ~/.stack
142+ - ~/.ghcup
133
143
134#-----------------------------------------------------------------------------
144#-----------------------------------------------------------------------------
135# Build matrix
145# Build matrix
136#-----------------------------------------------------------------------------
146#-----------------------------------------------------------------------------
137
147
138jobs:
148jobs:
139− cabal-ghc-8_10_4:
140− <<: *env
141− executor: amd64-executor
142− steps:
143− - *preinstall
144− - checkout
145− - *project-preinstall
146− - *restore
147− - run:
148− environment:
149− CABAL_PROJECT: "cabal.project"
150− DISABLE_TEST: "yes"
151− DISABLE_BENCH: "yes"
152− DISABLE_SDIST_BUILD: "yes"
153− command: |
154− apt-get install -y ghc-8.10.4
155− apt-get install -y cabal-install-3.4
156− bash -c "$PACKCHECK cabal"
157− - *save
158− stack-ghc-8_8:
159− <<: *env
160− executor: amd64-executor
161− steps:
162− - *preinstall
163− - checkout
164− - *project-preinstall
165− - *restore
166− - run:
167− name: GHC 8.8 + stack lts-16.12
168− environment:
169− BUILD: "stack"
170− RESOLVER: "lts-16.12"
171− SDIST_OPTIONS: "--ignore-check"
172− STACK_BUILD_OPTIONS: "--flag streamly-benchmarks:-opt"
173− command: |
174− apt-get build-dep -y ghc-8.8.4
175− apt-get install -y cabal-install-3.2
176− bash -c "$PACKCHECK $BUILD"
177− - *save
178 cabal-ghc-8_6_5:
149 cabal-ghc-8_6_5:
179 <<: *env
150 <<: *env
180 executor: amd64-executor
151 executor: amd64-executor
181 steps:
152 steps:
182− - *preinstall
183− - checkout
184− - *project-preinstall
185− - *restore
186− - run: |
187− apt-get install -y ghc-8.6.3
188− apt-get install -y cabal-install-2.4
189− bash -c "$PACKCHECK cabal-v2"
190− - *save
191− cabal-ghc-8_4_4:
192− <<: *env
193− executor: x86-executor
194− steps:
195− - *preinstall
196− - checkout
197− - *project-preinstall
198− - *restore
199− - run:
200− name: GHC 8.4.4 + x86 + debug
201− environment:
202− BUILD: "cabal-v2"
203− GHCVER: "8.4.4"
204− CABAL_BUILD_OPTIONS: "--flag debug --flag limit-build-mem"
205− command: |
206− apt-get install -y ghc-8.4.4
207− apt-get install -y cabal-install-3.2
208− bash -c "$PACKCHECK $BUILD"
209− - *save
210− cabal-ghc-8_2_2:
211− <<: *env
212− executor: amd64-executor
213− steps:
214− - *preinstall
215 - checkout
153 - checkout
216− - *project-preinstall
217 - *restore
154 - *restore
218− - run:
219− environment:
220− BUILD: "cabal-v2"
221− DISABLE_TEST: "yes"
222− DISABLE_BENCH: "yes"
223− DISABLE_DOCS: "yes"
224− DISABLE_SDIST_BUILD: "yes"
225− DISABLE_DIST_CHECKS: "yes"
226− command: |
227− apt-get install -y ghc-8.2.2
228− apt-get install -y cabal-install-3.2
229− bash -c "$PACKCHECK $BUILD"
230− - *save
231− cabal-ghc-8_0_2:
232− <<: *env
233− executor: amd64-executor
234− steps:
235 - *preinstall
155 - *preinstall
236− - checkout
237− - *project-preinstall
238− - *restore
239 - run:
156 - run:
240 environment:
157 environment:
241− BUILD: "cabal-v2"
158+ CABAL_PROJECT: "cabal.project"
242− DISABLE_TEST: "yes"
243− DISABLE_BENCH: "yes"
244− DISABLE_DOCS: "yes"
245 DISABLE_SDIST_BUILD: "yes"
159 DISABLE_SDIST_BUILD: "yes"
246− DISABLE_DIST_CHECKS: "yes"
160+ CABAL_BUILD_OPTIONS: "--flag debug --flag -opt"
247 command: |
161 command: |
248− apt-get install -y ghc-8.0.2
162+ bash -c "$PACKCHECK cabal GHCVER=8.6.5"
249− apt-get install -y cabal-install-3.2
250− bash -c "$PACKCHECK $BUILD"
251− - *save
252− cabal-ghc-7_10_3:
253− <<: *env
254− executor: amd64-executor
255− steps:
256− - *preinstall
257− - checkout
258− - *project-preinstall
259− - *restore
260− - run: |
261− apt-get install -y ghc-7.10.3
262− apt-get install -y cabal-install-2.4
263− bash -c "$PACKCHECK cabal-v2"
264 - *save
163 - *save
265− stack-ghc-8_4:
164+ hlint-trailing-spaces:
266 <<: *env
165 <<: *env
267 executor: amd64-executor
166 executor: amd64-executor
268 steps:
167 steps:
269− - *preinstall
270 - checkout
168 - checkout
271− - *project-preinstall
272 - *restore
169 - *restore
273− - run: |
274− bash -c "$PACKCHECK stack RESOLVER=lts-12"
275− - *save
276− stack-ghc-8_2:
277− <<: *env
278− executor: amd64-executor
279− steps:
280 - *preinstall
170 - *preinstall
281− - checkout
282− - *project-preinstall
283− - *restore
284− - run: |
285− bash -c "$PACKCHECK stack RESOLVER=lts-11"
286− - *save
287− cabal-ghcjs-8_4:
288− <<: *env
289− executor: amd64-executor
290− steps:
291− - *preinstall
292− - checkout
293− - *project-preinstall
294− - *restore
295 - run:
171 - run:
296− name: GHCJS 8.4+no-test+no-docs
172+ name: hlint and trailing spaces
297 environment:
173 environment:
298− BUILD: cabal-v2
299− ENABLE_GHCJS: "yes"
300− DISABLE_TEST: "yes"
301− ENABLE_INSTALL: ""
302− DISABLE_DOCS: "yes"
303 DISABLE_SDIST_BUILD: "yes"
174 DISABLE_SDIST_BUILD: "yes"
175+ HLINT_VERSION: 3.6.1
176+ HLINT_OPTIONS: lint
177+ HLINT_TARGETS: core/src src test benchmark
304 command: |
178 command: |
305− add-apt-repository -y ppa:hvr/ghcjs
306− add-apt-repository -y 'deb https://deb.nodesource.com/node_11.x xenial main'
307− curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
308− apt-get update
309− apt-get install -y cabal-install-3.2
310− apt-get install -y nodejs
311− apt-get install -y ghcjs-8.4
312− cabal user-config update -a "jobs: 1"
313− bash -c "$PACKCHECK $BUILD"
179+ bash -c "$PACKCHECK hlint" || exit 1
314− - *save
315− coveralls-ghc-8_2_2:
316− <<: *env
317− executor: amd64-executor
318− steps:
319− - *preinstall
320− - checkout
321− - *project-preinstall
322− - *restore
323− - run:
324− environment:
325− BUILD: cabal
326− COVERALLS_OPTIONS: "--repo-token=\"$REPO_TOKEN\" --coverage-mode=StrictlyFullLines --exclude-dir=test test"
327− GHC_OPTIONS: "-DCOVERAGE_BUILD"
328− command: |
329− apt-get install -y ghc-8.2.2
330− apt-get install -y cabal-install-2.4
331− bash -c "$PACKCHECK cabal-v1"
332− - *save
333− coveralls-ghc-8_8_3:
334− <<: *env
335− executor: amd64-executor
336− steps:
337− - *preinstall
338− - checkout
339− - *project-preinstall
340− - *restore
341− - run:
342− environment:
343− BUILD: cabal-v2
344− COVERALLS_OPTIONS: "--repo-token=\"$REPO_TOKEN\" --coverage-mode=StrictlyFullLines --exclude-dir=test"
345− CABAL_PROJECT: "cabal.project.coverage"
346− CABAL_BUILD_TARGETS: ""
347− command: |
348− apt-get install -y ghc-8.8.3
349− apt-get install -y cabal-install-3.0
350− bash -c "$PACKCHECK cabal-v2"
351− no_output_timeout: 25m
352− - *save
353− coveralls-ghc-8_10_2:
354− <<: *env
355− executor: amd64-executor
356− steps:
357− - *preinstall
358− - checkout
359− - *project-preinstall
360− - *restore
361− - run:
362− name: Build and test with inspection, coverage, Werror
363− command: |
364− apt-get install -y ghc-8.10.2
365− apt-get install -y cabal-install-3.2
366− # Run tests with coverage
367− cabal update
368− cabal user-config update -a "jobs: 1"
369− bin/test.sh --coverage --raw
370− # Upload results to coveralls.io
371− PATH=$HOME/.cabal/bin:$PATH
372− export PATH
373− which hpc-coveralls 2>/dev/null || cabal install --project-file cabal.project.hpc-coveralls hpc-coveralls
374− hpc-coveralls --repo-token="$REPO_TOKEN" --coverage-mode=StrictlyFullLines
375− no_output_timeout: 25m
376− - *save
377− trailing-spaces:
378− <<: *env
379− executor: amd64-executor
380− steps:
381− - *preinstall
382− - checkout
383− - *project-preinstall
384− - *restore
385− - run:
386− name: Check trailing spaces
387− command: |
388− # bash -c "$PACKCHECK $BUILD" || exit 1
389 echo "Checking trailing spaces..."
180 echo "Checking trailing spaces..."
390 count=$(find . -name "*.hs" -exec grep -H '\ $' {} \; | tee /dev/tty | wc -l)
181 count=$(find . -name "*.hs" -exec grep -H '\ $' {} \; | tee /dev/tty | wc -l)
391 exit $count
182 exit $count
@@ -395,23 +186,7 @@ workflows:
395 version: 2
186 version: 2
396 build:
187 build:
397 jobs:
188 jobs:
398− - cabal-ghc-8_10_4:
189+ #- cabal-ghc-8_6_5:
399− name: GHC 8.10.4 + sdist + no-test + no-bench
190+ # name: 8.6.5-debug-unoptimized
400− #- cabal-ghc-8.6.5
191+ - hlint-trailing-spaces:
401− #- cabal-ghc-8_4_4:
402− # name: GHC 8.4.4 + x86 + debug
403− #- cabal-ghc-8_2_2:
404− # name: GHC 8.2.2 + no-test + no-bench + no-docs
405− #- cabal-ghc-8_0_2:
406− # name: GHC 8.0.2 + no-test + no-bench + no-docs
407− #- cabal-ghc-7.10.3
408− # - cabal-ghcjs-8_4:
409− # name: GHCJS 8.4 + no-test + no-docs
410− #- stack-ghc-8.4
411− #- stack-ghc-8.2
412− #- coveralls-ghc-8.2.2
413− #- coveralls-ghc-8.8.3
414− #- coveralls-ghc-8_10_2:
415− # name: GHC 8.10.2 + inspection + coverage + Werror
416− - trailing-spaces:
192+ name: hlint and trailing spaces
417− name: Trailing Spaces
.github/workflows/haskell.yml+53−60
@@ -13,9 +13,15 @@ jobs:
13 # packcheck environment variables
13 # packcheck environment variables
14 LC_ALL: C.UTF-8
14 LC_ALL: C.UTF-8
15 BUILD: ${{ matrix.build }}
15 BUILD: ${{ matrix.build }}
16+ # For updating see: https://downloads.haskell.org/~ghcup/
17+ GHCUP_VERSION: 0.1.20.0
18+ DOCSPEC_URL: https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20210111/cabal-docspec-0.0.0.20210111.xz
19+ DOCSPEC_OPTIONS: "--timeout 60 --check-properties --property-variables xs"
20+ GHCUP_GHC_OPTIONS: ${{ matrix.ghcup_ghc_options }}
16 GHCVER: ${{ matrix.ghc_version }}
21 GHCVER: ${{ matrix.ghc_version }}
17 CABALVER: ${{ matrix.cabal_version }}
22 CABALVER: ${{ matrix.cabal_version }}
18 DISABLE_DOCS: ${{ matrix.disable_docs }}
23 DISABLE_DOCS: ${{ matrix.disable_docs }}
24+ ENABLE_DOCSPEC: ${{ matrix.enable_docspec }}
19 DISABLE_TEST: ${{ matrix.disable_test }}
25 DISABLE_TEST: ${{ matrix.disable_test }}
20 DISABLE_BENCH: ${{ matrix.disable_bench }}
26 DISABLE_BENCH: ${{ matrix.disable_bench }}
21 DISABLE_DIST_CHECKS: ${{ matrix.disable_dist_checks }}
27 DISABLE_DIST_CHECKS: ${{ matrix.disable_dist_checks }}
@@ -39,16 +45,16 @@ jobs:
39 STACK_BUILD_OPTIONS: ${{ matrix.stack_build_options }}
45 STACK_BUILD_OPTIONS: ${{ matrix.stack_build_options }}
40
46
41 # packcheck location and revision
47 # packcheck location and revision
42− PACKCHECK_LOCAL_PATH: "./packcheck.sh"
48+ PACKCHECK: "./packcheck.sh"
43 PACKCHECK_GITHUB_URL: "https://raw.githubusercontent.com/composewell/packcheck"
49 PACKCHECK_GITHUB_URL: "https://raw.githubusercontent.com/composewell/packcheck"
44− PACKCHECK_GITHUB_COMMIT: "a68b7b9c7c21eef8ed273e67030efb1d4fec027c"
50+ PACKCHECK_GITHUB_COMMIT: "v0.7.0"
45
51
46 # Pull token from "secrets" setting of the github repo
52 # Pull token from "secrets" setting of the github repo
47 COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
53 COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
48 COVERAGE: ${{ matrix.coverage }}
54 COVERAGE: ${{ matrix.coverage }}
49− DOCTEST: ${{ matrix.doctest }}
50
55
51 # hlint
56 # hlint
57+ HLINT_VERSION: 3.6.1
52 HLINT_OPTIONS: "lint"
58 HLINT_OPTIONS: "lint"
53 HLINT_TARGETS: "core/src src test benchmark"
59 HLINT_TARGETS: "core/src src test benchmark"
54
60
@@ -63,7 +69,7 @@ jobs:
63 # The order is important to optimize fail-fast.
69 # The order is important to optimize fail-fast.
64 name:
70 name:
65 - 9.8.1-Werror
71 - 9.8.1-Werror
66− - 9.2.8-docspec
72+ - 9.8.1-docspec
67 # - 8.10.7-coverage
73 # - 8.10.7-coverage
68
74
69 # Note: if cabal.project is not specified benchmarks and tests won't
75 # Note: if cabal.project is not specified benchmarks and tests won't
@@ -72,9 +78,19 @@ jobs:
72 include:
78 include:
73 - name: head
79 - name: head
74 ghc_version: head
80 ghc_version: head
81+ # The URL may change, to find a working URL go to https://gitlab.haskell.org/ghc/ghc/-/jobs/
82+ # Find a debian10/11/12 job, click on a passed/failed status, at the
83+ # end of the output you will find the tar.xz name, put that tar
84+ # name after "raw/", and put the job name after "job=".
85+ # Also see https://github.com/mpickering/ghc-artefact-nix/blob/master/gitlab-artifact.nix
86+ #
87+ # May also use ghcup for installing ghc head version, use the
88+ # version "LatestNightly", and the following config:
89+ # ghcup config add-release-channel https://ghc.gitlab.haskell.org/ghcup-metadata/ghcup-nightlies-0.0.7.yaml
90+ ghcup_ghc_options: "-u https://gitlab.haskell.org/ghc/ghc/-/jobs/artifacts/master/raw/ghc-x86_64-linux-deb10-int_native-validate.tar.xz?job=x86_64-linux-deb10-int_native-validate"
75 runner: ubuntu-latest
91 runner: ubuntu-latest
76 build: cabal
92 build: cabal
77− cabal_version: 3.10.1.0
93+ cabal_version: 3.10.2.0
78 cabal_project: cabal.project.ghc-head
94 cabal_project: cabal.project.ghc-head
79 disable_sdist_build: "y"
95 disable_sdist_build: "y"
80 ignore_error: true
96 ignore_error: true
@@ -87,6 +103,18 @@ jobs:
87 disable_sdist_build: "y"
103 disable_sdist_build: "y"
88 cabal_project: cabal.project.Werror
104 cabal_project: cabal.project.Werror
89 ignore_error: false
105 ignore_error: false
106+ - name: 9.8.1-docspec
107+ ghc_version: 9.8.1
108+ runner: ubuntu-latest
109+ build: cabal
110+ cabal_version: 3.10.1.0
111+ cabal_project: cabal.project.doctest
112+ disable_test: "y"
113+ disable_bench: "y"
114+ disable_docs: "y"
115+ enable_docspec: "y"
116+ disable_sdist_build: "y"
117+ ignore_error: false
90 - name: 9.8.1-fusion-inspection
118 - name: 9.8.1-fusion-inspection
91 ghc_version: 9.8.1
119 ghc_version: 9.8.1
92 runner: ubuntu-latest
120 runner: ubuntu-latest
@@ -120,14 +148,6 @@ jobs:
120 cabal_version: 3.6.2.0
148 cabal_version: 3.6.2.0
121 disable_sdist_build: "y"
149 disable_sdist_build: "y"
122 ignore_error: false
150 ignore_error: false
123− - name: 9.2.8-docspec
124− ghc_version: 9.2.8
125− runner: ubuntu-latest
126− doctest: "y"
127− cabal_version: 3.6.2.0
128− cabal_project: cabal.project
129− disable_sdist_build: "y"
130− ignore_error: false
131 - name: 9.0.2-streamly-sdist
151 - name: 9.0.2-streamly-sdist
132 ghc_version: 9.0.2
152 ghc_version: 9.0.2
133 runner: ubuntu-latest
153 runner: ubuntu-latest
@@ -183,61 +203,35 @@ jobs:
183 - uses: actions/checkout@v2
203 - uses: actions/checkout@v2
184
204
185 - uses: actions/cache@v1
205 - uses: actions/cache@v1
186− name: Cache ~/.cabal
206+ name: Cache common directories
187 with:
207 with:
208+ path: |
209+ ~/.local
188− path: ~/.cabal
210+ ~/.cabal
211+ ~/.stack
212+ ~/.ghcup
189 # Bump the key version to clear the cache
213 # Bump the key version to clear the cache
190 key: ${{ runner.os }}-${{ matrix.ghc_version }}-cabal-v2
214 key: ${{ runner.os }}-${{ matrix.ghc_version }}-cabal-v2
191
215
192 - name: Download packcheck
216 - name: Download packcheck
193 run: |
217 run: |
194− # Get packcheck if needed
218+ if test ! -e "$PACKCHECK"
195− CURL=$(which curl)
196− PACKCHECK_URL=${PACKCHECK_GITHUB_URL}/${PACKCHECK_GITHUB_COMMIT}/packcheck.sh
197− if test ! -e "$PACKCHECK_LOCAL_PATH"; then $CURL -sL -o "$PACKCHECK_LOCAL_PATH" $PACKCHECK_URL; fi;
198− chmod +x $PACKCHECK_LOCAL_PATH
199−
200− os=$(uname -s -m)
201− case "$os" in
202− "Linux x86_64") GHCUP_ARCH="x86_64-linux" ;;
203− "Darwin x86_64") GHCUP_ARCH="x86_64-apple-darwin" ;;
204− *) echo "Unknown OS/Arch: $os"; exit 1;;
205− esac
206−
207− # Check available versions here: https://downloads.haskell.org/~ghcup/
208− GHCUP_VER=0.1.18.0
209− $CURL -sL -o ./ghcup https://downloads.haskell.org/~ghcup/$GHCUP_VER/${GHCUP_ARCH}-ghcup-$GHCUP_VER
210− chmod +x ./ghcup
211− if test "$GHCVER" = "head"
212 then
219 then
213− # The URL may change, to find a working URL go to https://gitlab.haskell.org/ghc/ghc/-/jobs/
220+ if test -z "$PACKCHECK_GITHUB_COMMIT"
214− # Find a debian10 job, click on a passed/failed job, at the
221+ then
215− # end of the output you will find the tar.xz name, put that after
222+ die "PACKCHECK_GITHUB_COMMIT is not specified."
216− # "raw/", and put the job name after "job=".
223+ fi
217− # Also see https://github.com/mpickering/ghc-artefact-nix/blob/master/gitlab-artifact.nix
224+ PACKCHECK_URL=${PACKCHECK_GITHUB_URL}/${PACKCHECK_GITHUB_COMMIT}/packcheck.sh
218− ./ghcup install ghc -u https://gitlab.haskell.org/ghc/ghc/-/jobs/artifacts/master/raw/ghc-x86_64-linux-deb10-int_native-validate.tar.xz?job=x86_64-linux-deb10-int_native-validate head
225+ curl --fail -sL -o "$PACKCHECK" $PACKCHECK_URL || exit 1
219− else
226+ chmod +x $PACKCHECK
220− ./ghcup install ghc $GHCVER
227+ elif test ! -x "$PACKCHECK"
228+ then
229+ chmod +x $PACKCHECK
221 fi
230 fi
222− ./ghcup install cabal $CABALVER
223− ./ghcup set ghc $GHCVER
224− ./ghcup set cabal $CABALVER
225
231
226 - name: Run tests
232 - name: Run tests
227 run: |
233 run: |
228− if test -n "$DOCTEST"
229− then
230− mkdir -p $HOME/.cabal/bin
231− curl -sL https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20210111/cabal-docspec-0.0.0.20210111.xz > cabal-docspec.xz
232− echo '0829bd034fba901cbcfe491d98ed8b28fd54f9cb5c91fa8e1ac62dc4413c9562 cabal-docspec.xz' | sha256sum -c -
233− xz -d < cabal-docspec.xz > $HOME/.cabal/bin/cabal-docspec
234− rm -f cabal-docspec.xz
235− chmod a+x $HOME/.cabal/bin/cabal-docspec
236− cabal update
237− cabal build --project-file cabal.project.doctest all
238− $HOME/.cabal/bin/cabal-docspec --version
239− $HOME/.cabal/bin/cabal-docspec --timeout 60 --check-properties --property-variables xs
240− elif test -n "$COVERAGE"
234+ if test -n "$COVERAGE"
241 then
235 then
242 # Run tests with coverage
236 # Run tests with coverage
243 cabal update
237 cabal update
@@ -250,16 +244,15 @@ jobs:
250 # XXX Uncomment this and fix it properly later
244 # XXX Uncomment this and fix it properly later
251 # hpc-coveralls --repo-token="$COVERALLS_TOKEN" --coverage-mode=StrictlyFullLines
245 # hpc-coveralls --repo-token="$COVERALLS_TOKEN" --coverage-mode=StrictlyFullLines
252 else
246 else
253− export TOOLS_DIR=/opt
254 # /usr/local/opt/curl/bin for macOS
247 # /usr/local/opt/curl/bin for macOS
255 export PATH=$HOME/.local/bin:$HOME/.ghcup/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/opt/curl/bin
248 export PATH=$HOME/.local/bin:$HOME/.ghcup/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/opt/curl/bin
256 if test -n "$SUBDIR"
249 if test -n "$SUBDIR"
257 then
250 then
258− mv "$PACKCHECK_LOCAL_PATH" "$SUBDIR/packcheck.sh"
251+ mv "$PACKCHECK" "$SUBDIR/packcheck.sh"
259 # This is required as dist-newstyle will be created on the top level
252 # This is required as dist-newstyle will be created on the top level
260 # directory as it is considered the working dir.
253 # directory as it is considered the working dir.
261 rm cabal.project
254 rm cabal.project
262 cd "$SUBDIR"
255 cd "$SUBDIR"
263 fi
256 fi
264− bash -c "$PACKCHECK_LOCAL_PATH $BUILD"
257+ bash -c "$PACKCHECK $BUILD"
265 fi
258 fi