diff --git a/.github/workflows/conformance.yaml b/.github/workflows/conformance.yaml deleted file mode 100644 index 1d339702..00000000 --- a/.github/workflows/conformance.yaml +++ /dev/null @@ -1,82 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 -# Copyright 2023 Authors of Nimbus - -name: Conformance tests - -permissions: {} - -on: - pull_request: - branches: - - "main" - - "release*" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - - -jobs: - chainsaw-tests: - runs-on: ubuntu-latest - permissions: - packages: read - strategy: - fail-fast: false - steps: - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - # install tools - - name: Install helm - id: helm - uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - # install go - - - name: Install go - uses: actions/setup-go@v5 - with: - go-version: '1.21.7' # The Go version to download (if necessary) and use. - - - # install chainsaw - - - name: Install chainsaw - uses: kyverno/action-install-chainsaw@8307cf9038333ce168dd4339ae24f9ab16ab7a00 # v0.1.4 - - # create kind cluster - - - name: Create k8s Kind Cluster - uses: helm/kind-action@v1 - - # - name: Run Tests - # uses: BerniWittmann/background-server-action@v1 - # with: - # start: | - # make install - # make run & - # wait-on: 'http://localhost:8081/readyz' - # wait-on-timeout: 200s - # command: sleep 1 - - - name: start server - run: | - make install - make run & - - - - name: Wait for server to start - run: | - until $(wget http://localhost:8081/readyz); do - echo 'Waiting for the server to start...' - sleep 5 - done - - - name: Run Tests - run: | - sleep 10 - chainsaw test --test-dir=tests/controllers/ --config tests/chainsaw-config.yaml - diff --git a/.github/workflows/pr-checks.yaml b/.github/workflows/pr-checks.yaml index 61e29831..a68a27f1 100644 --- a/.github/workflows/pr-checks.yaml +++ b/.github/workflows/pr-checks.yaml @@ -97,3 +97,53 @@ jobs: - name: Build image working-directory: ./pkg/adapter/${{ matrix.adapters }} run: make docker-build + + + chainsaw-tests: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + # install tools + - name: Install helm + id: helm + uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + # install go + + - name: Install go + uses: actions/setup-go@v5 + with: + go-version: '1.21.7' # The Go version to download (if necessary) and use. + + + # install chainsaw + + - name: Install chainsaw + uses: kyverno/action-install-chainsaw@8307cf9038333ce168dd4339ae24f9ab16ab7a00 # v0.1.4 + + # create kind cluster + + - name: Create k8s Kind Cluster + uses: helm/kind-action@v1 + + + - name: start server + run: | + make install + make run & + + + - name: Wait for server to start + run: | + until $(wget http://localhost:8081/readyz); do + echo 'Waiting for the server to start...' + sleep 5 + done + + - name: Run Tests + run: | + chainsaw test --test-dir=tests/controllers/ --config tests/chainsaw-config.yaml \ No newline at end of file diff --git a/Makefile b/Makefile index 2155a8e6..0863b75c 100644 --- a/Makefile +++ b/Makefile @@ -183,7 +183,3 @@ envtest: $(ENVTEST) ## Download envtest-setup locally if necessary. $(ENVTEST): $(LOCALBIN) test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest -.PHONY: deploy-ci -deploy-ci: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config. - cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}:Never - $(KUSTOMIZE) build config/default | $(KUBECTL) apply -f -