From eb4c9592ab00d86b740f85ab668a4625b61cff77 Mon Sep 17 00:00:00 2001 From: wata_mac Date: Wed, 7 Sep 2022 01:11:38 +0900 Subject: [PATCH] Improve Go workflows --- .github/workflows/build.yml | 14 ++------------ .github/workflows/e2e.yml | 4 ++-- .github/workflows/generated_code_checks.yml | 14 ++------------ .github/workflows/goreleaser.yml | 2 +- .github/workflows/maintenance.yaml | 2 +- .github/workflows/release.yml | 14 ++------------ 6 files changed, 10 insertions(+), 40 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b233f54b..e8b2e196 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,18 +23,8 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.19 - - name: Restore Cache - uses: actions/cache@v3 - with: - path: |- - ~/go/pkg/mod - ~/.cache/go-build - ~/Library/Caches/go-build - %LocalAppData%\go-build - key: ${{ matrix.os }}-go-${{ hashFiles('go.sum') }} - restore-keys: | - ${{ runner.os }}-go- + go-version-file: 'go.mod' + cache: true - name: Run tests run: make test - name: Run build diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 2fa38b5c..76e5e370 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -24,9 +24,9 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: - go-version: 1.19 + go-version-file: 'go.mod' - name: Install TFLint run: curl -sL https://raw.githubusercontent.com/terraform-linters/tflint/master/install_linux.sh | bash - name: Install plugin (Linux) diff --git a/.github/workflows/generated_code_checks.yml b/.github/workflows/generated_code_checks.yml index f1bc91c1..9a4facb0 100644 --- a/.github/workflows/generated_code_checks.yml +++ b/.github/workflows/generated_code_checks.yml @@ -13,17 +13,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.19 - - name: Restore Cache - uses: actions/cache@v3 - with: - path: |- - ~/go/pkg/mod - ~/.cache/go-build - ~/Library/Caches/go-build - %LocalAppData%\go-build - key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }} - restore-keys: | - ${{ runner.os }}-go- + go-version-file: 'go.mod' + cache: true - name: go generate and diff checks run: go generate ./... && git diff --exit-code diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index 7117d6df..3020f671 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.19 + go-version-file: 'go.mod' - name: goreleaser check uses: goreleaser/goreleaser-action@v3 with: diff --git a/.github/workflows/maintenance.yaml b/.github/workflows/maintenance.yaml index b220ca4d..4314d64b 100644 --- a/.github/workflows/maintenance.yaml +++ b/.github/workflows/maintenance.yaml @@ -13,7 +13,7 @@ jobs: submodules: true - uses: actions/setup-go@v3 with: - go-version: 1.19 + go-version-file: 'go.mod' - run: | go get github.com/aws/aws-sdk-go go mod tidy diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bf9fd1b5..c6816bb4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,18 +18,8 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.19 - - name: Restore Cache - uses: actions/cache@v3 - with: - path: |- - ~/go/pkg/mod - ~/.cache/go-build - ~/Library/Caches/go-build - %LocalAppData%\go-build - key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }} - restore-keys: | - ${{ runner.os }}-go- + go-version-file: 'go.mod' + cache: true - name: Run GoReleaser uses: goreleaser/goreleaser-action@v3 with: