Skip to content

Use go 1.21

Use go 1.21 #362

Workflow file for this run

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: Windows Cache Go Modules
if: matrix.os == 'windows-2019'
uses: actions/cache@v2
with:
path: |
%LocalAppData%\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