修改go.yml,添加执行测试的action

This commit is contained in:
Hami Lemon 2022-03-05 13:06:50 +08:00
parent 845ec9c5fe
commit 9a48cb03af

View file

@ -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 .