diff --git a/.github/workflows/go-generate.yml b/.github/workflows/go-generate.yml index 0989251..49a83cc 100644 --- a/.github/workflows/go-generate.yml +++ b/.github/workflows/go-generate.yml @@ -1,4 +1,3 @@ -# Terraform Provider testing workflow. name: go-generate # This GitHub action runs your tests for each pull request and push. @@ -9,6 +8,10 @@ on: - 'docs/**' - 'tools/**' +# Testing only needs permissions to read the repository contents. +permissions: + contents: read + jobs: generate: name: Generate diff --git a/.github/workflows/go-proxy.yml b/.github/workflows/go-proxy.yml index ce4e2f0..a4782f6 100644 --- a/.github/workflows/go-proxy.yml +++ b/.github/workflows/go-proxy.yml @@ -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 diff --git a/.github/workflows/go-test.yml b/.github/workflows/go-test.yml index 14ffd0c..fe51cd8 100644 --- a/.github/workflows/go-test.yml +++ b/.github/workflows/go-test.yml @@ -2,6 +2,8 @@ name: Unit tests on: pull_request: + paths: + - '**.go' workflow_dispatch: permissions: diff --git a/.github/workflows/kubebuilder-generate.yaml b/.github/workflows/kubebuilder-generate.yaml new file mode 100644 index 0000000..e34967a --- /dev/null +++ b/.github/workflows/kubebuilder-generate.yaml @@ -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) diff --git a/.github/workflows/new-release.yaml b/.github/workflows/new-release.yaml index ab0ef71..5a14863 100644 --- a/.github/workflows/new-release.yaml +++ b/.github/workflows/new-release.yaml @@ -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