build.yml 643 字节
Newer Older
Y
Yujun Zhang 已提交
1
name: build
2 3 4 5 6 7 8 9 10 11 12 13
on:
  pull_request:
    branches:
      - master
jobs:

  build:
    name: Build
    runs-on: ubuntu-latest
    steps:

    - name: Set up Go 1.13
L
liyong 已提交
14
      uses: actions/setup-go@v2
15 16 17 18 19
      with:
        go-version: 1.13
      id: go

    - name: Check out code into the Go module directory
L
liyong 已提交
20
      uses: actions/checkout@v2
21

Y
Yujun Zhang 已提交
22
    - name: Enable cache for go mod
L
liyong 已提交
23
      uses: actions/cache@v2
Y
Yujun Zhang 已提交
24 25 26 27 28 29
      with:
        path: ~/go/pkg/mod
        key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
        restore-keys: |
          ${{ runner.os }}-go-

30 31 32 33 34
    - name: Build
      run: go build -v .

    - name: Test
      run: go test -v ./...