Cover just mal package in code coverage #55
Workflow file for this run
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
name: tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
test: | |
strategy: | |
matrix: | |
go-version: [1.x] | |
platform: [ubuntu-latest] | |
include: | |
# Upload coverage only on this combination. | |
- go-version: 1.x | |
platform: ubuntu-latest | |
upload-coverage: true | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Download go modules | |
run: go mod download | |
- name: Cache go modules | |
uses: actions/cache@v2 | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: ${{ runner.os }}-go- | |
- name: Mod verify | |
run: go mod verify | |
- name: Run gofmt | |
if: runner.os != 'Windows' | |
run: '[ -z $(gofmt -s -l .) ] || (gofmt -s -d . && exit 1)' | |
- name: Run go vet | |
run: go vet ./... | |
- name: Run golint | |
run: | | |
go install golang.org/x/lint/golint@latest | |
golint `go list ./... | grep -v /vendor/` | |
- name: Run go test | |
run: go test -v -race -covermode=atomic -coverprofile=coverage.out github.com/nstratos/go-myanimelist/mal/... | |
- name: Upload test coverage to Coveralls | |
if: ${{ matrix.upload-coverage }} | |
env: | |
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
go install github.com/mattn/goveralls@latest | |
goveralls -coverprofile=coverage.out -service=github |