Skip to content

Commit b9f8d03

Browse files
committed
Update the CI
1 parent 593f8f8 commit b9f8d03

1 file changed

Lines changed: 111 additions & 98 deletions

File tree

.github/workflows/build.yml

Lines changed: 111 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# packcheck-0.5.1
1+
# packcheck-0.7.0
22
# You can use any of the options supported by packcheck as environment
33
# variables here. See https://github.com/composewell/packcheck for all
44
# options and their explanation.
@@ -22,138 +22,151 @@ on:
2222

2323
jobs:
2424
build:
25-
name: >-
26-
${{ matrix.name }}
27-
${{ matrix.command }}
28-
${{ matrix.runner }}
29-
${{ matrix.ghc_version }}
25+
name: ${{ matrix.name }}
3026
env:
3127
# ------------------------------------------------------------------------
3228
# Common options
3329
# ------------------------------------------------------------------------
3430
# GHC_OPTIONS: "-Werror"
31+
GHCUP_VERSION: 0.1.20.0
32+
DOCSPEC_URL: https://github.com/phadej/cabal-extras/releases/download/cabal-docspec-0.0.0.20210111/cabal-docspec-0.0.0.20210111.xz
33+
DOCSPEC_OPTIONS: "--timeout 60"
3534
CABAL_REINIT_CONFIG: y
3635
LC_ALL: C.UTF-8
3736

38-
# ------------------------------------------------------------------------
39-
# What to build
40-
# ------------------------------------------------------------------------
41-
DISABLE_TEST: "y"
42-
# DISABLE_BENCH: "y"
43-
# DISABLE_DOCS: "y"
44-
# DISABLE_SDIST_BUILD: "y"
45-
# DISABLE_SDIST_GIT_CHECK: "y"
46-
# DISABLE_DIST_CHECKS: "y"
37+
STACK_UPGRADE: "y"
4738

48-
# ------------------------------------------------------------------------
49-
# stack options
50-
# ------------------------------------------------------------------------
51-
# Note requiring a specific version of stack using STACKVER may fail due to
52-
# github API limit while checking and upgrading/downgrading to the specific
53-
# version.
54-
#STACKVER: "1.6.5"
55-
#STACK_UPGRADE: "y"
56-
#RESOLVER: "lts-12"
57-
58-
# ------------------------------------------------------------------------
59-
# cabal options
60-
# ------------------------------------------------------------------------
61-
CABAL_PROJECT: ${{ matrix.cabal_project }}
6239
CABAL_CHECK_RELAX: y
63-
CABAL_HACKAGE_MIRROR: "hackage.haskell.org:http://hackage.fpcomplete.com"
64-
65-
# ------------------------------------------------------------------------
66-
# Where to find the required tools
67-
# ------------------------------------------------------------------------
68-
PATH: /opt/ghc/bin:/sbin:/usr/sbin:/bin:/usr/bin
69-
#TOOLS_DIR: /opt
40+
CABAL_HACKAGE_MIRROR: hackage.haskell.org:http://hackage.fpcomplete.com
7041

71-
# ------------------------------------------------------------------------
72-
# Location of packcheck.sh (the shell script invoked to perform CI tests ).
73-
# ------------------------------------------------------------------------
74-
# You can either commit the packcheck.sh script at this path in your repo or
75-
# you can use it by specifying the PACKCHECK_REPO_URL option below in which
76-
# case it will be automatically copied from the packcheck repo to this path
77-
# during CI tests. In any case it is finally invoked from this path.
7842
PACKCHECK: "./packcheck.sh"
79-
# If you have not committed packcheck.sh in your repo at PACKCHECK
80-
# then it is automatically pulled from this URL.
8143
PACKCHECK_GITHUB_URL: "https://raw.githubusercontent.com/composewell/packcheck"
82-
PACKCHECK_GITHUB_COMMIT: "79fb4437009a7ebdada33d0493c27ee30160ec3f"
44+
PACKCHECK_GITHUB_COMMIT: "7c4e1ab7a59b5ed6e92cfd0da67460a6116be4ac"
8345

84-
# ------------------------------------------------------------------------
85-
# Final build variables
86-
# ------------------------------------------------------------------------
87-
PACKCHECK_COMMAND: ${{ matrix.command }} ${{ matrix.pack_options }}
46+
BUILD: ${{ matrix.build }}
47+
GHCVER: ${{ matrix.ghc_version }}
48+
#RESOLVER: ${{ matrix.resolver }}
49+
CABAL_BUILD_OPTIONS: ${{ matrix.cabal_build_options }}
50+
CABAL_PROJECT: ${{ matrix.cabal_project }}
51+
DISABLE_DOCS: ${{ matrix.disable_docs }}
52+
#DISABLE_SDIST_BUILD: ${{ matrix.disable_sdist_build }}
53+
#DISABLE_SDIST_BUILD: "y"
54+
HLINT_VERSION: 3.6.1
55+
HLINT_OPTIONS: ${{ matrix.hlint_options }}
56+
HLINT_TARGETS: ${{ matrix.hlint_targets }}
8857

8958
runs-on: ${{ matrix.runner }}
9059
strategy:
9160
fail-fast: false
9261
matrix:
9362
include:
94-
- name: ghc-8.10.4-sdist
95-
ghc_version: 8.10.4
63+
- name: 9.10.1-Werror
64+
ghc_version: 9.10.1
65+
build: cabal
9666
runner: ubuntu-latest
97-
command: cabal
98-
cabal_project: cabal.project.user
99-
- name: ghc-8.10.4-werror
100-
ghc_version: 8.10.4
67+
cabal-version: 3.10.2.0
68+
cabal_project: cabal.project.Werror
69+
70+
- name: 9.8.1-Werror
71+
ghc_version: 9.8.1
72+
build: cabal
10173
runner: ubuntu-latest
102-
command: cabal
74+
cabal-version: 3.10.2.0
10375
cabal_project: cabal.project.Werror
104-
#- name: ghc-8.10.4-macos-stack
105-
# ghc_version: 8.10.4
106-
# runner: macos-latest
107-
# command: stack
108-
# resolver: lts-18.0
109-
# #stack_yaml: stack.yaml
110-
# sdist_options: "--ignore-check"
111-
- name: ghc-8.8.4
76+
77+
- name: hlint
78+
build: hlint
79+
hlint_options: "lint"
80+
hlint_targets: "lib Benchmarks"
81+
runner: ubuntu-latest
82+
cabal-version: 3.2
83+
cabal_project: cabal.project.user
84+
85+
- name: 9.6.3-macos
86+
runner: macos-latest
87+
ghc_version: 9.6.3
88+
build: cabal
89+
cabal-version: 3.10.1.0
90+
cabal_project: cabal.project.user
91+
92+
- name: 9.4.4
93+
runner: ubuntu-latest
94+
ghc_version: 9.4.4
95+
build: cabal
96+
cabal-version: 3.8.1.0
97+
cabal_project: cabal.project.user
98+
99+
- name: 9.4.4
100+
runner: ubuntu-latest
101+
ghc_version: 9.4.4
102+
build: cabal
103+
cabal-version: 3.8.1.0
104+
cabal_project: cabal.project.user
105+
106+
- name: 9.2.7
107+
runner: ubuntu-latest
108+
ghc_version: 9.2.7
109+
build: cabal
110+
cabal-version: 3.6
111+
cabal_project: cabal.project.user
112+
113+
- name: 8.10.7
114+
runner: ubuntu-latest
115+
ghc_version: 8.10.7
116+
build: cabal
117+
cabal-version: 3.2
118+
cabal_project: cabal.project.user
119+
disable_docs: y
120+
121+
- name: 8.8.4
122+
runner: ubuntu-latest
112123
ghc_version: 8.8.4
124+
build: cabal
125+
cabal-version: 3.2
126+
cabal_project: cabal.project.user
127+
disable_docs: y
128+
129+
- name: 8.6.5
113130
runner: ubuntu-latest
114-
command: cabal
131+
ghc_version: 8.6.5
132+
build: cabal
133+
cabal-version: 3.2
115134
cabal_project: cabal.project.user
135+
disable_docs: y
136+
116137
steps:
117138
- uses: actions/checkout@v2
118139

119-
- uses: haskell/actions/setup@v1
120-
if: ${{ matrix.name != 'hlint' }}
121-
with:
122-
ghc-version: ${{ matrix.ghc_version }}
123-
# We need not put this in the matrix. This will be fixed in most cases.
124-
cabal-version: 3.2
125-
126-
- uses: actions/cache@v2
127-
name: Cache common directories
140+
- uses: actions/cache@v4
141+
name: Restore cache
128142
with:
129143
path: |
130-
~/.cabal
131-
~/.ghc
132144
~/.local
145+
~/.cabal
133146
~/.stack
134-
key: ${{ matrix.ghc_version }}-${{ matrix.runner }}
135-
136-
- name: Run installer
137-
if: ${{ matrix.installer != '' }}
138-
run: ${{ matrix.installer }}
147+
.stack-work
148+
key: ${{ runner.os }}-${{ matrix.name }}
139149

140-
- name: Setup stack
141-
if: ${{ matrix.command == 'stack' }}
142-
run: |
143-
# required for packcheck
144-
sudo apt-get install -y curl
145-
# required for outbound https for stack and for stack setup
146-
sudo apt-get install -y netbase xz-utils make
147-
# If a custom stack-yaml is specified, replace the default with that
148-
if test -e "$STACK_YAML"; then rm -f stack.yaml && ln -sv $STACK_YAML stack.yaml; else true; fi
149-
unset STACK_YAML
150150
- name: Download packcheck
151151
run: |
152-
# Get packcheck if needed
153-
CURL=$(which curl)
154-
PACKCHECK_URL=${PACKCHECK_GITHUB_URL}/${PACKCHECK_GITHUB_COMMIT}/packcheck.sh
155-
if test ! -e "$PACKCHECK"; then $CURL -sL -o "$PACKCHECK" $PACKCHECK_URL; fi;
156-
chmod +x $PACKCHECK
152+
# If a custom stack-yaml is specified, replace the default with that
153+
#if test -e "$STACK_YAML"; then rm -f stack.yaml && ln -sv $STACK_YAML stack.yaml; else true; fi
154+
#unset STACK_YAML
155+
156+
if test ! -e "$PACKCHECK"
157+
then
158+
if test -z "$PACKCHECK_GITHUB_COMMIT"
159+
then
160+
die "PACKCHECK_GITHUB_COMMIT is not specified."
161+
fi
162+
PACKCHECK_URL=${PACKCHECK_GITHUB_URL}/${PACKCHECK_GITHUB_COMMIT}/packcheck.sh
163+
curl --fail -sL -o "$PACKCHECK" $PACKCHECK_URL || exit 1
164+
chmod +x $PACKCHECK
165+
elif test ! -x "$PACKCHECK"
166+
then
167+
chmod +x $PACKCHECK
168+
fi
169+
157170
- name: Run packcheck
158171
run: |
159-
bash -c "$PACKCHECK $PACKCHECK_COMMAND"
172+
bash -c "$PACKCHECK $BUILD"

0 commit comments

Comments
 (0)