4242 run : echo "os=macos-latest" >> $GITHUB_OUTPUT
4343 # Only run on main branch (not PRs) to minimize macOS minutes (billed at 10X)
4444 # https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#included-storage-and-minutes
45- if : ${{ github.ref == 'refs/heads/main' }}
45+ if : github.ref == 'refs/heads/main'
46+ - id : windows
47+ run : echo "os=windows-latest" >> $GITHUB_OUTPUT
48+ # Only run on main branch (or PR branches that contain 'windows') to minimize Windows minutes (billed at 2X)
49+ # https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#included-storage-and-minutes
50+ if : github.ref == 'refs/heads/main' || contains(github.head_ref, 'windows') || github.head_ref == 'bzlmod'
4651 outputs :
4752 # Will look like ["ubuntu-latest", "macos-latest"]
4853 os : ${{ toJSON(steps.*.outputs.os) }}
@@ -59,17 +64,27 @@ jobs:
5964 fail-fast : false
6065 matrix :
6166 os : ${{ fromJSON(needs.matrix-prep-os.outputs.os) }}
67+ bzlmodEnabled : [true, false]
6268 bazelversion : ${{ fromJSON(needs.matrix-prep-bazelversion.outputs.bazelversions) }}
6369 folder :
6470 - ' .'
6571 - ' e2e/loaders'
66- - ' e2e/workspace '
72+ - ' e2e/smoke '
6773 - ' e2e/worker'
6874 exclude :
6975 # Don't test macos with Bazel 5 to minimize macOS minutes (billed at 10X)
7076 # https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#included-storage-and-minutes
7177 - os : macos-latest
7278 bazelversion : 5.3.2
79+ # Don't test bzlmod with Bazel 5 (not supported)
80+ - bazelversion : 5.3.2
81+ bzlmodEnabled : true
82+ # TODO
83+ - folder : e2e/loaders
84+ bzlmodEnabled : true
85+ # TODO
86+ - folder : e2e/worker
87+ bzlmodEnabled : true
7388
7489 # Steps represent a sequence of tasks that will be executed as part of the job
7590 steps :
@@ -103,12 +118,19 @@ jobs:
103118 # then use .bazelversion to determine which Bazel version to use
104119 run : echo "${{ matrix.bazelversion }}" > .bazelversion
105120
121+ - name : Set bzlmod flag
122+ # Store the --enable_bzlmod flag that we add to the test command below
123+ # only when we're running bzlmod in our test matrix.
124+ id : set_bzlmod_flag
125+ if : matrix.bzlmodEnabled
126+ run : echo "bzlmod_flag=--enable_bzlmod" >> $GITHUB_OUTPUT
127+
106128 - name : bazel test //...
107129 env :
108130 # Bazelisk will download bazel to here, ensure it is cached between runs.
109131 XDG_CACHE_HOME : ~/.cache/bazel-repo
110132 working-directory : ${{ matrix.folder }}
111- run : bazel --bazelrc=$GITHUB_WORKSPACE /.github/workflows/ci.bazelrc --bazelrc=.bazelrc test //...
133+ run : bazel --bazelrc=${{ github.workspace }} /.github/workflows/ci.bazelrc --bazelrc=.bazelrc test ${{ steps.set_bzlmod_flag.outputs.bzlmod_flag }} //...
112134
113135 - name : run ./test.sh
114136 working-directory : ${{ matrix.folder }}
0 commit comments