| 1 | name: build |
| 2 | on: [push, pull_request] |
| 3 | jobs: |
| 4 | test: |
| 5 | strategy: |
| 6 | matrix: |
| 7 | go-version: [1.11.x, 1.12.x, 1.13.x, 1.14.x] |
| 8 | platform: [ubuntu-latest, macos-latest, windows-latest] |
| 9 | runs-on: ${{ matrix.platform }} |
| 10 | env: |
| 11 | GO111MODULE: "on" |
| 12 | steps: |
| 13 | - name: Install Go |
| 14 | uses: actions/setup-go@v1 |
| 15 | with: |
| 16 | go-version: ${{ matrix.go-version }} |
| 17 | |
| 18 | - name: Checkout code |
| 19 | uses: actions/checkout@v1 |
| 20 | |
| 21 | - name: Download Go modules |
| 22 | run: go mod download |
| 23 | |
| 24 | - name: Build |
| 25 | run: go build -v ./... |
| 26 | |
| 27 | - name: Test |
| 28 | run: go test ./... |
| 29 | |
| 30 | - name: Coverage |
| 31 | env: |
| 32 | COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 33 | run: | |
| 34 | go test -race -covermode atomic -coverprofile=profile.cov ./... |
| 35 | GO111MODULE=off go get github.com/mattn/goveralls |
| 36 | $(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github |
| 37 | if: matrix.go-version == '1.14.x' && matrix.platform == 'ubuntu-latest' |