fixes #159
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: build & test | |
on: | |
push: | |
branches: main | |
paths: | |
- '**.go' | |
- .github/workflows/build-test.yml | |
- 'go.mod' | |
- 'go.sum' | |
pull_request: | |
paths: | |
- '**.go' | |
- 'go.mod' | |
- 'go.sum' | |
- .github/workflows/build-test.yml | |
jobs: | |
build-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: '1.19.x' | |
- name: build | |
shell: bash | |
run: | | |
export PATH=${PATH}:`go env GOPATH`/bin | |
make build | |
- name: test | |
shell: bash | |
run: | | |
export PATH=${PATH}:`go env GOPATH`/bin | |
make test | |
env: | |
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}} | |
- name: lint | |
shell: bash | |
run: | | |
export PATH=${PATH}:`go env GOPATH`/bin | |
go get golang.org/x/lint/golint | |
make lint | |
- name: staticcheck | |
shell: bash | |
run: | | |
export PATH=${PATH}:`go env GOPATH`/bin | |
go get honnef.co/go/tools/cmd/staticcheck@latest | |
make staticcheck | |
- name: vet | |
shell: bash | |
run: | | |
export PATH=${PATH}:`go env GOPATH`/bin | |
make vet | |
- name: fmt | |
shell: bash | |
run: | | |
export PATH=${PATH}:`go env GOPATH`/bin | |
make fmt | |
- name: make test coverage | |
shell: bash | |
run: | | |
export PATH=${PATH}:`go env GOPATH`/bin | |
make cover | |
env: | |
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}} | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
flags: unittests | |
files: ${{ github.workspace }}/coverage.txt | |
verbose: true |