Skip to content

Merge pull request #8 from kyoh86/dependabot/github_actions/dot-githu… #24

Merge pull request #8 from kyoh86/dependabot/github_actions/dot-githu…

Merge pull request #8 from kyoh86/dependabot/github_actions/dot-githu… #24

Workflow file for this run

name: Test
on:
push:
branches: '*'
jobs:
vendor:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.18.x
- name: get dependencies
run: go get -v -t -d ./...
- name: vendoring
run: go mod vendor
- uses: actions/upload-artifact@v2
with:
name: repository
path: .
lint:
runs-on: ubuntu-latest
needs: vendor
steps:
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.46
test:
strategy:
matrix:
os:
- windows-latest
- ubuntu-latest
- macos-latest
runs-on: ${{ matrix.os }}
needs: vendor
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.18.x
- uses: actions/download-artifact@v4.1.7
with:
name: repository
path: .
- name: test race
run: go test -v -race ./...
cover:
runs-on: ubuntu-latest
needs: vendor
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.18.x
- uses: actions/download-artifact@v4.1.7
with:
name: repository
path: .
- name: take coverage
run: go test -coverprofile=coverage.txt -covermode=count ./...
- uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
files: coverage.txt