Skip to content

Commit

Permalink
ci: add kubebuilder check and update doc.crds.dev update
Browse files Browse the repository at this point in the history
  • Loading branch information
azrod committed Oct 29, 2024
1 parent 9f6db5b commit c4d8d2d
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 12 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/go-generate.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Terraform Provider testing workflow.
name: go-generate

# This GitHub action runs your tests for each pull request and push.
Expand All @@ -9,6 +8,10 @@ on:
- 'docs/**'
- 'tools/**'

# Testing only needs permissions to read the repository contents.
permissions:
contents: read

jobs:
generate:
name: Generate
Expand Down
27 changes: 17 additions & 10 deletions .github/workflows/go-proxy.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
name: 'Force pkg.go.dev release sync'
name: 'Force update pkg.go.dev/doc.crds.dev release sync'

on:
release:
types: [published]
release:
types: [published]

jobs:
build:
name: Renew documentation
runs-on:
group: Default
steps:
- name: Pull new module version
uses: andrewslotin/go-proxy-pull-action@master
pkg-go-dev:
name: Renew documentation
runs-on:
group: Default
steps:
- name: Pull new module version
uses: andrewslotin/go-proxy-pull-action@master
doc-crds-dev:
name: Renew documentation
runs-on:
group: Default
steps:
- name: update doc.crds.dev
uses: azrod/doc-crds-dev-update-action@master
2 changes: 2 additions & 0 deletions .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Unit tests

on:
pull_request:
paths:
- '**.go'
workflow_dispatch:

permissions:
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/kubebuilder-generate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: kubebuidler-generate

# This GitHub action runs your tests for each pull request and push.
# Optionally, you can turn it on using a schedule for regular testing.
on:
pull_request:
paths:
- 'api/**'
- 'internal/controller/**'

# only needs permissions to read the repository contents.
permissions:
contents: read

jobs:
kubebuilder:
name: Kube Builder
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4 # v3.5.0
- uses: actions/setup-go@v5 # v4.0.0
with:
go-version-file: 'go.mod'
- run: make manifests
- run: make generate
- name: git diff
run: |
git diff --compact-summary --exit-code || \
(echo; echo "Unexpected difference in directories after code generation. Run 'make generate and make manifests' command and commit."; exit 1)
18 changes: 17 additions & 1 deletion .github/workflows/new-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,25 @@ jobs:
run: |
git diff --compact-summary --exit-code || \
(echo; echo "Unexpected difference in directories after code generation. Run 'go generate ./...' command and commit."; exit 1)
kubebuilder:
needs: [pre-check]
name: Kube Builder
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4 # v3.5.0
- uses: actions/setup-go@v5 # v4.0.0
with:
go-version-file: 'go.mod'
- run: make manifests
- run: make generate
- name: git diff
run: |
git diff --compact-summary --exit-code || \
(echo; echo "Unexpected difference in directories after code generation. Run 'make generate and make manifests' command and commit."; exit 1)
# * Step 2: Create a new tag
tag:
needs: [golangci-lint, pre-check, tag-already-exist, testsunit, generate]
needs: [golangci-lint, pre-check, tag-already-exist, testsunit, generate, kubebuilder]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down

0 comments on commit c4d8d2d

Please sign in to comment.