chore: fix ci test

This commit is contained in:
WqyJh
2024-10-17 21:00:07 +08:00
parent 11a9953382
commit 0c54e67591
+18 -14
View File
@@ -1,17 +1,16 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Sanity check
name: Go
on: [push]
on:
- push
- pull_request
jobs:
build:
prcheck:
name: Sanity check
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.19', '1.20', '1.22', '1.23' ]
go-version: ["1.19", "1.20", "1.22", "1.23"]
steps:
- uses: actions/checkout@v4
@@ -19,9 +18,14 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Display Go version
run: go version
- name: Test
run: go test -v ./...
- name: Run vet
run: |
go vet .
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: latest
- name: Run tests
run: go test -race -covermode=atomic -coverprofile=coverage.out -v .
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4