7878 os : ${{ fromJSON(needs.matrix-prep-os.outputs.os) }}
7979 config : ${{ fromJSON(needs.matrix-prep-config.outputs.configs) }}
8080 bazelversion : ${{ fromJSON(needs.matrix-prep-bazelversion.outputs.bazelversions) }}
81+ bzlmodEnabled : [true, false]
8182 folder :
8283 - ' .'
8384 - ' e2e/bzlmod'
9596 # TODO(https://github.com/aspect-build/rules_ts/issues/432): re-enable
9697 - folder : e2e/bzlmod
9798 config : rbe
99+ # TODO: combine bzlmod and workspace into a single 'smoke' e2e
100+ - folder : e2e/bzlmod
101+ bzlmodEnabled : false
102+ - folder : e2e/workspace
103+ bzlmodEnabled : true
98104
99105 # Steps represent a sequence of tasks that will be executed as part of the job
100106 steps :
@@ -128,6 +134,13 @@ jobs:
128134 # then use .bazelversion to determine which Bazel version to use
129135 run : echo "${{ matrix.bazelversion }}" > .bazelversion
130136
137+ - name : Set bzlmod flag
138+ # Store the --enable_bzlmod flag that we add to the test command below
139+ # only when we're running bzlmod in our test matrix.
140+ id : set_bzlmod_flag
141+ if : matrix.bzlmodEnabled
142+ run : echo "bzlmod_flag=--enable_bzlmod" >> $GITHUB_OUTPUT
143+
131144 - name : Write RBE credentials
132145 if : ${{ matrix.config == 'rbe' }}
133146 working-directory : ${{ matrix.folder }}
@@ -143,7 +156,13 @@ jobs:
143156 # Bazelisk will download bazel to here, ensure it is cached between runs.
144157 XDG_CACHE_HOME : ~/.cache/bazel-repo
145158 working-directory : ${{ matrix.folder }}
146- run : bazel --bazelrc=$GITHUB_WORKSPACE/.github/workflows/ci.bazelrc --bazelrc=.bazelrc test --config=${{ matrix.config }} //...
159+ run : |
160+ bazel --bazelrc=$GITHUB_WORKSPACE/.github/workflows/ci.bazelrc \
161+ --bazelrc=.bazelrc \
162+ test \
163+ --config=${{ matrix.config }} \
164+ //... \
165+ ${{ steps.set_bzlmod_flag.outputs.bzlmod_flag }}
147166
148167 test-worker :
149168 runs-on : ubuntu-latest
0 commit comments