Merge pull request #475 from kool-dev/dependabot/go_modules/golang.or… #856
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
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
name: go test | |
jobs: | |
test: | |
strategy: | |
matrix: | |
go-version: [1.21.x] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Caching | |
uses: actions/cache@v2 | |
with: | |
path: ~/go/pkg | |
key: ${{ runner.os }}-kool-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-kool- | |
- name: Download dependencies | |
run: | | |
go mod download | |
go install | |
- name: Test | |
if: matrix.os == 'macos-latest' || matrix.os == 'windows-latest' | |
run: go test ./... | |
- name: Test with code coverage | |
if: matrix.os == 'ubuntu-latest' | |
run: go test -race -coverprofile=coverage.txt -covermode=atomic ./... | |
- name: Code Coverage | |
if: matrix.os == 'ubuntu-latest' | |
run: bash <(curl -s https://codecov.io/bash) |