Use go 1.21 #370
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: Tests | |
on: | |
pull_request: | |
jobs: | |
unit-tests: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04, macos-11, windows-2019] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout Sources | |
uses: actions/checkout@v2 | |
- name: Setup Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: "1.21" | |
check-latest: true | |
# Load caches based on OS | |
- name: Linux Cache Go Modules | |
if: matrix.os == 'ubuntu-20.04' | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: MacOS Cache Go Modules | |
if: matrix.os == 'macos-11' | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/Library/Caches/go-build | |
~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Run Tests | |
run: go test -race -coverprofile coverage.txt -coverpkg ./... ./... | |
- name: Upload Codecov | |
# Only submit code coverage if OS is Linux | |
if: matrix.os == 'ubuntu-20.04' | |
uses: codecov/[email protected] | |
with: | |
files: ./coverage.txt |