traefik/.github/workflows/validate.yaml

85 lines
1.8 KiB
YAML
Raw Normal View History

2021-07-23 09:00:07 +00:00
name: Validate
on:
pull_request:
branches:
- '*'
env:
2024-08-28 13:00:06 +00:00
GO_VERSION: '1.23'
2024-10-04 07:38:04 +00:00
GOLANGCI_LINT_VERSION: v1.61.0
2024-09-13 09:40:04 +00:00
MISSPELL_VERSION: v0.6.0
2021-07-23 09:00:07 +00:00
jobs:
2024-10-23 15:06:04 +00:00
lint:
runs-on: ubuntu-latest
2021-07-23 09:00:07 +00:00
steps:
- name: Check out code
uses: actions/checkout@v4
2021-07-23 09:00:07 +00:00
with:
fetch-depth: 0
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
2021-07-23 09:00:07 +00:00
with:
go-version: ${{ env.GO_VERSION }}
2021-07-23 09:00:07 +00:00
2024-10-23 15:06:04 +00:00
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: "${{ env.GOLANGCI_LINT_VERSION }}"
validate:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
2021-07-23 09:00:07 +00:00
2024-09-13 09:40:04 +00:00
- name: Install misspell ${{ env.MISSPELL_VERSION }}
run: curl -sfL https://raw.githubusercontent.com/golangci/misspell/master/install-misspell.sh | sh -s -- -b $(go env GOPATH)/bin ${MISSPELL_VERSION}
2021-07-23 09:00:07 +00:00
- name: Avoid generating webui
run: touch webui/static/index.html
2021-07-23 09:00:07 +00:00
- name: Validate
2024-10-23 15:06:04 +00:00
run: make validate-files
2021-07-23 09:00:07 +00:00
validate-generate:
runs-on: ubuntu-latest
2021-07-23 09:00:07 +00:00
steps:
- name: Check out code
uses: actions/checkout@v4
2021-07-23 09:00:07 +00:00
with:
fetch-depth: 0
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
2021-07-23 09:00:07 +00:00
with:
go-version: ${{ env.GO_VERSION }}
2021-07-23 09:00:07 +00:00
- name: go generate
run: |
2024-01-17 10:12:05 +00:00
make generate
2021-07-23 09:00:07 +00:00
git diff --exit-code
- name: go mod tidy
run: |
go mod tidy
git diff --exit-code
- name: make generate-crd
run: |
make generate-crd
git diff --exit-code