From 9357d6b6ac7eabd5ff50f24704475bb2041a7bb8 Mon Sep 17 00:00:00 2001 From: Keepers Date: Tue, 27 Sep 2022 11:12:14 -0600 Subject: [PATCH] swap over the remaining go setup scripts (#957) ## Type of change - [x] :computer: CI/Deployment ## Issue(s) * #790 ## Test Plan - [x] :green_heart: E2E --- .github/workflows/ci_test_cleanup.yml | 32 +++---------------- .github/workflows/docgen.yml | 45 +++------------------------ .github/workflows/image.yml | 3 +- 3 files changed, 10 insertions(+), 70 deletions(-) diff --git a/.github/workflows/ci_test_cleanup.yml b/.github/workflows/ci_test_cleanup.yml index 3658d6ca8..a8feca884 100644 --- a/.github/workflows/ci_test_cleanup.yml +++ b/.github/workflows/ci_test_cleanup.yml @@ -10,38 +10,14 @@ jobs: runs-on: ubuntu-latest steps: - - # check out the repo - - name: Repo Code Checkout - uses: actions/checkout@v3 + - uses: actions/checkout@v3 with: ref: ${{ github.head_ref }} - # Get values for cache paths to be used in later steps - - id: go-cache-paths - working-directory: ./src - run: | - echo "::set-output name=go-build::$(go env GOCACHE)" - echo "::set-output name=go-mod::$(go env GOMODCACHE)" - - name: Golang Setup - uses: actions/setup-go@v3 + - name: Setup Golang with cache + uses: magnetikonline/action-golang-cache@v3 with: - go-version: 1.18 - cache: true - cache-dependency-path: src/go.sum - - # download packages - - name: Cache Go Mod - uses: actions/cache@v3 - id: cache - with: - path: ${{ steps.go-cache-paths.outputs.go-mod }} - key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - - - name: Run go mod download - if: steps.cache.outputs.cache-hit != 'true' - working-directory: ./src - run: go mod download + go-version-file: src/go.mod # sets the maximimum time to now-30m. # CI test have a 10 minute timeout. diff --git a/.github/workflows/docgen.yml b/.github/workflows/docgen.yml index 0fbfbea93..34d98827d 100644 --- a/.github/workflows/docgen.yml +++ b/.github/workflows/docgen.yml @@ -17,37 +17,14 @@ jobs: if: needs.precheck.outputs.fileschanged == 'true' runs-on: ubuntu-latest steps: - - name: Repo Code Checkout - uses: actions/checkout@v3 + - uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.ref }} - # Get values for cache paths to be used in later steps - - id: go-cache-paths - working-directory: ./src - run: | - echo "::set-output name=go-build::$(go env GOCACHE)" - echo "::set-output name=go-mod::$(go env GOMODCACHE)" - - - name: Golang Setup - uses: actions/setup-go@v3 + - name: Setup Golang with cache + uses: magnetikonline/action-golang-cache@v3 with: - go-version: 1.18 - cache: true - cache-dependency-path: src/go.sum - - # download packages - - name: Cache Go Mod - uses: actions/cache@v3 - id: cache - with: - path: ${{ steps.go-cache-paths.outputs.go-mod }} - key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - - - name: Run go mod download - if: steps.cache.outputs.cache-hit != 'true' - working-directory: ./src - run: go mod download + go-version-file: src/go.mod # run the markdown generator - name: Generate Markdown @@ -78,16 +55,4 @@ jobs: uses: juliangruber/approve-pull-request-action@v1 with: github-token: ${{ secrets.GITHUB_TOKEN }} - number: ${{ steps.cpr.outputs.pull-request-number }} - - # for the future, if we create a PAT - # https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token - - # # make the PR auto-merge - # - name: Enable Pull Request Automerge - # if: steps.cpr.outputs.pull-request-operation == 'created' - # uses: peter-evans/enable-pull-request-automerge@v2 - # with: - # token: ${{ secrets.PAT }} - # pull-request-number: ${{ steps.cpr.outputs.pull-request-number }} - # merge-method: squash \ No newline at end of file + number: ${{ steps.cpr.outputs.pull-request-number }} \ No newline at end of file diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index 7f2681c1c..75da2b598 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -22,8 +22,7 @@ jobs: env: PLATFORMS: linux/amd64,linux/arm64 steps: - - name: Checkout repository - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - name: Build Corso Binaries run: >