@@ -24,18 +24,15 @@ jobs:
24
24
with :
25
25
buildbuddy_api_key : ${{ secrets.BUILDBUDDY_API_KEY }}
26
26
bazelrc_path : .bazelrc.auth
27
+ - uses : ./.github/actions/set_tcp_keepalive_time
28
+ - uses : ./.github/actions/authenticate_github_api
29
+ with :
30
+ github_token : ${{ secrets.GITHUB_TOKEN }}
27
31
- name : Configure
28
32
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
33
cat >>.bazelrc.local <<EOF
33
34
common --config=ci
34
35
EOF
35
- cat >~/.netrc <<EOF
36
- machine api.github.com
37
- password ${{ secrets.GITHUB_TOKEN }}
38
- EOF
39
36
- run : |
40
37
bazelisk test buildifier:buildifier_test
41
38
64
61
bzlmod : true
65
62
runs-on : ${{ matrix.os }}
66
63
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
64
- uses : actions/checkout@v4
65
+ - uses : ./.github/actions/free_disk_space_on_linux
73
66
- name : Mount Bazel cache
74
67
uses : actions/cache@v3
75
68
with :
@@ -85,11 +78,12 @@ jobs:
85
78
with :
86
79
buildbuddy_api_key : ${{ secrets.BUILDBUDDY_API_KEY }}
87
80
bazelrc_path : .bazelrc.auth
81
+ - uses : ./.github/actions/set_tcp_keepalive_time
82
+ - uses : ./.github/actions/authenticate_github_api
83
+ with :
84
+ github_token : ${{ secrets.GITHUB_TOKEN }}
88
85
- name : Configure
89
86
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
87
case ${{ runner.os }} in
94
88
macOS) BUILD_CONFIG=ci-macos-nixpkgs;;
95
89
Linux) BUILD_CONFIG=ci-linux-nixpkgs;;
@@ -101,10 +95,6 @@ jobs:
101
95
EOF
102
96
cp .bazelrc.local rules_haskell_nix
103
97
cp .bazelrc.local rules_haskell_tests
104
- cat >~/.netrc <<EOF
105
- machine api.github.com
106
- password ${{ secrets.GITHUB_TOKEN }}
107
- EOF
108
98
- name : Check Bazel version
109
99
run : |
110
100
nix-shell --arg docTools false --argstr ghcVersion ${{ matrix.ghc }} --pure --run .ci/check-bazel-version
@@ -175,15 +165,11 @@ jobs:
175
165
GHC_VERSION : ${{ matrix.ghc }}
176
166
runs-on : ${{ matrix.os }}
177
167
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
168
- uses : actions/checkout@v4
169
+ - uses : ./.github/actions/free_disk_space_on_linux
170
+ - uses : ./.github/actions/install_apt_pkgs
171
+ with :
172
+ packages : libtinfo5
187
173
- name : Mount Bazel cache
188
174
uses : actions/cache@v3
189
175
with :
@@ -199,12 +185,13 @@ jobs:
199
185
with :
200
186
buildbuddy_api_key : ${{ secrets.BUILDBUDDY_API_KEY }}
201
187
bazelrc_path : .bazelrc.auth
188
+ - uses : ./.github/actions/set_tcp_keepalive_time
189
+ - uses : ./.github/actions/authenticate_github_api
190
+ with :
191
+ github_token : ${{ secrets.GITHUB_TOKEN }}
202
192
- name : Configure
203
193
shell : bash
204
194
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
195
case "${{ runner.os }},${{ matrix.module }}" in
209
196
macOS,*) BUILD_CONFIG=ci-macos-bindist;;
210
197
Linux,*) BUILD_CONFIG=ci-linux-bindist;;
@@ -232,33 +219,21 @@ jobs:
232
219
common --enable_bzlmod=${{ matrix.bzlmod }}
233
220
EOF
234
221
cp .bazelrc.local rules_haskell_tests
235
- cat >~/.netrc <<EOF
236
- machine api.github.com
237
- password ${{ secrets.GITHUB_TOKEN }}
238
- EOF
239
222
- name : Build & test - rules_haskell
240
223
if : matrix.module == 'rules_haskell'
241
224
shell : bash
242
225
run : |
243
- if [[ ${{ runner.os }} == Windows ]]; then
244
- # On Windows `//...` expands to `/...`.
245
- bazel test ///...
246
- else
247
- bazel test //...
248
- fi
226
+ # Quote the package specifier so that it works on Windows
227
+ bazel test "//..."
249
228
250
229
- name : Build & test - rules_haskell_tests
251
230
if : matrix.module == 'rules_haskell_tests'
252
231
shell : bash
253
232
run : |
254
233
cd rules_haskell_tests
255
234
./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
235
+ # Quote the package specifier so that it works on Windows
236
+ bazel test "//..."
262
237
# Test stack_snapshot pinning
263
238
# NOTE keep in sync with tests/RunTests.hs
264
239
bazel run @stackage-pinning-test-unpinned//:pin
0 commit comments