From 57df9504e573d06671215dfbd7607b557ed6bf54 Mon Sep 17 00:00:00 2001 From: Chuck Grindel Date: Mon, 27 Nov 2023 13:02:34 -0700 Subject: [PATCH] Consolidate bazelrc config to a single action --- .github/actions/configure_bazelrc/action.yaml | 26 +++++-- .../actions/create_bazelrc_tmp/action.yaml | 26 ------- .github/workflows/workflow.yaml | 74 +------------------ 3 files changed, 23 insertions(+), 103 deletions(-) delete mode 100644 .github/actions/create_bazelrc_tmp/action.yaml diff --git a/.github/actions/configure_bazelrc/action.yaml b/.github/actions/configure_bazelrc/action.yaml index 203638538..284bf92aa 100644 --- a/.github/actions/configure_bazelrc/action.yaml +++ b/.github/actions/configure_bazelrc/action.yaml @@ -3,19 +3,35 @@ name: Configure bazelrc file and copy to $HOME/.bazelrc inputs: bazelrc_path: type: string - description: The path to the bazelrc file to configure. - required: true + description: The path to the bazelrc file to use as the starting point. + default: '.bazelrc.ci' runs: using: composite steps: - - shell: bash + - id: create_bazelrc_tmp + shell: bash env: BAZELRC: ${{ inputs.bazelrc_path }} run: | - cat >>"${BAZELRC}" <> "$GITHUB_OUTPUT" + + # DO NOT MERGE!!! + # TODO: Update with the correct tagged release. + - uses: tweag/configure-bazel-remote-cache-auth@fix_output + with: + buildbuddy_api_key: ${{ secrets.BUILDBUDDY_API_KEY }} + bazelrc_path: ${{ steps.create_bazelrc_tmp.bazelrc_tmp }} + + - shell: bash + env: + BAZELRC_TMP: ${{ steps.create_bazelrc_tmp.bazelrc_tmp }} + run: | + cat >>"${BAZELRC_TMP}" <> "$GITHUB_OUTPUT" diff --git a/.github/workflows/workflow.yaml b/.github/workflows/workflow.yaml index ebdc96b77..21115bf7e 100644 --- a/.github/workflows/workflow.yaml +++ b/.github/workflows/workflow.yaml @@ -34,47 +34,10 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - # DO NOT MERGE - # TODO: Remove CHUCK DEBUG - - name: CHUCK DEBUG - shell: bash - run: | - echo >&2 "current dir" - pwd >&2 - echo >&2 ".github dir" - ls -l .github >&2 - echo >&2 ".github/actions dir" - ls -l .github/actions >&2 - echo >&2 ".github/actions/create_bazelrc_tmp dir" - ls -l .github/actions/create_bazelrc_tmp >&2 - echo >&2 ".github/actions/configure_bazelrc dir" - ls -l .github/actions/configure_bazelrc >&2 - uses: cachix/install-nix-action@v23 with: nix_path: nixpkgs=./docs/nixpkgs.nix - - uses: ./.github/actions/create_bazelrc_tmp - id: create_bazelrc_tmp - with: - bazelrc_path: .bazelrc.ci - # DO NOT MERGE!!! - # TODO: Update with the correct tagged release. - - uses: tweag/configure-bazel-remote-cache-auth@fix_output - with: - buildbuddy_api_key: ${{ secrets.BUILDBUDDY_API_KEY }} - bazelrc_path: ${{ steps.create_bazelrc_tmp.bazelrc_tmp }} - - uses: ./.github/actions/configure_bazelrc/action.yaml - with: - bazelrc_path: ${{ steps.create_bazelrc_tmp.bazelrc_tmp }} - # - name: Configure - # env: - # BAZELRC_TMP: ${{ steps.create_bazelrc_tmp.bazelrc_tmp }} - # run: | - # cat >>"${BAZELRC_TMP}" <>$HOME/.bazelrc <