From eea778d14fb0fba992ca51e869226cadbefedee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Vu=C4=8Dica?= Date: Mon, 13 May 2024 16:11:18 +0100 Subject: [PATCH 1/2] .github/workflows: For Bazel RBE, use a BuildBuddy secret as part of CI. --- .github/workflows/ci-bazel.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-bazel.yml b/.github/workflows/ci-bazel.yml index b6b92777..955813eb 100644 --- a/.github/workflows/ci-bazel.yml +++ b/.github/workflows/ci-bazel.yml @@ -118,7 +118,7 @@ jobs: # More useful with e.g. npm. - name: rbe bazel build - run: bazel build --config=remote --build_metadata=ROLE=CI //:yatc + run: bazel build --config=remote --build_metadata=ROLE=CI --remote_header=x-buildbuddy-api-key=${{ secrets.BUILDBUDDY_ORG_API_KEY }} //:yatc bazel_test_buildbuddy: runs-on: ubuntu-latest @@ -154,7 +154,7 @@ jobs: # More useful with e.g. npm. - name: rbe bazel test - run: bazel test --config=remote --build_metadata=ROLE=CI //:util_test + run: bazel test --config=remote --build_metadata=ROLE=CI --remote_header=x-buildbuddy-api-key=${{ secrets.BUILDBUDDY_ORG_API_KEY }} //:util_test # Temporarily allow errors. This is known to fail at this time due to insufficient # number of binary packages installed by the rules_libsdl12. continue-on-error: true From 72e6a061fdbc2b6d093d4e0be0310314b3572854 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Vu=C4=8Dica?= Date: Mon, 13 May 2024 16:22:14 +0100 Subject: [PATCH 2/2] .github/workflows: Set the BB API header only if the secret is set. The secret will not be set on pull requests, intentionally. --- .github/workflows/ci-bazel.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-bazel.yml b/.github/workflows/ci-bazel.yml index 955813eb..ce6e2642 100644 --- a/.github/workflows/ci-bazel.yml +++ b/.github/workflows/ci-bazel.yml @@ -118,7 +118,7 @@ jobs: # More useful with e.g. npm. - name: rbe bazel build - run: bazel build --config=remote --build_metadata=ROLE=CI --remote_header=x-buildbuddy-api-key=${{ secrets.BUILDBUDDY_ORG_API_KEY }} //:yatc + run: bazel build --config=remote --build_metadata=ROLE=CI ${BUILDBUDDY_ORG_API_KEY:+--remote_header=x-buildbuddy-api-key=${BUILDBUDDY_ORG_API_KEY}} //:yatc bazel_test_buildbuddy: runs-on: ubuntu-latest @@ -154,10 +154,12 @@ jobs: # More useful with e.g. npm. - name: rbe bazel test - run: bazel test --config=remote --build_metadata=ROLE=CI --remote_header=x-buildbuddy-api-key=${{ secrets.BUILDBUDDY_ORG_API_KEY }} //:util_test + run: bazel test --config=remote --build_metadata=ROLE=CI ${BUILDBUDDY_ORG_API_KEY:+--remote_header=x-buildbuddy-api-key=${BUILDBUDDY_ORG_API_KEY}} //:util_test # Temporarily allow errors. This is known to fail at this time due to insufficient # number of binary packages installed by the rules_libsdl12. continue-on-error: true + env: + BUILDBUDDY_ORG_API_KEY: ${{ secrets.BUILDBUDDY_ORG_API_KEY }} - name: print ldd run: ldd bazel-bin/util_test