Verify/markdown #2766
Workflow file for this run
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: lint-and-test | |
on: | |
pull_request_target: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
workflow_call: | |
permissions: | |
contents: read | |
pull-requests: read | |
jobs: | |
test: | |
name: Run tests | |
runs-on: large_runner | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- name: Cache go-build and mod | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cache/go-build/ | |
~/go/pkg/mod/ | |
key: go-${{ hashFiles('go.sum') }} | |
restore-keys: | | |
go- | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: '${{ github.workspace }}/go.mod' | |
- name: Test | |
run: | | |
PATH=$PATH:$(go env GOPATH)/bin make build install-requirements test | |
go-lint: | |
name: Lint Golang | |
runs-on: large_runner | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- name: Cache go-build and mod | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cache/go-build/ | |
~/go/pkg/mod/ | |
key: go-${{ hashFiles('go.sum') }} | |
restore-keys: | | |
go- | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: '${{ github.workspace }}/go.mod' | |
- name: Install goimports | |
run: | | |
go install golang.org/x/tools/cmd/goimports@latest | |
- name: Setup lint | |
run: | | |
make -f hack/Makefile golangci-lint | |
#curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.54.2 | |
- name: Lint | |
run: | | |
PATH=$PATH:$(go env GOPATH)/bin make check | |
generate: | |
name: DeepCopy verification | |
runs-on: large_runner | |
steps: | |
- name: Self Hosted Runner Post Job Cleanup Action | |
uses: TooMuch4U/actions-clean@v2.2 | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- name: Cache go-build and mod | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cache/go-build/ | |
~/go/pkg/mod/ | |
key: go-${{ hashFiles('go.sum') }} | |
restore-keys: | | |
go- | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: '${{ github.workspace }}/go.mod' | |
- name: Generate DeepCopy | |
run: | | |
PATH=$PATH:$(go env GOPATH)/bin make generate-deepcopy | |
- name: Check for diff | |
run: | | |
git diff --exit-code --shortstat | |