From b6e4a7d442e2cf6913da302c6044130fdbbdc994 Mon Sep 17 00:00:00 2001 From: Greg Magolan Date: Wed, 9 Oct 2024 11:33:42 -0700 Subject: [PATCH] ci: fix matrix job on GitHub Actions (#1967) --- .aspect/workflows/bazelrc | 12 ++++++------ .aspect/workflows/config.yaml | 26 +++++++++++++------------- .github/workflows/ci.bazelrc | 11 ----------- .github/workflows/ci.yaml | 20 +++++++++----------- 4 files changed, 28 insertions(+), 41 deletions(-) diff --git a/.aspect/workflows/bazelrc b/.aspect/workflows/bazelrc index efad85536..925c86e25 100644 --- a/.aspect/workflows/bazelrc +++ b/.aspect/workflows/bazelrc @@ -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 \ No newline at end of file +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 \ No newline at end of file diff --git a/.aspect/workflows/config.yaml b/.aspect/workflows/config.yaml index d412a065e..ff660b727 100644 --- a/.aspect/workflows/config.yaml +++ b/.aspect/workflows/config.yaml @@ -7,7 +7,7 @@ workspaces: - test: bazel: flags: - - --config=aspect_rbe + - --config=rbe e2e/bzlmod: icon: bazel tasks: @@ -15,7 +15,7 @@ workspaces: queue: aspect-default bazel: flags: - - --config=aspect_rbe + - --config=rbe - format: without: true - buildifier: @@ -31,7 +31,7 @@ workspaces: queue: aspect-medium bazel: flags: - - --config=aspect_rbe + - --config=rbe - format: without: true - buildifier: @@ -50,7 +50,7 @@ workspaces: queue: aspect-default bazel: flags: - - --config=aspect_rbe + - --config=rbe - format: without: true - buildifier: @@ -94,7 +94,7 @@ workspaces: queue: aspect-medium bazel: flags: - - --config=aspect_rbe + - --config=rbe - format: without: true - buildifier: @@ -110,7 +110,7 @@ workspaces: queue: aspect-medium bazel: flags: - - --config=aspect_rbe + - --config=rbe - format: without: true - buildifier: @@ -126,7 +126,7 @@ workspaces: queue: aspect-medium bazel: flags: - - --config=aspect_rbe + - --config=rbe - format: without: true - buildifier: @@ -224,7 +224,7 @@ workspaces: queue: aspect-medium bazel: flags: - - --config=aspect_rbe + - --config=rbe - format: without: true - buildifier: @@ -240,7 +240,7 @@ workspaces: queue: aspect-medium bazel: flags: - - --config=aspect_rbe + - --config=rbe - format: without: true - buildifier: @@ -256,7 +256,7 @@ workspaces: queue: aspect-medium bazel: flags: - - --config=aspect_rbe + - --config=rbe - format: without: true - buildifier: @@ -272,7 +272,7 @@ workspaces: queue: aspect-medium bazel: flags: - - --config=aspect_rbe + - --config=rbe - format: without: true - buildifier: @@ -288,7 +288,7 @@ workspaces: queue: aspect-medium bazel: flags: - - --config=aspect_rbe + - --config=rbe - format: without: true - buildifier: @@ -304,7 +304,7 @@ workspaces: queue: aspect-medium bazel: flags: - - --config=aspect_rbe + - --config=rbe - format: without: true - buildifier: diff --git a/.github/workflows/ci.bazelrc b/.github/workflows/ci.bazelrc index 915584e86..2f4996122 100644 --- a/.github/workflows/ci.bazelrc +++ b/.github/workflows/ci.bazelrc @@ -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 diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4f093b964..29aac6988 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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 }} @@ -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 @@ -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 }} @@ -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: @@ -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: | @@ -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 \ //...