@@ -18,188 +18,42 @@ concurrency:
1818 cancel-in-progress : ${{ github.ref_name != 'main' }}
1919
2020jobs :
21- # Prepares dynamic test matrix values
22- matrix-prep :
23- runs-on : ubuntu-latest
24- steps :
25- - uses : actions/checkout@v4
26- - id : bazel-version
27- name : Prepare 'bazel-version' matrix axis
28- run : |
29- v=$(head -n 1 .bazelversion)
30- m=${v::1}
31- a=(
32- "major:$m, version:\"$v\""
33- "major:8, version:\"8.3.1\""
34- "major:6, version:\"6.5.0\""
35- )
36- printf -v j '{%s},' "${a[@]}"
37- echo "res=[${j%,}]" | tee -a $GITHUB_OUTPUT
38- - id : os
39- name : Prepare 'os' matrix axis
40- # Only run MacOS and Windows on main branch (not PRs) to minimize minutes (billed at 10X and 2X respectively)
41- # https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#included-storage-and-minutes
42- run : |
43- a=( ubuntu )
44- if [[ "${{ github.ref_name }}" == "main" ]] || [[ "${{ github.head_ref }}" == *"macos"* ]]; then
45- a+=( macos )
46- fi
47- if [[ "${{ github.ref_name }}" == "main" ]] || [[ "${{ github.head_ref }}" == *"windows"* ]]; then
48- a+=( windows )
49- fi
50- printf -v j '"%s",' "${a[@]}"
51- echo "res=[${j%,}]" | tee -a $GITHUB_OUTPUT
52- outputs :
53- bazel-version : ${{ steps.bazel-version.outputs.res }}
54- os : ${{ steps.os.outputs.res }}
55-
5621 test :
57- runs-on : ${{ matrix.os }}-latest
58- needs :
59- - matrix-prep
22+ runs-on : ${{ matrix.os }}
6023 defaults :
6124 run :
6225 working-directory : ${{ matrix.folder }}
6326 strategy :
6427 fail-fast : false
6528 matrix :
66- bazel-version : ${{ fromJSON(needs.matrix-prep.outputs.bazel-version) }}
67- bzlmod : [1, 0]
68- os : ${{ fromJSON(needs.matrix-prep.outputs.os) }}
29+ os : [macos, windows]
6930 folder :
7031 - ' .'
7132 - ' e2e/smoke'
7233 - ' e2e/external_dep'
7334 - ' e2e/external_dep/app'
7435 - ' e2e/worker'
75- exclude :
76- # Don't test MacOS and Windows against secondary bazel version to minimize minutes (billed at 10X and 2X respectively)
77- # https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#included-storage-and-minutes
78- - os : macos
79- bazel-version :
80- major : 6
81- - os : windows
82- bazel-version :
83- major : 6
84- # Linux on the primary bazel version is tested on Aspect Workflows
85- - os : ubuntu
86- bazel-version :
87- major : 7
88- bzlmod : 1
89- # Don't test root workspace with Bazel 6 to reduce the size of the test matrix
90- - bazel-version :
91- major : 6
92- folder : .
93- # Don't test non-bzlmod with Bazel 6 to reduce the size of the test matrix
94- - bazel-version :
95- major : 6
96- bzlmod : 0
97- # Don't test non-bzlmod with Bazel 8 where only modern bzlmod should be used
98- - bazel-version :
99- major : 8
100- bzlmod : 0
101- # Don't test root workspace with non-bzlmod
102- - bzlmod : 0
103- folder : .
104- # TODO: e2e/smoke broken with bazel6
105- - bazel-version :
106- major : 6
107- folder : e2e/smoke
108- # TODO: broken on bazel 8
109- - bazel-version :
110- major : 8
111- folder : e2e/external_dep
112- # TODO: broken on bazel 8
113- - bazel-version :
114- major : 8
115- folder : e2e/external_dep/app
116- # Disable some broken tests on Windows
117- - os : windows
118- folder : .
119- - os : windows
120- folder : e2e/worker
12136 include :
122- # Additional docs tests
123- - bazel-version :
124- major : 7
125- version : 7.3.2
126- bzlmod : 1
127- folder : docs
128- os : ubuntu
37+ folder : docs
38+ os : ubuntu
12939
13040 # Steps represent a sequence of tasks that will be executed as part of the job
13141 steps :
13242 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
13343 - uses : actions/checkout@v4
134-
135- - name : Mount bazel caches
136- uses : actions/cache@v4
137- with :
138- # Cache the --dist_cache and --repository_cache directories (see ci.bazelrc)
139- # and the default bazel output (https://bazel.build/remote/output-directories#layout)
140- # and bazelisk cache.
141- path : |
142- ~/.cache/bazel-disk-cache
143- ~/.cache/bazel-repository-cache
144- ~/.cache/bazel
145- ~/.cache/bazelisk
146- key : >-
147- bazel-cache-${{ matrix.bazel-version.version }}-${{ matrix.bzlmod }}-${{ matrix.os }}-${{ matrix.folder }}-
148- ${{ hashFiles('.bazelrc', '.bazelversion', '.bazeliskrc', '**/BUILD', '**/BUILD.bazel', '**/*.bzl', 'WORKSPACE', 'WORKSPACE.bazel', 'WORKSPACE.bzlmod', 'MODULE.bazel', '**/*.js', '!e2e') }}-
149- ${{ hashFiles(format('{0}/.bazelrc', matrix.folder), format('{0}/.bazelversion', matrix.folder), format('{0}/.bazeliskrc', matrix.folder), format('{0}/**/BUILD', matrix.folder), format('{0}/**/BUILD.bazel', matrix.folder), format('{0}/**/*.bzl', matrix.folder), format('{0}/WORKSPACE', matrix.folder), format('{0}/WORKSPACE.bazel', matrix.folder), format('{0}/WORKSPACE.bzlmod', matrix.folder), format('{0}/MODULE.bazel', matrix.folder), format('{0}/MODULE.bazel.lock', matrix.folder), format('{0}/**/*.js', matrix.folder)) }}
150- restore-keys : |
151- bazel-cache-${{ matrix.bazel-version.version }}-${{ matrix.bzlmod }}-${{ matrix.os }}-${{ matrix.folder }}-
152-
153- - name : Configure Bazel version
154- shell : bash
155- run : |
156- # Overwrite the .bazelversion instead of using USE_BAZEL_VERSION so that Bazelisk
157- # still bootstraps Aspect CLI from configuration in .bazeliskrc. Aspect CLI will
158- # then use .bazelversion to determine which Bazel version to use.
159- echo "${{ matrix.bazel-version.version }}" > .bazelversion
160-
161- # TODO: remove this block once we have Aspect CLI Windows releases
162- - name : Don't use Aspect CLI on Windows
163- if : matrix.os == 'windows'
164- shell : bash
165- run : rm -f .bazeliskrc
166-
44+ - uses : bazel-contrib/setup-bazel@20a70d3f3125a766bb29e2f597a2200896c37c98
16745 - name : bazel test //...
16846 shell : bash
16947 run : |
17048 bazel \
17149 --bazelrc=${GITHUB_WORKSPACE//\\/\/}/.github/workflows/ci.bazelrc \
172- test \
173- --config=ci \
174- --incompatible_merge_fixed_and_default_shell_env \
175- --test_tag_filters=-skip-on-bazel${{ matrix.bazel-version.major }},-skip-on-bzlmod-${{ matrix.bzlmod }} \
176- --build_tag_filters=-skip-on-bazel${{ matrix.bazel-version.major }},-skip-on-bzlmod-${{ matrix.bzlmod }} \
177- --enable_bzlmod=${{ matrix.bzlmod }} \
178- //...
50+ test --config=ci //...
17951
18052 bats-tests :
18153 runs-on : ubuntu-latest
182- needs :
183- - matrix-prep
184- strategy :
185- fail-fast : false
186- matrix :
187- bazel-version : ${{ fromJSON(needs.matrix-prep.outputs.bazel-version) }}
188- exclude :
189- - bazel-version :
190- major : 6
191- - bazel-version :
192- major : 8
19354 steps :
19455 - uses : actions/checkout@v4
19556
196- - name : Configure Bazel version
197- working-directory : e2e/test
198- # Overwrite the .bazelversion instead of using USE_BAZEL_VERSION so that Bazelisk
199- # still bootstraps Aspect CLI from configuration in .bazeliskrc. Aspect CLI will
200- # then use .bazelversion to determine which Bazel version to use
201- run : echo "${{ matrix.bazel-version.version }}" > .bazelversion
202-
20357 - name : Install Node.js
20458 uses : actions/setup-node@v3
20559 with :
0 commit comments