diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4e769fc..75a74bd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,12 +10,18 @@ on: jobs: build: runs-on: ubuntu-latest - container: - image: golang:1.18 + steps: - name: clone uses: actions/checkout@v3 + - name: install go + uses: actions/setup-go@v3 + with: + # use version from go.mod file + go-version-file: 'go.mod' + cache: true + - name: build run: | make build diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index d3d8d2b..780eba8 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -11,12 +11,18 @@ on: jobs: prerelease: runs-on: ubuntu-latest - container: - image: golang:1.18 + steps: - name: clone uses: actions/checkout@v3 + - name: install go + uses: actions/setup-go@v3 + with: + # use version from go.mod file + go-version-file: 'go.mod' + cache: true + - name: build env: GOOS: linux diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index afd3806..031bc91 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,12 +10,18 @@ on: jobs: publish: runs-on: ubuntu-latest - container: - image: golang:1.18 + steps: - name: clone uses: actions/checkout@v3 + - name: install go + uses: actions/setup-go@v3 + with: + # use version from go.mod file + go-version-file: 'go.mod' + cache: true + - name: build env: GOOS: linux diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index d580eb2..922a7bb 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -26,12 +26,18 @@ jobs: full-review: runs-on: ubuntu-latest - container: - image: golang:1.18 + steps: - name: clone uses: actions/checkout@v3 + - name: install go + uses: actions/setup-go@v3 + with: + # use version from go.mod file + go-version-file: 'go.mod' + cache: true + - name: golangci-lint uses: reviewdog/action-golangci-lint@v2 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b9cc040..62ff7f3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,12 +10,18 @@ on: jobs: test: runs-on: ubuntu-latest - container: - image: golang:1.18 + steps: - name: clone uses: actions/checkout@v3 + - name: install go + uses: actions/setup-go@v3 + with: + # use version from go.mod file + go-version-file: 'go.mod' + cache: true + - name: test run: | go test -race -covermode=atomic -coverprofile=coverage.out ./... diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index c08f8b8..61580cf 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -10,12 +10,18 @@ on: jobs: validate: runs-on: ubuntu-latest - container: - image: golang:1.18 + steps: - name: clone uses: actions/checkout@v3 + - name: install go + uses: actions/setup-go@v3 + with: + # use version from go.mod file + go-version-file: 'go.mod' + cache: true + - name: validate run: | # Check that go mod tidy produces a zero diff; clean up any changes afterwards.