add CI github action #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: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: Install golangci-lint | |
run: | | |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.61.0 | |
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | |
- name: Install gofumpt | |
run: go install mvdan.cc/[email protected] | |
- name: Install dependencies | |
run: make deps || exit 1 | |
- name: Lint | |
run: make lint || exit 1 | |
- name: Check format | |
run: make format || exit 1 | |
- name: Run tests | |
run: make test || exit 1 |