chore(go): update to go 1.21 #16
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
tags: | |
- cmd/* | |
- v* | |
branches: | |
- main | |
pull_request: | |
jobs: | |
# Check if there any dirty change for go mod tidy | |
go-mod: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.21 | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Check go mod | |
run: | | |
go mod tidy | |
git diff --exit-code go.mod | |
# Run golangci-lint | |
golangci-lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.21 | |
- uses: actions/checkout@v2 | |
- name: lint | |
uses: golangci/[email protected] | |
with: | |
version: latest | |
tests-on-windows: | |
needs: golangci-lint # run after golangci-lint action to not produce duplicated errors | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.21 # test only the latest go version to speed up CI | |
- uses: actions/cache@v4 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-1.21-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go-${{ matrix.golang }}- | |
- name: Setup gotestsum | |
uses: autero1/[email protected] | |
with: | |
gotestsum_version: 1.11.0 | |
- name: Run tests | |
run: gotestsum --format short-verbose ./... | |
tests-on-macos: | |
needs: golangci-lint # run after golangci-lint action to not produce duplicated errors | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.21 # test only the latest go version to speed up CI | |
- uses: actions/cache@v4 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-1.21-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go-${{ matrix.golang }}- | |
- name: Setup gotestsum | |
uses: autero1/[email protected] | |
with: | |
gotestsum_version: 1.11.0 | |
- name: Run tests | |
run: gotestsum --format short-verbose ./... | |
tests-on-unix: | |
needs: golangci-lint # run after golangci-lint action to not produce duplicated errors | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.21 # test only the latest go version to speed up CI | |
- uses: actions/cache@v4 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-1.21-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go-${{ matrix.golang }}- | |
- name: Setup gotestsum | |
uses: autero1/[email protected] | |
with: | |
gotestsum_version: 1.11.0 | |
- name: Run tests | |
run: gotestsum --format short-verbose ./... |