diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index e15b4c9563..1a41edfd32 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -81,7 +81,7 @@ jobs: cache: true cache-dependency-path: '${{ matrix.config.folder }}go.sum' - - name: Test ${{ matrix.config.name }} + - name: Unit Test ${{ matrix.config.name }} working-directory: ./${{ matrix.config.folder }} run: make test @@ -90,6 +90,7 @@ jobs: with: flags: ${{ matrix.config.name }} + build_image: name: Build Docker Image needs: prepare_ci_run @@ -115,7 +116,7 @@ jobs: - name: Set up Docker Buildx id: buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v2 - name: Build Docker Image uses: docker/build-push-action@v3 @@ -136,7 +137,7 @@ jobs: cache-from: type=gha, scope=${{ github.workflow }} cache-to: type=gha, scope=${{ github.workflow }} outputs: type=docker,dest=/tmp/${{ matrix.config.name }}-image.tar - + - name: Upload image as artifact uses: actions/upload-artifact@v3 with: @@ -167,6 +168,7 @@ jobs: needs: prepare_ci_run uses: ./.github/workflows/component-test.yml + integration_tests: name: Integration Tests needs: [ prepare_ci_run, build_image ] @@ -211,7 +213,7 @@ jobs: - name: Set up Docker Buildx id: buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v2 - name: Build Docker Image uses: docker/build-push-action@v3 diff --git a/.github/workflows/component-test.yml b/.github/workflows/component-test.yml index 809c0e3b6c..71010a5dd1 100644 --- a/.github/workflows/component-test.yml +++ b/.github/workflows/component-test.yml @@ -24,3 +24,8 @@ jobs: - name: Execute Component Tests working-directory: operator run: make component-test + + - name: Report code coverage + uses: codecov/codecov-action@v3 + with: + flags: component-tests diff --git a/codecov.yml b/codecov.yml index c349730b9e..ef0d48ff17 100644 --- a/codecov.yml +++ b/codecov.yml @@ -32,3 +32,7 @@ flags: paths: - scheduler/ carryforward: true + component-tests: + paths: + - operator/ + carryforward: true diff --git a/operator/Makefile b/operator/Makefile index 15fa05b7ce..1af69c29bd 100644 --- a/operator/Makefile +++ b/operator/Makefile @@ -91,7 +91,7 @@ test: manifests fmt vet generate envtest ## Run tests. .PHONY: component-test component-test: manifests generate envtest ## Run tests. - KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./test/component/... -v -timeout 30m + KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./test/component/... -v -timeout 30m -coverprofile cover.out -coverpkg "github.com/keptn/lifecycle-toolkit/operator/controllers/..." .PHONY: performance-test performance-test: manifests generate envtest ## Run tests.