Merge pull request #5 from st0le/master #22
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: devel | |
on: [push, pull_request] | |
env: | |
GO111MODULE: on | |
jobs: | |
test: | |
name: Tests | |
strategy: | |
fail-fast: false | |
matrix: | |
go: | |
- 1.19.x | |
- 1.20.x | |
- 1.21.x | |
os: | |
- ubuntu-22.04 | |
- macos-12 | |
- windows-2022 | |
runs-on: ${{ matrix.os}} | |
steps: | |
- name: Install | |
uses: actions/setup-go@v1 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Vet | |
run: | | |
go vet ./... | |
- name: Tests | |
run: | | |
go test ./... -v -timeout 30s -coverprofile=coverage.txt -covermode=atomic | |
- uses: dominikh/staticcheck-action@v1.2.0 | |
with: | |
version: "latest" | |
install-go: false | |
cache-key: ${{ matrix.go }} | |
- name: Coverage | |
uses: codecov/codecov-action@v1 | |
with: | |
flags: unittests | |
verbose: true | |
name: codecov-cline | |
- name: Environment | |
id: vars | |
run: | | |
printf "Using go at: $(which go)\n" | |
printf "Go version: $(go version)\n" | |
printf "\n\nGo environment:\n\n" | |
go env | |
printf "\n\nSystem environment:\n\n" | |
env | |
# Calculate the short SHA1 hash of the git commit | |
echo "::set-output name=short_sha::$(git rev-parse --short HEAD)" | |
echo "::set-output name=go_cache::$(go env GOCACHE)" | |
- name: Cache | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.vars.outputs.go_cache }} | |
key: ${{ runner.os }}-${{ matrix.go }}-go-ci-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.go }}-go-ci |