* Update CI Go version to 1.20/1.19 * Update `golangci-lint` to v1.51.2 * Update coverage collection to use new Go 1.20 tools * Update coverage job to only run on latest Go version Fixes #367
90 lines
2.5 KiB
YAML
90 lines
2.5 KiB
YAML
name: ci
|
|
permissions:
|
|
contents: read
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
schedule:
|
|
- cron: "17 12 * * 6"
|
|
jobs:
|
|
# Required job is a stub which only runs when other dependencies complete
|
|
# successfully. This is intended to be listed as a required check in a branch
|
|
# protection rule.
|
|
required:
|
|
needs:
|
|
- test
|
|
- coverage
|
|
- lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- run: "true"
|
|
test:
|
|
strategy:
|
|
matrix:
|
|
go-version: [1.19.x, 1.20.x]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Install Go
|
|
uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1
|
|
with:
|
|
go-version: ${{ matrix.go-version }}
|
|
check-latest: true
|
|
- name: Checkout code
|
|
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Bootstrap
|
|
run: ./script/bootstrap
|
|
- name: Build
|
|
run: go build ./...
|
|
- name: Test
|
|
run: go test -bench . ./...
|
|
coverage:
|
|
needs:
|
|
- test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Install Go
|
|
uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1
|
|
with:
|
|
go-version: 1.20.x
|
|
check-latest: true
|
|
- name: Checkout code
|
|
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Bootstrap
|
|
run: ./script/bootstrap
|
|
- name: Coverage
|
|
run: ./script/coverage
|
|
- name: Upload Unit Test Coverage
|
|
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
files: unittests.coverprofile
|
|
flags: unittests
|
|
- name: Upload Integration Test Coverage
|
|
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # v3.1.1
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
files: integration.coverprofile
|
|
flags: integration
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Install Go
|
|
uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f # v3.3.1
|
|
with:
|
|
go-version: 1.20.x
|
|
check-latest: true
|
|
- name: Checkout code
|
|
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
|
|
with:
|
|
persist-credentials: false
|
|
- name: Bootstrap
|
|
run: ./script/bootstrap
|
|
- name: Lint
|
|
run: ./script/lint
|