mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-17 09:16:36 +08:00
feat: add unit test
This commit is contained in:
parent
8a3385b477
commit
d09c553b62
21
.github/workflows/ci.yml
vendored
21
.github/workflows/ci.yml
vendored
@ -22,6 +22,27 @@ on:
|
|||||||
- 'main'
|
- 'main'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
unit_tests:
|
||||||
|
name: "Unit tests"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Go
|
||||||
|
uses: actions/setup-go@v4
|
||||||
|
with:
|
||||||
|
go-version: ^1.22
|
||||||
|
|
||||||
|
# When you execute your unit tests, make sure to use the "-coverprofile" flag to write a
|
||||||
|
# coverage profile to a file. You will need the name of the file (e.g. "coverage.txt")
|
||||||
|
# in the next step as well as the next job.
|
||||||
|
- name: Test
|
||||||
|
run: go test -cover -coverprofile=coverage.txt ./...
|
||||||
|
- uses: codecov/codecov-action@v4
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|
||||||
build_tests:
|
build_tests:
|
||||||
name: "Build & Test PR"
|
name: "Build & Test PR"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
Loading…
Reference in New Issue
Block a user