add github #1
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: CI | |
on: | |
push: | |
pull_request: | |
jobs: | |
check: | |
name: check | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v1 | |
- name: Setup Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: '>=1.18' | |
- name: Setup Go linter | |
run: go install golang.org/x/tools/cmd/goimports@latest && go install golang.org/x/lint/golint@latest | |
- name: Setup moq | |
run: go install github.com/matryer/moq@latest | |
- name: Run checks | |
run: make check | |
test: | |
name: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v1 | |
- name: Setup Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: '>=1.18' | |
- name: Setup moq | |
run: go install github.com/matryer/moq@latest | |
- name: Run tests | |
run: make test | |
- name: Upload coverage report | |
uses: codecov/[email protected] | |
with: | |
file: coverage.txt |