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
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 :
64
59
bzlmod : true
65
60
runs-on : ${{ matrix.os }}
66
61
steps :
67
- - if : ${{ matrix.os == 'ubuntu-latest' }}
68
- run : |-
69
- sudo swapoff -a
70
- sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android /opt/ghc
71
- docker rmi $(docker images -q) -f
72
62
- uses : actions/checkout@v4
63
+ - uses : ./.github/actions/free_disk_space_on_linux
73
64
- name : Mount Bazel cache
74
65
uses : actions/cache@v3
75
66
with :
@@ -85,11 +76,12 @@ jobs:
85
76
with :
86
77
buildbuddy_api_key : ${{ secrets.BUILDBUDDY_API_KEY }}
87
78
bazelrc_path : .bazelrc.auth
79
+ - uses : ./.github/actions/set_tcp_keepalive_time
80
+ - uses : ./.github/actions/authenticate_github_api
81
+ with :
82
+ github_token : ${{ secrets.GITHUB_TOKEN }}
88
83
- name : Configure
89
84
run : |
90
- # Avoid failures of the form `deadline exceeded after 14999958197ns DEADLINE_EXCEEDED`.
91
- # See https://github.com/tweag/rules_haskell/issues/1498 and https://github.com/tweag/rules_haskell/pull/1692.
92
- [[ ${{ runner.os }} == Linux ]] && sudo sysctl -w net.ipv4.tcp_keepalive_time=60
93
85
case ${{ runner.os }} in
94
86
macOS) BUILD_CONFIG=ci-macos-nixpkgs;;
95
87
Linux) BUILD_CONFIG=ci-linux-nixpkgs;;
@@ -101,10 +93,6 @@ jobs:
101
93
EOF
102
94
cp .bazelrc.local rules_haskell_nix
103
95
cp .bazelrc.local rules_haskell_tests
104
- cat >~/.netrc <<EOF
105
- machine api.github.com
106
- password ${{ secrets.GITHUB_TOKEN }}
107
- EOF
108
96
- name : Check Bazel version
109
97
run : |
110
98
nix-shell --arg docTools false --argstr ghcVersion ${{ matrix.ghc }} --pure --run .ci/check-bazel-version
@@ -144,9 +132,6 @@ jobs:
144
132
name : Build & Test - bindist
145
133
needs :
146
134
- lint
147
- concurrency :
148
- group : ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.module }}-${{ matrix.bzlmod }}-${{ matrix.ghc }}-bindist
149
- cancel-in-progress : ${{ github.ref != 'refs/heads/master' }}
150
135
strategy :
151
136
fail-fast : false
152
137
matrix :
@@ -175,15 +160,11 @@ jobs:
175
160
GHC_VERSION : ${{ matrix.ghc }}
176
161
runs-on : ${{ matrix.os }}
177
162
steps :
178
- - if : ${{ matrix.os == 'ubuntu-latest' }}
179
- run : |-
180
- sudo swapoff -a
181
- sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android /opt/ghc
182
- sudo apt-get update
183
- sudo apt-get install --no-install-recommends -yy libtinfo5
184
- sudo apt clean
185
- docker rmi $(docker images -q) -f
186
163
- uses : actions/checkout@v4
164
+ - uses : ./.github/actions/free_disk_space_on_linux
165
+ - uses : ./.github/actions/install_apt_pkgs
166
+ with :
167
+ packages : libtinfo5
187
168
- name : Mount Bazel cache
188
169
uses : actions/cache@v3
189
170
with :
@@ -199,12 +180,13 @@ jobs:
199
180
with :
200
181
buildbuddy_api_key : ${{ secrets.BUILDBUDDY_API_KEY }}
201
182
bazelrc_path : .bazelrc.auth
183
+ - uses : ./.github/actions/set_tcp_keepalive_time
184
+ - uses : ./.github/actions/authenticate_github_api
185
+ with :
186
+ github_token : ${{ secrets.GITHUB_TOKEN }}
202
187
- name : Configure
203
188
shell : bash
204
189
run : |
205
- # Avoid failures of the form `deadline exceeded after 14999958197ns DEADLINE_EXCEEDED`.
206
- # See https://github.com/tweag/rules_haskell/issues/1498 and https://github.com/tweag/rules_haskell/pull/1692.
207
- [[ ${{ runner.os }} == Linux ]] && sudo sysctl -w net.ipv4.tcp_keepalive_time=60
208
190
case "${{ runner.os }},${{ matrix.module }}" in
209
191
macOS,*) BUILD_CONFIG=ci-macos-bindist;;
210
192
Linux,*) BUILD_CONFIG=ci-linux-bindist;;
@@ -232,33 +214,21 @@ jobs:
232
214
common --enable_bzlmod=${{ matrix.bzlmod }}
233
215
EOF
234
216
cp .bazelrc.local rules_haskell_tests
235
- cat >~/.netrc <<EOF
236
- machine api.github.com
237
- password ${{ secrets.GITHUB_TOKEN }}
238
- EOF
239
217
- name : Build & test - rules_haskell
240
218
if : matrix.module == 'rules_haskell'
241
219
shell : bash
242
220
run : |
243
- if [[ ${{ runner.os }} == Windows ]]; then
244
- # On Windows `//...` expands to `/...`.
245
- bazel test ///...
246
- else
247
- bazel test //...
248
- fi
221
+ # Quote the package specifier so that it works on Windows
222
+ bazel test "//..."
249
223
250
224
- name : Build & test - rules_haskell_tests
251
225
if : matrix.module == 'rules_haskell_tests'
252
226
shell : bash
253
227
run : |
254
228
cd rules_haskell_tests
255
229
./tests/run-start-script.sh --use-bindists --with-bzlmod=${{ matrix.bzlmod }}
256
- if [[ ${{ runner.os }} == Windows ]]; then
257
- # On Windows `//...` expands to `/...`.
258
- bazel test ///...
259
- else
260
- bazel test //...
261
- fi
230
+ # Quote the package specifier so that it works on Windows
231
+ bazel test "//..."
262
232
# Test stack_snapshot pinning
263
233
# NOTE keep in sync with tests/RunTests.hs
264
234
bazel run @stackage-pinning-test-unpinned//:pin
0 commit comments