Pin actions by commit SHA #117
Workflow file for this run
This file contains hidden or 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] # yamllint disable-line rule:truthy | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull-request.number || github.ref }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
permissions: | |
contents: read | |
checks: write # Used to annotate code in the PR | |
jobs: | |
build: | |
name: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 | |
with: | |
go-version-file: "go.mod" | |
- name: build | |
run: | | |
go build -v ./... | |
linting: | |
needs: [build] | |
name: lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 | |
with: | |
go-version-file: "go.mod" | |
- name: gofmt | |
run: | | |
gofmt_out=$(gofmt -d $(find * -name '*.go' ! -path 'vendor/*' ! -path 'third_party/*')) | |
if [[ -n "$gofmt_out" ]]; then | |
failed=1 | |
fi | |
echo "$gofmt_out" | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0 | |
with: | |
version: v2.1.6 | |
only-new-issues: true | |
args: --timeout=10m | |
- name: yamllint | |
run: | | |
apt update && apt install -y yamllint | |
yamllint -c .yamllint $(find . -path ./vendor -prune -o -type f -regex ".*y[a]ml" -print | tr '\n' ' ') | |
- name: check-license | |
run: | | |
go install github.com/google/[email protected] | |
go-licenses check ./... | |
tests: | |
needs: [build] | |
name: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 | |
with: | |
go-version-file: "go.mod" | |
- name: build | |
run: | | |
make test-unit-verbose-and-race | |
generated: | |
needs: [build] | |
name: Check generated code | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 | |
with: | |
go-version-file: "go.mod" | |
- name: generated | |
run: | | |
go install github.com/google/[email protected] # Not sure why it is needed here | |
./hack/verify-codegen.sh | |
multi-arch-build: | |
needs: [build] | |
name: Multi-arch build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 | |
with: | |
go-version-file: "go.mod" | |
- name: make cross | |
run: | | |
make cross | |
e2e-tests: | |
needs: [build] | |
uses: ./.github/workflows/e2e-matrix.yml |