@@ -18,65 +18,25 @@ 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:6, version:\"6.5.0\""
34- )
35- printf -v j '{%s},' "${a[@]}"
36- echo "res=[${j%,}]" | tee -a $GITHUB_OUTPUT
37- - id : os
38- name : Prepare 'os' matrix axis
39- # Only run MacOS and Windows on main branch (not PRs) to minimize minutes (billed at 10X and 2X respectively)
40- # https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#included-storage-and-minutes
41- run : |
42- a=( ubuntu )
43- if [[ "${{ github.ref_name }}" == "main" ]] || [[ "${{ github.head_ref }}" == *"macos"* ]]; then
44- a+=( macos )
45- fi
46- if [[ "${{ github.ref_name }}" == "main" ]] || [[ "${{ github.head_ref }}" == *"windows"* ]]; then
47- a+=( windows )
48- fi
49- printf -v j '"%s",' "${a[@]}"
50- echo "res=[${j%,}]" | tee -a $GITHUB_OUTPUT
51- outputs :
52- bazel-version : ${{ steps.bazel-version.outputs.res }}
53- os : ${{ steps.os.outputs.res }}
54-
21+ # Mac/Windows smoke tests
22+ # Linux tests are run on Aspect Workflows (see .aspect/workflows/config.yaml)
23+ # Only run on main branch (not PRs) to minimize minutes (billed at 10X and 2X respectively)
24+ # https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#included-storage-and-minutes
5525 test :
26+ if : github.ref_name == 'main' || contains(github.head_ref, 'macos') || contains(github.head_ref, 'windows')
5627 runs-on : ${{ matrix.os }}-latest
57- needs :
58- - matrix-prep
5928 strategy :
6029 fail-fast : false
6130 matrix :
62- bazel-version : ${{ fromJSON(needs.matrix-prep.outputs.bazel-version) }}
6331 bzlmod : [1, 0]
64- os : ${{ fromJSON(needs.matrix-prep.outputs.os) }}
32+ os : [macos, windows]
6533 folder :
6634 - ' .'
6735 - ' e2e/loaders'
6836 - ' e2e/smoke'
6937 - ' e2e/smoke_rjs3'
7038 - ' e2e/worker'
7139 exclude :
72- # Don't test MacOS and Windows against secondary bazel version to minimize minutes (billed at 10X and 2X respectively)
73- # https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#included-storage-and-minutes
74- - os : macos
75- bazel-version :
76- major : 6
77- - os : windows
78- bazel-version :
79- major : 6
8040 # Root repository no longer tests non-bzlmod/WORKSPACE
8141 - folder : .
8242 bzlmod : 0
8949 # rules_js v3 is bzlmod-only and requires bazel 7+
9050 - folder : e2e/smoke_rjs3
9151 bzlmod : 0
92- - folder : e2e/smoke_rjs3
93- bazel-version :
94- major : 6
95- # bazel 7 linux tested on Aspect Workflows
96- - os : ubuntu
97- bazel-version :
98- major : 7
99- bzlmod : 1
10052
10153 steps :
10254 - uses : actions/checkout@v4
@@ -108,29 +60,22 @@ jobs:
10860 ~/.cache/bazel-disk-cache
10961 ~/.cache/bazel-repository-cache
11062 ~/.cache/xdg-cache
111- key : bazel-cache-${{ matrix.bazel-version.version }}-${{ matrix.bzlmod }}-${{ matrix.os }}-${{ matrix.folder }}-${{ hashFiles('.bazelrc', '.bazelversion', '**/BUILD', '**/BUILD.bazel', '**/*.bzl', 'WORKSPACE', 'WORKSPACE.bazel', 'WORKSPACE.bzlmod', 'MODULE.bazel') }}
112- restore-keys : bazel-cache-${{ matrix.bazel-version.version }}-${{ matrix.bzlmod }}-${{ matrix.os }}-${{ matrix.folder }}-
113-
114- - name : Configure Bazel version
115- working-directory : ${{ matrix.folder }}
116- shell : bash
117- run : |
118- # Overwrite the .bazelversion instead of using USE_BAZEL_VERSION so that Bazelisk
119- # still bootstraps Aspect CLI from configuration in .bazeliskrc. Aspect CLI will
120- # then use .bazelversion to determine which Bazel version to use.
121- echo "${{ matrix.bazel-version.version }}" > .bazelversion
63+ key : bazel-cache-${{ matrix.bzlmod }}-${{ matrix.os }}-${{ matrix.folder }}-${{ hashFiles('.bazelrc', '.bazelversion', '**/BUILD', '**/BUILD.bazel', '**/*.bzl', 'WORKSPACE', 'WORKSPACE.bazel', 'WORKSPACE.bzlmod', 'MODULE.bazel') }}
64+ restore-keys : bazel-cache-${{ matrix.bzlmod }}-${{ matrix.os }}-${{ matrix.folder }}-
12265
12366 - name : bazel test //...
12467 working-directory : ${{ matrix.folder }}
12568 shell : bash
12669 run : |
70+ v=$(head -n 1 .bazelversion)
71+ m=${v::1}
12772 bazel \
128- --bazelrc=${GITHUB_WORKSPACE//\\/\/}/.github/workflows/bazel${{ matrix.bazel-version.major }}.bazelrc \
12973 --bazelrc=${GITHUB_WORKSPACE//\\/\/}/tools/preset.bazelrc \
13074 --bazelrc=${GITHUB_WORKSPACE//\\/\/}/.github/workflows/ci.bazelrc \
13175 test \
132- --test_tag_filters=-skip-on-bazel${{ matrix.bazel-version.major }} \
133- --build_tag_filters=-skip-on-bazel${{ matrix.bazel-version.major }} \
76+ --config=ci \
77+ --test_tag_filters=-skip-on-bazel${m} \
78+ --build_tag_filters=-skip-on-bazel${m} \
13479 --enable_bzlmod=${{ matrix.bzlmod }} \
13580 //...
13681
0 commit comments