Skip to content

Go

Go #13

Workflow file for this run

name: Go
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
# Every day at 8am.
- cron: "0 8 * * *"
# Cancel running workflows on new push to a PR.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build_and_test:
name: Build and test
strategy:
matrix:
go-version: ['1.21.x']
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Build
run: go build -v ./...
- name: Test
run: go test -v -covermode atomic -coverpkg ./... -coverprofile cover.out ./...
- uses: codecov/codecov-action@v4-beta
env:
CODECOV_TOKEN: '804457b0-03f8-4cf6-bc99-eaf43399177b'
with:
flags: ${{ matrix.platform }}-unit
fail_ci_if_error: true
verbose: true
race:
name: Race test
strategy:
matrix:
go-version: ['1.21.x']
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Race
run: go test -race -v ./...