diff --git a/.github/actions/configure_bazelrc/action.yaml b/.github/actions/configure_bazelrc/action.yaml new file mode 100644 index 000000000..ad72a50bb --- /dev/null +++ b/.github/actions/configure_bazelrc/action.yaml @@ -0,0 +1,37 @@ +name: Configure bazelrc file and copy to $HOME/.bazelrc + +inputs: + bazelrc_path: + type: string + description: The path to the bazelrc file to use as the starting point. + default: '.bazelrc.ci' + buildbuddy_api_key: + type: string + description: Buildbuddy API key + +runs: + using: composite + steps: + - id: create_bazelrc_tmp + shell: bash + env: + BAZELRC: ${{ inputs.bazelrc_path }} + run: | + bazelrc_tmp="${BAZELRC}.tmp" + cp "${BAZELRC}" "${bazelrc_tmp}" + echo "bazelrc_tmp=${bazelrc_tmp}" >> "$GITHUB_OUTPUT" + - uses: tweag/configure-bazel-remote-cache-auth@v0 + with: + buildbuddy_api_key: ${{ inputs.buildbuddy_api_key }} + bazelrc_path: ${{ steps.create_bazelrc_tmp.outputs.bazelrc_tmp }} + + - shell: bash + env: + BAZELRC_TMP: ${{ steps.create_bazelrc_tmp.outputs.bazelrc_tmp }} + run: | + cat >>"${BAZELRC_TMP}" <>$HOME/.bazelrc <>$HOME/.bazelrc <