From 9a48cb03aff82aeb559e262bd7af3773e1c9bb9a Mon Sep 17 00:00:00 2001 From: Hami Lemon Date: Sat, 5 Mar 2022 13:06:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9go.yml,=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E6=B5=8B=E8=AF=95=E7=9A=84action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/go.yml | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 57b5be3..099b80f 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,17 +7,34 @@ on: branches: [ master ] jobs: - + #编译 build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.17 - check-latest: true + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.17 + check-latest: true - - name: Build - run: go build -v ./... + - name: Build + 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 .