diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 99c0b26c..02869967 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,6 +37,31 @@ jobs: cd ${{ github.workspace }}/cyclops-ctrl make unit-test + validate-crd-updates: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Validate Module + working-directory: cyclops-ctrl + run: | + diff \ + <(yq 'select(.kind == "CustomResourceDefinition" and .metadata.name == "modules.cyclops-ui.com")' ../install/cyclops-install.yaml) \ + <(yq -N config/crd/bases/cyclops-ui.com_modules.yaml) + - name: Validate TemplateAuthRule + working-directory: cyclops-ctrl + run: | + diff \ + <(yq 'select(.kind == "CustomResourceDefinition" and .metadata.name == "templateauthrules.cyclops-ui.com")' ../install/cyclops-install.yaml) \ + <(yq -N config/crd/bases/cyclops-ui.com_templateauthrules.yaml) + - name: Validate TemplateStore + working-directory: cyclops-ctrl + run: | + diff \ + <(yq 'select(.kind == "CustomResourceDefinition" and .metadata.name == "templatestores.cyclops-ui.com")' ../install/cyclops-install.yaml) \ + <(yq -N config/crd/bases/cyclops-ui.com_templatestores.yaml) + build-UI: needs: - test-UI @@ -67,6 +92,7 @@ jobs: build-controller: needs: - test-controller + - validate-crd-updates runs-on: ubuntu-latest steps: - name: Set up QEMU diff --git a/.github/workflows/controller-test.yml b/.github/workflows/controller-test.yml index 57cb13f1..4b1d65e6 100644 --- a/.github/workflows/controller-test.yml +++ b/.github/workflows/controller-test.yml @@ -17,6 +17,31 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 - name: Unit tests + working-directory: cyclops-ctrl run: | - cd ${{ github.workspace }}/cyclops-ctrl make unit-test + + validate-crd-updates: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Validate Module + working-directory: cyclops-ctrl + run: | + diff \ + <(yq 'select(.kind == "CustomResourceDefinition" and .metadata.name == "modules.cyclops-ui.com")' ../install/cyclops-install.yaml) \ + <(yq -N config/crd/bases/cyclops-ui.com_modules.yaml) + - name: Validate TemplateAuthRule + working-directory: cyclops-ctrl + run: | + diff \ + <(yq 'select(.kind == "CustomResourceDefinition" and .metadata.name == "templateauthrules.cyclops-ui.com")' ../install/cyclops-install.yaml) \ + <(yq -N config/crd/bases/cyclops-ui.com_templateauthrules.yaml) + - name: Validate TemplateStore + working-directory: cyclops-ctrl + run: | + diff \ + <(yq 'select(.kind == "CustomResourceDefinition" and .metadata.name == "templatestores.cyclops-ui.com")' ../install/cyclops-install.yaml) \ + <(yq -N config/crd/bases/cyclops-ui.com_templatestores.yaml) \ No newline at end of file diff --git a/cyclops-ctrl/config/crd/bases/_.yaml b/cyclops-ctrl/config/crd/bases/_.yaml deleted file mode 100644 index 80a04045..00000000 --- a/cyclops-ctrl/config/crd/bases/_.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.11.3 - creationTimestamp: null -spec: - group: "" - names: - kind: "" - plural: "" - scope: "" - versions: null