11
11
# Bump this number to invalidate the GH actions cache
12
12
cache-version : 0
13
13
14
+ concurrency :
15
+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
16
+ cancel-in-progress : ${{ github.ref != 'refs/heads/master' }}
17
+
14
18
jobs :
15
19
lint :
16
20
name : Format & Lint
17
- concurrency :
18
- group : ${{ github.workflow }}-${{ github.ref }}-lint
19
- cancel-in-progress : ${{ github.ref != 'refs/heads/master' }}
20
21
runs-on : ubuntu-latest
21
22
steps :
22
23
- uses : actions/checkout@v4
23
24
- uses : tweag/configure-bazel-remote-cache-auth@v0
24
25
with :
25
26
buildbuddy_api_key : ${{ secrets.BUILDBUDDY_API_KEY }}
26
- bazelrc_path : .bazelrc.local
27
+ bazelrc_path : .bazelrc.auth
28
+ - uses : ./.github/actions/set_tcp_keepalive_time
29
+ - uses : ./.github/actions/authenticate_github_api
30
+ with :
31
+ github_token : ${{ secrets.GITHUB_TOKEN }}
27
32
- name : Configure
28
33
run : |
29
- # Avoid failures of the form `deadline exceeded after 14999958197ns DEADLINE_EXCEEDED`.
30
- # See https://github.com/tweag/rules_haskell/issues/1498 and https://github.com/tweag/rules_haskell/pull/1692.
31
- [[ ${{ runner.os }} == Linux ]] && sudo sysctl -w net.ipv4.tcp_keepalive_time=60
32
34
cat >>.bazelrc.local <<EOF
33
35
common --config=ci
34
36
EOF
35
- cat >~/.netrc <<EOF
36
- machine api.github.com
37
- password ${{ secrets.GITHUB_TOKEN }}
38
- EOF
39
37
- run : |
40
38
bazelisk test buildifier:buildifier_test
41
39
42
40
test-nixpkgs :
43
41
name : Build & Test - Nixpkgs
44
42
needs :
45
43
- lint
46
- concurrency :
47
- group : ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.module }}-${{ matrix.bzlmod }}-${{ matrix.ghc }}-nixpkgs
48
- cancel-in-progress : ${{ github.ref != 'refs/heads/master' }}
49
44
strategy :
50
45
fail-fast : false
51
46
matrix :
67
62
bzlmod : true
68
63
runs-on : ${{ matrix.os }}
69
64
steps :
70
- - if : ${{ matrix.os == 'ubuntu-latest' }}
71
- run : |-
72
- sudo swapoff -a
73
- sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android /opt/ghc
74
- docker rmi $(docker images -q) -f
75
65
- uses : actions/checkout@v4
66
+ - uses : ./.github/actions/free_disk_space_on_linux
76
67
- name : Mount Bazel cache
77
68
uses : actions/cache@v3
78
69
with :
@@ -88,11 +79,12 @@ jobs:
88
79
with :
89
80
buildbuddy_api_key : ${{ secrets.BUILDBUDDY_API_KEY }}
90
81
bazelrc_path : .bazelrc.auth
82
+ - uses : ./.github/actions/set_tcp_keepalive_time
83
+ - uses : ./.github/actions/authenticate_github_api
84
+ with :
85
+ github_token : ${{ secrets.GITHUB_TOKEN }}
91
86
- name : Configure
92
87
run : |
93
- # Avoid failures of the form `deadline exceeded after 14999958197ns DEADLINE_EXCEEDED`.
94
- # See https://github.com/tweag/rules_haskell/issues/1498 and https://github.com/tweag/rules_haskell/pull/1692.
95
- [[ ${{ runner.os }} == Linux ]] && sudo sysctl -w net.ipv4.tcp_keepalive_time=60
96
88
case ${{ runner.os }} in
97
89
macOS) BUILD_CONFIG=ci-macos-nixpkgs;;
98
90
Linux) BUILD_CONFIG=ci-linux-nixpkgs;;
@@ -104,10 +96,6 @@ jobs:
104
96
EOF
105
97
cp .bazelrc.local rules_haskell_nix
106
98
cp .bazelrc.local rules_haskell_tests
107
- cat >~/.netrc <<EOF
108
- machine api.github.com
109
- password ${{ secrets.GITHUB_TOKEN }}
110
- EOF
111
99
- name : Check Bazel version
112
100
run : |
113
101
nix-shell --arg docTools false --argstr ghcVersion ${{ matrix.ghc }} --pure --run .ci/check-bazel-version
@@ -147,9 +135,6 @@ jobs:
147
135
name : Build & Test - bindist
148
136
needs :
149
137
- lint
150
- concurrency :
151
- group : ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.module }}-${{ matrix.bzlmod }}-${{ matrix.ghc }}-bindist
152
- cancel-in-progress : ${{ github.ref != 'refs/heads/master' }}
153
138
strategy :
154
139
fail-fast : false
155
140
matrix :
@@ -178,15 +163,11 @@ jobs:
178
163
GHC_VERSION : ${{ matrix.ghc }}
179
164
runs-on : ${{ matrix.os }}
180
165
steps :
181
- - if : ${{ matrix.os == 'ubuntu-latest' }}
182
- run : |-
183
- sudo swapoff -a
184
- sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android /opt/ghc
185
- sudo apt-get update
186
- sudo apt-get install --no-install-recommends -yy libtinfo5
187
- sudo apt clean
188
- docker rmi $(docker images -q) -f
189
166
- uses : actions/checkout@v4
167
+ - uses : ./.github/actions/free_disk_space_on_linux
168
+ - uses : ./.github/actions/install_apt_pkgs
169
+ with :
170
+ packages : libtinfo5
190
171
- name : Mount Bazel cache
191
172
uses : actions/cache@v3
192
173
with :
@@ -202,12 +183,13 @@ jobs:
202
183
with :
203
184
buildbuddy_api_key : ${{ secrets.BUILDBUDDY_API_KEY }}
204
185
bazelrc_path : .bazelrc.auth
186
+ - uses : ./.github/actions/set_tcp_keepalive_time
187
+ - uses : ./.github/actions/authenticate_github_api
188
+ with :
189
+ github_token : ${{ secrets.GITHUB_TOKEN }}
205
190
- name : Configure
206
191
shell : bash
207
192
run : |
208
- # Avoid failures of the form `deadline exceeded after 14999958197ns DEADLINE_EXCEEDED`.
209
- # See https://github.com/tweag/rules_haskell/issues/1498 and https://github.com/tweag/rules_haskell/pull/1692.
210
- [[ ${{ runner.os }} == Linux ]] && sudo sysctl -w net.ipv4.tcp_keepalive_time=60
211
193
case "${{ runner.os }},${{ matrix.module }}" in
212
194
macOS,*) BUILD_CONFIG=ci-macos-bindist;;
213
195
Linux,*) BUILD_CONFIG=ci-linux-bindist;;
@@ -235,33 +217,21 @@ jobs:
235
217
common --enable_bzlmod=${{ matrix.bzlmod }}
236
218
EOF
237
219
cp .bazelrc.local rules_haskell_tests
238
- cat >~/.netrc <<EOF
239
- machine api.github.com
240
- password ${{ secrets.GITHUB_TOKEN }}
241
- EOF
242
220
- name : Build & test - rules_haskell
243
221
if : matrix.module == 'rules_haskell'
244
222
shell : bash
245
223
run : |
246
- if [[ ${{ runner.os }} == Windows ]]; then
247
- # On Windows `//...` expands to `/...`.
248
- bazel test ///...
249
- else
250
- bazel test //...
251
- fi
224
+ # Quote the package specifier so that it works on Windows
225
+ bazel test "//..."
252
226
253
227
- name : Build & test - rules_haskell_tests
254
228
if : matrix.module == 'rules_haskell_tests'
255
229
shell : bash
256
230
run : |
257
231
cd rules_haskell_tests
258
232
./tests/run-start-script.sh --use-bindists --with-bzlmod=${{ matrix.bzlmod }}
259
- if [[ ${{ runner.os }} == Windows ]]; then
260
- # On Windows `//...` expands to `/...`.
261
- bazel test ///...
262
- else
263
- bazel test //...
264
- fi
233
+ # Quote the package specifier so that it works on Windows
234
+ bazel test "//..."
265
235
# Test stack_snapshot pinning
266
236
# NOTE keep in sync with tests/RunTests.hs
267
237
bazel run @stackage-pinning-test-unpinned//:pin
0 commit comments