[generator] Improve code quality #59
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- main | |
name: Testing | |
env: | |
GO111MODULE: on | |
permissions: | |
contents: read | |
jobs: | |
test: | |
name: "${{ matrix.platform }} - ${{ matrix.go-version }}" | |
permissions: | |
actions: write # for styfle/cancel-workflow-action to cancel/stop running workflows | |
contents: read # for actions/checkout to fetch code | |
strategy: | |
# currently only test on linux and latest go version, due to using live servers | |
matrix: | |
go-version: [1.21.x] | |
platform: [ubuntu-latest] | |
include: | |
# only update test coverage stats with the most recent go version on linux | |
- go-version: 1.21.x | |
platform: ubuntu-latest | |
update-coverage: true | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Cancel previous workflow | |
uses: styfle/cancel-workflow-action@0.9.1 | |
with: | |
access_token: ${{ github.token }} | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- uses: actions/checkout@v3 | |
- name: Test | |
env: | |
WARGAMING_API_ID: ${{ secrets.WARGAMING_API_ID }} | |
run: go test -v -race -coverprofile coverage.txt -covermode atomic ./... | |
- name: Upload coverage to Codecov | |
if: ${{ matrix.update-coverage }} | |
uses: codecov/codecov-action@v3.1.0 |