From 127b30b59c29409d606cd3ec9870cf2f662da22f Mon Sep 17 00:00:00 2001 From: Brooke Hamilton <45323234+brooke-hamilton@users.noreply.github.com> Date: Thu, 23 Jan 2025 10:08:14 -0500 Subject: [PATCH 1/2] set golang cache option Signed-off-by: Brooke Hamilton <45323234+brooke-hamilton@users.noreply.github.com> --- .github/workflows/functional-test-cloud.yaml | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/.github/workflows/functional-test-cloud.yaml b/.github/workflows/functional-test-cloud.yaml index a15b0c6e22..5915abaa73 100644 --- a/.github/workflows/functional-test-cloud.yaml +++ b/.github/workflows/functional-test-cloud.yaml @@ -215,6 +215,7 @@ jobs: uses: actions/setup-go@v5 with: go-version: ${{ env.GOVER }} + cache: true - name: Generate ID for release id: gen-id @@ -493,22 +494,7 @@ jobs: uses: actions/setup-go@v5 with: go-version: ${{ env.GOVER }} - cache: false - - - name: Get Go Cache path - id: go-cache-paths - run: | - echo "go-build=$(go env GOCACHE)" >> $GITHUB_OUTPUT - echo "go-mod=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT - - - uses: actions/cache@v4 - with: - path: | - ${{ steps.go-cache-paths.outputs.go-build }} - ${{ steps.go-cache-paths.outputs.go-mod }} - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- + cache: true - name: Download rad CLI uses: actions/download-artifact@v4 From 8c2a07653af5ec3232cddc9686052097399054d7 Mon Sep 17 00:00:00 2001 From: Brooke Hamilton <45323234+brooke-hamilton@users.noreply.github.com> Date: Thu, 23 Jan 2025 10:47:19 -0500 Subject: [PATCH 2/2] cache setting on setup-go action Signed-off-by: Brooke Hamilton <45323234+brooke-hamilton@users.noreply.github.com> --- .github/actions/setup-rad-cli/action.yaml | 38 ----------------------- .github/workflows/build.yaml | 3 ++ .github/workflows/lint.yaml | 1 + .github/workflows/long-running-azure.yaml | 2 ++ .github/workflows/publish-docs.yaml | 1 + 5 files changed, 7 insertions(+), 38 deletions(-) delete mode 100644 .github/actions/setup-rad-cli/action.yaml diff --git a/.github/actions/setup-rad-cli/action.yaml b/.github/actions/setup-rad-cli/action.yaml deleted file mode 100644 index 02623c9cb2..0000000000 --- a/.github/actions/setup-rad-cli/action.yaml +++ /dev/null @@ -1,38 +0,0 @@ -name: "Setup Rad CLI" -description: "Sets up the environment to run rad CLI" -runs: - using: "composite" - steps: - - name: Set up Go ${{ env.GOVER }} - uses: actions/setup-go@v5 - with: - go-version: ${{ env.GOVER }} - cache: false - - name: Get Go Cache path - shell: bash - id: go-cache-paths - run: | - echo "go-build=$(go env GOCACHE)" >> $GITHUB_OUTPUT - echo "go-mod=$(go env GOMODCACHE)" >> $GITHUB_OUTPUT - - uses: actions/cache@v4 - with: - path: | - ${{ steps.go-cache-paths.outputs.go-build }} - ${{ steps.go-cache-paths.outputs.go-mod }} - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - name: Setup kubectl - uses: azure/setup-kubectl@v4 - - name: Parse release version and set environment variables - shell: bash - run: python ./.github/scripts/get_release_version.py - - name: Download release artifacts - uses: actions/download-artifact@v4 - with: - name: rad_cli_linux_amd64 - path: dist - - name: Make rad executable - shell: bash - run: chmod +x rad - working-directory: dist diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 39f154820e..cc93860fba 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -101,6 +101,7 @@ jobs: with: go-version: ${{ env.GOVER }} cache-dependency-path: go.sum + cache: true - name: Parse release version and set environment variables run: python ./.github/scripts/get_release_version.py - name: Make build @@ -179,6 +180,7 @@ jobs: uses: actions/setup-go@v5 with: go-version: ${{ env.GOVER }} + cache: true - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: @@ -275,6 +277,7 @@ jobs: uses: actions/setup-go@v5 with: go-version: ${{ env.GOVER }} + cache: true - name: Setup Node.js uses: actions/setup-node@v4 with: diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 685ec57e1f..71f46d900f 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -43,6 +43,7 @@ jobs: uses: actions/setup-go@v5 with: go-version: ${{ env.GOVER }} + cache: true - name: Setup NodeJS uses: actions/setup-node@v4 with: diff --git a/.github/workflows/long-running-azure.yaml b/.github/workflows/long-running-azure.yaml index 94f2e38cbe..bf48f504ba 100644 --- a/.github/workflows/long-running-azure.yaml +++ b/.github/workflows/long-running-azure.yaml @@ -177,6 +177,7 @@ jobs: uses: actions/setup-go@v5 with: go-version: ${{ env.GOVER }} + cache: true - name: Log the summary of build info for new version. if: steps.skip-build.outputs.SKIP_BUILD != 'true' continue-on-error: true @@ -330,6 +331,7 @@ jobs: uses: actions/setup-go@v5 with: go-version: ${{ env.GOVER }} + cache: true - name: Download rad CLI if: env.SKIP_BUILD != 'true' uses: actions/download-artifact@v4 diff --git a/.github/workflows/publish-docs.yaml b/.github/workflows/publish-docs.yaml index 50f5593cb3..83cf020321 100644 --- a/.github/workflows/publish-docs.yaml +++ b/.github/workflows/publish-docs.yaml @@ -53,6 +53,7 @@ jobs: with: go-version: ${{ env.GOVER }} cache-dependency-path: radius/go.sum + cache: true - name: Setup NodeJS uses: actions/setup-node@v4 with: