修改go.yml,添加执行测试的action
This commit is contained in:
parent
845ec9c5fe
commit
9a48cb03af
1 changed files with 26 additions and 9 deletions
35
.github/workflows/go.yml
vendored
35
.github/workflows/go.yml
vendored
|
@ -7,17 +7,34 @@ on:
|
||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
#编译
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
with:
|
with:
|
||||||
go-version: 1.17
|
go-version: 1.17
|
||||||
check-latest: true
|
check-latest: true
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: go build -v ./...
|
run: go build -v ./...
|
||||||
|
#执行测试
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up GO
|
||||||
|
uses: actions/setup-go@v2
|
||||||
|
with:
|
||||||
|
go-version: 1.17
|
||||||
|
check-latest: true
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: go test -run=Test .
|
||||||
|
|
||||||
|
- name: Benchmark
|
||||||
|
run: go test -bench=Benchmark -benchmem .
|
||||||
|
|
Reference in a new issue