todo #171
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: Continuous Integration | |
on: | |
push: | |
branches: | |
- "**" | |
paths: | |
- "**.go" | |
- ".github/workflows/ci.yaml" | |
- "go.sum" | |
workflow_dispatch: | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ">=1.21" | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v5 | |
with: | |
version: latest | |
codegen: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ">=1.21" | |
- name: Install goimports | |
run: go install golang.org/x/tools/cmd/goimports@latest | |
- name: Install betteralign | |
run: go install github.com/dkorunic/betteralign/cmd/betteralign@latest | |
- name: Init workspace | |
run: go work init && go work use . ./codegen | |
- name: Code generation | |
run: UPDATE_SPECS=1 go generate | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ">=1.21" | |
- name: Run tests | |
run: GOEXPERIMENT=nocoverageredesign go test ./... -v -race -coverprofile cover.out -covermode atomic | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
with: | |
files: ./cover.out |