BUG/MEDIUM: use Structured Backend API when Editing Backend #155
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: [push, pull_request] | |
| jobs: | |
| check: | |
| if: ${{ github.event_name == 'pull_request' }} | |
| name: HAProxy check commit message | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: 'go.mod' | |
| id: go | |
| - name: Install Task | |
| uses: go-task/setup-task@v1 | |
| with: | |
| version: 3.x | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: commit-policy | |
| run: task check-commit | |
| generate-files: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: 'go.mod' | |
| id: go | |
| - name: Install Task | |
| uses: go-task/setup-task@v1 | |
| with: | |
| version: 3.x | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: generating files | |
| run: task generate | |
| - name: changes | |
| run: test -z "$(git diff 2> /dev/null)" || exit "Files are not generated, issue \`task generate\` and commit the result" | |
| - name: untracked files | |
| run: test -z "$(git ls-files --others --exclude-standard 2> /dev/null)" || exit "File generation created untracked files, cannot proceed" | |
| generate-code: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: 'go.mod' | |
| id: go | |
| - name: Install Task | |
| uses: go-task/setup-task@v1 | |
| with: | |
| version: 3.x | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: generating code | |
| run: task controller-gen | |
| - name: changes | |
| run: test -z "$(git diff 2> /dev/null)" || exit "code generation is not run, issue \`task ci\` and commit the result" | |
| - name: untracked files | |
| run: test -z "$(git ls-files --others --exclude-standard 2> /dev/null)" || exit "Documentation created untracked files, cannot proceed" | |
| tidy: | |
| name: go mod tidy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: "go.mod" | |
| check-latest: true | |
| - name: tidy | |
| run: go mod tidy | |
| - name: changes | |
| run: test -z "$(git diff 2> /dev/null)" || exit "Go modules not tidied, issue \`go mod tidy\` and commit the result" | |
| gofumpt: | |
| name: gofumpt | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: 'go.mod' | |
| id: go | |
| - name: Install Task | |
| uses: go-task/setup-task@v1 | |
| with: | |
| version: 3.x | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: tidy | |
| run: task format | |
| - name: changes | |
| run: test -z "$(git diff 2> /dev/null)" || exit "Go code not formatted, issue \`make gofumpt\` and commit the result" | |
| lint: | |
| name: golangci-lint | |
| needs: ["generate-files","generate-code", "tidy"] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: 'go.mod' | |
| id: go | |
| - name: Install Task | |
| uses: go-task/setup-task@v1 | |
| with: | |
| version: 3.x | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Lint | |
| run: task lint | |
| build: | |
| name: build | |
| runs-on: ubuntu-latest | |
| needs: ["lint"] | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: 'go.mod' | |
| id: go | |
| - name: Install Task | |
| uses: go-task/setup-task@v1 | |
| with: | |
| version: 3.x | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: generating files | |
| run: task generate-gwapi | |
| - name: Get dependencies | |
| run: | | |
| go mod tidy | |
| - name: Build | |
| run: | | |
| go build -v ./cmd/controller/... |