| 1 | on: |
| 2 | push: |
| 3 | branches: |
| 4 | - master |
| 5 | pull_request: |
| 6 | branches: |
| 7 | - master |
| 8 | |
| 9 | name: run tests |
| 10 | jobs: |
| 11 | lint: |
| 12 | runs-on: ubuntu-latest |
| 13 | steps: |
| 14 | - name: Install Go |
| 15 | uses: actions/setup-go@v2 |
| 16 | with: |
| 17 | go-version: 1.15.x |
| 18 | - name: Checkout code |
| 19 | uses: actions/checkout@v2 |
| 20 | - name: Run linters |
| 21 | uses: golangci/golangci-lint-action@v2 |
| 22 | with: |
| 23 | version: v1.29 |
| 24 | |
| 25 | test: |
| 26 | strategy: |
| 27 | matrix: |
| 28 | go-version: [1.15.x] |
| 29 | platform: [ubuntu-latest, macos-latest, windows-latest] |
| 30 | runs-on: ${{ matrix.platform }} |
| 31 | steps: |
| 32 | - name: Install Go |
| 33 | if: success() |
| 34 | uses: actions/setup-go@v2 |
| 35 | with: |
| 36 | go-version: ${{ matrix.go-version }} |
| 37 | - name: Checkout code |
| 38 | uses: actions/checkout@v2 |
| 39 | - name: Run tests |
| 40 | run: go test -v -covermode=count |
| 41 | |
| 42 | coverage: |
| 43 | runs-on: ubuntu-latest |
| 44 | steps: |
| 45 | - name: Install Go |
| 46 | if: success() |
| 47 | uses: actions/setup-go@v2 |
| 48 | with: |
| 49 | go-version: 1.15.x |
| 50 | - name: Checkout code |
| 51 | uses: actions/checkout@v2 |
| 52 | - name: Calc coverage |
| 53 | run: | |
| 54 | go test -v -covermode=count -coverprofile=coverage.out |
| 55 | - name: Convert coverage.out to coverage.lcov |
| 56 | uses: jandelgado/[email protected] |
| 57 | - name: Coveralls |
| 58 | uses: coverallsapp/[email protected] |
| 59 | with: |
| 60 | github-token: ${{ secrets.github_token }} |
| 61 | path-to-lcov: coverage.lcov |
| 62 |