From 9d826f003af861546c6a66d450ef2c25aa930e3f Mon Sep 17 00:00:00 2001 From: Sebastian Widmer Date: Mon, 22 Jul 2024 12:34:58 +0200 Subject: [PATCH] Always use latest go minor; use `setup-go` internal cache --- .github/workflows/lint.yaml | 11 ++++------- .github/workflows/release.yml | 11 ++++------- .github/workflows/test.yml | 11 ++++------- 3 files changed, 12 insertions(+), 21 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 47e3470..dd3f8f0 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -13,16 +13,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Determine Go version from go.mod - run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV + run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2 | cut -d "." -f 1,2)" >> $GITHUB_ENV + - uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} - - uses: actions/cache@v3 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- + - name: Run linters run: make lint diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1487435..be299bf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,17 +12,14 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 + - name: Determine Go version from go.mod - run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV + run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2 | cut -d "." -f 1,2)" >> $GITHUB_ENV + - uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} - - uses: actions/cache@v3 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- + - name: Login to Quay.io uses: docker/login-action@v2 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0ba244e..c2ff3e0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,17 +13,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Determine Go version from go.mod - run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2)" >> $GITHUB_ENV + run: echo "GO_VERSION=$(grep "go 1." go.mod | cut -d " " -f 2 | cut -d "." -f 1,2)" >> $GITHUB_ENV + - uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} - - uses: actions/cache@v3 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- + - name: Run tests run: make test # - name: Upload code coverage report to Code Climate