Let CI use parallel builds #847
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: Go lint | |
on: | |
push: | |
branches: | |
- main | |
- release-* | |
paths-ignore: | |
- 'docs/**' | |
- 'examples/**' | |
- '**.md' | |
- LICENSE | |
- '**.svg' | |
- '.github/workflows/docs.yml' | |
- '.github/workflows/mkdocs-set-default-version.yml' | |
- 'mkdocs.yml' | |
pull_request: | |
branches: | |
- main | |
- release-* | |
paths-ignore: | |
- 'docs/**' | |
- 'examples/**' | |
- '**.md' | |
- LICENSE | |
- README.md | |
- '**.svg' | |
- '.github/workflows/docs.yml' | |
- '.github/workflows/mkdocs-set-default-version.yml' | |
- 'mkdocs.yml' | |
- '*.md' | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Go caches | |
uses: actions/cache@v3 | |
with: | |
key: ${{ runner.os }}-lint-go-caches-${{ hashFiles('go.sum') }} | |
path: | | |
build/cache | |
~/go/pkg/mod | |
~/.cache/go-build | |
~/.cache/golangci-lint | |
- name: Check go.mod/go.sum to be consistent | |
run: make -j --always-make go.sum && git diff --exit-code | |
- name: Check generated code to be consistent | |
run: make -j codegen EMBEDDED_BINS_BUILDMODE=none && git diff --exit-code | |
- name: Run linter | |
env: | |
EMBEDDED_BINS_BUILDMODE: none | |
GOLANGCI_LINT_FLAGS: --out-format=github-actions | |
run: | | |
make -j lint | |
validate-os-tests: | |
name: Validate OS tests | |
runs-on: ubuntu-22.04 | |
env: | |
TERRAFORM_VERSION: 1.4.6 | |
defaults: | |
run: | |
working-directory: hack/ostests | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
sparse-checkout: hack/ostests | |
persist-credentials: false | |
- uses: hashicorp/setup-terraform@v2 | |
with: | |
terraform_version: ${{ env.TERRAFORM_VERSION }} | |
terraform_wrapper: false | |
- run: terraform fmt -check | |
- run: terraform init | |
- run: terraform validate -no-color |