replace monkey with gomonkey #81
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: Test | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "**/*.go" | |
- "go.mod" | |
- "go.sum" | |
- "Makefile" | |
- ".github/workflows/test.yaml" | |
pull_request: | |
types: [opened, reopened, synchronize] | |
branches: | |
- main | |
paths: | |
- "**/*.go" | |
- "go.mod" | |
- "go.sum" | |
- "Makefile" | |
- ".github/workflows/test.yaml" | |
jobs: | |
test: | |
name: Unit Testing | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
steps: | |
- name: Checkout Source Code | |
uses: actions/checkout@v4 | |
- name: Setup Go Environment | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
id: go | |
- name: Go Get dependencies | |
run: go get -v -t -d ./... | |
- name: Go Test | |
env: | |
GOMAXPROCS: 1 # 设置单线程环境变量 | |
run: make test TEST_FLAGS="-coverprofile=coverage.txt -covermode=atomic -p 1" | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4.5.0 | |
with: | |
file: ./coverage.txt |