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 .