diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..8589c1129 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,16 @@ +# Generated by kubebuilder/operator-sdk (scaffolding) +PROJECT linguist-generated=true + +# Generated by controller-gen (make generate) +api/**/zz_generated.deepcopy.go linguist-generated=true + +# Generated by controller-gen (make manifests) +config/crd/bases/*.yaml linguist-generated=true +config/rbac/role.yaml linguist-generated=true +config/rbac/role_binding.yaml linguist-generated=true +config/webhook/manifests.yaml linguist-generated=true + +# Generated by operator-sdk (make bundle) +config/manifests/bases/splunk-operator.clusterserviceversion.yaml linguist-generated=true +bundle/manifests/*.yaml linguist-generated=true +bundle/metadata/annotations.yaml linguist-generated=true diff --git a/.github/workflows/build-test-push-workflow.yml b/.github/workflows/build-test-push-workflow.yml index e457272b8..55e9dcbbe 100644 --- a/.github/workflows/build-test-push-workflow.yml +++ b/.github/workflows/build-test-push-workflow.yml @@ -82,9 +82,28 @@ jobs: report_paths: 'unit_test*.xml' check_name: 'Unit Test Results' detailed_summary: true + check-generated: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Dotenv Action + id: dotenv + uses: falti/dotenv-action@v1 + - name: Setup Go + uses: actions/setup-go@v2 + with: + go-version: ${{ steps.dotenv.outputs.GO_VERSION }} + - name: Run code generation + run: make manifests generate + - name: Check for uncommitted changes + run: | + if ! git diff --exit-code; then + echo "::error::Generated files are out of date. Run 'make manifests generate' and commit the result." + exit 1 + fi build-operator-image: runs-on: ubuntu-latest - needs: [check-formating, unit-tests] + needs: [check-formating, unit-tests, check-generated] env: SPLUNK_ENTERPRISE_IMAGE: ${{ secrets.SPLUNK_ENTERPRISE_IMAGE }} SPLUNK_OPERATOR_IMAGE_NAME: splunk/splunk-operator