Skip to content

Commit

Permalink
ci: fix matrix job on GitHub Actions (#1967)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan authored Oct 9, 2024
1 parent 7e699c3 commit b6e4a7d
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 41 deletions.
12 changes: 6 additions & 6 deletions .aspect/workflows/bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ common --build_event_binary_file=build_event_log.bin
common --build_event_binary_file_path_conversion=false
common --build_event_publish_all_actions=true

common:aspect_rbe --extra_execution_platforms=@aspect_bazel_lib//platforms:x86_64_linux_remote
common:aspect_rbe --host_platform=@aspect_bazel_lib//platforms:x86_64_linux_remote
common:aspect_rbe --remote_executor=unix:///mnt/ephemeral/buildbarn/.cache/bb_clientd/grpc
common:aspect_rbe --genrule_strategy=remote,local
common:aspect_rbe --jobs=32
common:aspect_rbe --remote_timeout=3600
common:rbe --extra_execution_platforms=@aspect_bazel_lib//platforms:x86_64_linux_remote
common:rbe --host_platform=@aspect_bazel_lib//platforms:x86_64_linux_remote
common:rbe --remote_executor=unix:///mnt/ephemeral/buildbarn/.cache/bb_clientd/grpc
common:rbe --genrule_strategy=remote,local
common:rbe --jobs=32
common:rbe --remote_timeout=3600
26 changes: 13 additions & 13 deletions .aspect/workflows/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ workspaces:
- test:
bazel:
flags:
- --config=aspect_rbe
- --config=rbe
e2e/bzlmod:
icon: bazel
tasks:
- test:
queue: aspect-default
bazel:
flags:
- --config=aspect_rbe
- --config=rbe
- format:
without: true
- buildifier:
Expand All @@ -31,7 +31,7 @@ workspaces:
queue: aspect-medium
bazel:
flags:
- --config=aspect_rbe
- --config=rbe
- format:
without: true
- buildifier:
Expand All @@ -50,7 +50,7 @@ workspaces:
queue: aspect-default
bazel:
flags:
- --config=aspect_rbe
- --config=rbe
- format:
without: true
- buildifier:
Expand Down Expand Up @@ -94,7 +94,7 @@ workspaces:
queue: aspect-medium
bazel:
flags:
- --config=aspect_rbe
- --config=rbe
- format:
without: true
- buildifier:
Expand All @@ -110,7 +110,7 @@ workspaces:
queue: aspect-medium
bazel:
flags:
- --config=aspect_rbe
- --config=rbe
- format:
without: true
- buildifier:
Expand All @@ -126,7 +126,7 @@ workspaces:
queue: aspect-medium
bazel:
flags:
- --config=aspect_rbe
- --config=rbe
- format:
without: true
- buildifier:
Expand Down Expand Up @@ -224,7 +224,7 @@ workspaces:
queue: aspect-medium
bazel:
flags:
- --config=aspect_rbe
- --config=rbe
- format:
without: true
- buildifier:
Expand All @@ -240,7 +240,7 @@ workspaces:
queue: aspect-medium
bazel:
flags:
- --config=aspect_rbe
- --config=rbe
- format:
without: true
- buildifier:
Expand All @@ -256,7 +256,7 @@ workspaces:
queue: aspect-medium
bazel:
flags:
- --config=aspect_rbe
- --config=rbe
- format:
without: true
- buildifier:
Expand All @@ -272,7 +272,7 @@ workspaces:
queue: aspect-medium
bazel:
flags:
- --config=aspect_rbe
- --config=rbe
- format:
without: true
- buildifier:
Expand All @@ -288,7 +288,7 @@ workspaces:
queue: aspect-medium
bazel:
flags:
- --config=aspect_rbe
- --config=rbe
- format:
without: true
- buildifier:
Expand All @@ -304,7 +304,7 @@ workspaces:
queue: aspect-medium
bazel:
flags:
- --config=aspect_rbe
- --config=rbe
- format:
without: true
- buildifier:
Expand Down
11 changes: 0 additions & 11 deletions .github/workflows/ci.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,3 @@ common --announce_rc

# Allows tests to run bazelisk-in-bazel, since this is the cache folder used
common --test_env=XDG_CACHE_HOME

# Remote execution
build:rbe --bes_backend=grpcs://remote.buildbuddy.io
build:rbe --bes_results_url=https://app.buildbuddy.io/invocation/
build:rbe --extra_execution_platforms=@aspect_rules_js//platforms:x86_64_linux_remote
# local fallback allows genrule to be executed locally if requested explicitly
build:rbe --genrule_strategy=remote,local
build:rbe --host_platform=@aspect_rules_js//platforms:x86_64_linux_remote
build:rbe --jobs=32
build:rbe --remote_executor=grpcs://remote.buildbuddy.io
build:rbe --remote_timeout=3600
20 changes: 9 additions & 11 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ jobs:
echo "res=[${j%,}]" | tee -a $GITHUB_OUTPUT
outputs:
bazel-version: ${{ steps.bazel-version.outputs.res }}
config: ${{ steps.config.outputs.res }}
folder: ${{ steps.folder.outputs.res }}
os: ${{ steps.os.outputs.res }}

Expand All @@ -117,7 +116,6 @@ jobs:
bazel-version: ${{ fromJSON(needs.matrix-prep.outputs.bazel-version) }}
bzlmod: [1, 0]
os: ${{ fromJSON(needs.matrix-prep.outputs.os) }}
config: ${{ fromJSON(needs.matrix-prep.outputs.config) }}
folder: ${{ fromJSON(needs.matrix-prep.outputs.folder) }}
exclude:
# Exclude Windows default, will opt-in to includes
Expand Down Expand Up @@ -210,11 +208,11 @@ jobs:
~/.cache/bazel-repository-cache
~/.cache/xdg-cache
key: >-
bazel-cache-${{ matrix.bazel-version.version }}-${{ matrix.bzlmod }}-${{ matrix.os }}-${{ matrix.config }}-${{ matrix.folder }}-
bazel-cache-${{ matrix.bazel-version.version }}-${{ matrix.bzlmod }}-${{ matrix.os }}-${{ matrix.folder }}-
${{ hashFiles('.bazelrc', '.bazelversion', '.bazeliskrc', '**/BUILD', '**/BUILD.bazel', '**/*.bzl', 'WORKSPACE', 'WORKSPACE.bazel', 'WORKSPACE.bzlmod', 'MODULE.bazel', '**/*.js', '!e2e') }}-
${{ 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)) }}
restore-keys: |
bazel-cache-${{ matrix.bazel-version.version }}-${{ matrix.bzlmod }}-${{ matrix.os }}-${{ matrix.config }}-${{ matrix.folder }}-
bazel-cache-${{ matrix.bazel-version.version }}-${{ matrix.bzlmod }}-${{ matrix.os }}-${{ matrix.folder }}-
- name: Configure Bazel version
working-directory: ${{ matrix.folder }}
Expand Down Expand Up @@ -246,9 +244,9 @@ jobs:
--bazelrc=${GITHUB_WORKSPACE//\\/\/}/.aspect/bazelrc/ci.bazelrc \
--bazelrc=${GITHUB_WORKSPACE//\\/\/}/.github/workflows/ci.bazelrc \
test \
--config=${{ matrix.config }} \
--test_tag_filters=-skip-on-${{ matrix.config }},-skip-on-bazel${{ matrix.bazel-version.major }} \
--build_tag_filters=-skip-on-${{ matrix.config }},-skip-on-bazel${{ matrix.bazel-version.major }} \
--config=local \
--test_tag_filters=-skip-on-bazel${{ matrix.bazel-version.major }} \
--build_tag_filters=-skip-on-bazel${{ matrix.bazel-version.major }} \
--enable_bzlmod=${{ matrix.bzlmod }} \
//...
env:
Expand Down Expand Up @@ -280,7 +278,7 @@ jobs:
# Don't run on RBE. Coverage does not work properly with RBE. See: bazelbuild/bazel#4685.
# Don't run coverage on e2e/bzlmod. It fails evaluating js/private/coverage/BUILD.bazel because write_source_files is not yet bzlmod compatible.
# Don't run coverage on Windows. It is currently broken.
if: matrix.config == 'local' && matrix.os != 'windows'
if: matrix.os != 'windows'
working-directory: ${{ matrix.folder }}
shell: bash
run: |
Expand All @@ -289,9 +287,9 @@ jobs:
--bazelrc=${GITHUB_WORKSPACE//\\/\/}/.aspect/bazelrc/ci.bazelrc \
--bazelrc=${GITHUB_WORKSPACE//\\/\/}/.github/workflows/ci.bazelrc \
coverage \
--config=${{ matrix.config }} \
--test_tag_filters=-skip-on-${{ matrix.config }},-skip-on-bazel${{ matrix.bazel-version.major }} \
--build_tag_filters=-skip-on-${{ matrix.config }},-skip-on-bazel${{ matrix.bazel-version.major }} \
--config=local \
--test_tag_filters=-skip-on-bazel${{ matrix.bazel-version.major }} \
--build_tag_filters=-skip-on-bazel${{ matrix.bazel-version.major }} \
--enable_bzlmod=${{ matrix.bzlmod }} \
--instrument_test_targets \
//...
Expand Down

0 comments on commit b6e4a7d

Please sign in to comment.