From 90172f6aa26dece103ca70ce54cf8de998ce1ff0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Tue, 21 Oct 2025 17:15:00 +0200 Subject: [PATCH 1/2] chore: add support for components in codecov --- codecov.yml | 156 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 156 insertions(+) create mode 100644 codecov.yml diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 000000000..09af99e88 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,156 @@ +component_management: + default_rules: # default rules that will be inherited by all components + statuses: + - type: project # in this case every component that doens't have a status defined will have a project type one + target: auto + branches: + - "!main" + individual_components: + - component_id: account + name: account + paths: + - internal/services/account/** + - component_id: applesilicon + name: applesilicon + paths: + - internal/services/applesilicon/** + - component_id: autoscaling + name: autoscaling + paths: + - internal/services/autoscaling/** + - component_id: az + name: az + paths: + - internal/services/az/** + - component_id: baremetal + name: baremetal + paths: + - internal/services/baremetal/** + - component_id: billing + name: billing + paths: + - internal/services/billing/** + - component_id: block + name: block + paths: + - internal/services/block/** + - component_id: cockpit + name: cockpit + paths: + - internal/services/cockpit/** + - component_id: container + name: container + paths: + - internal/services/container/** + - component_id: domain + name: domain + paths: + - internal/services/domain/** + - component_id: edgeservices + name: edgeservices + paths: + - internal/services/edgeservices/** + - component_id: file + name: file + paths: + - internal/services/file/** + - component_id: flexibleip + name: flexibleip + paths: + - internal/services/flexibleip/** + - component_id: function + name: function + paths: + - internal/services/function/** + - component_id: iam + name: iam + paths: + - internal/services/iam/** + - component_id: inference + name: inference + paths: + - internal/services/inference/** + - component_id: instance + name: instance + paths: + - internal/services/instance/** + - component_id: iot + name: iot + paths: + - internal/services/iot/** + - component_id: ipam + name: ipam + paths: + - internal/services/ipam/** + - component_id: jobs + name: jobs + paths: + - internal/services/jobs/** + - component_id: k8s + name: k8s + paths: + - internal/services/k8s/** + - component_id: keymanager + name: keymanager + paths: + - internal/services/keymanager/** + - component_id: lb + name: lb + paths: + - internal/services/lb/** + - component_id: marketplace + name: marketplace + paths: + - internal/services/marketplace/** + - component_id: mnq + name: mnq + paths: + - internal/services/mnq/** + - component_id: mongodb + name: mongodb + paths: + - internal/services/mongodb/** + - component_id: object + name: object + paths: + - internal/services/object/** + - component_id: rdb + name: rdb + paths: + - internal/services/rdb/** + - component_id: redis + name: redis + paths: + - internal/services/redis/** + - component_id: registry + name: registry + paths: + - internal/services/registry/** + - component_id: scwconfig + name: scwconfig + paths: + - internal/services/scwconfig/** + - component_id: sdb + name: sdb + paths: + - internal/services/sdb/** + - component_id: secret + name: secret + paths: + - internal/services/secret/** + - component_id: tem + name: tem + paths: + - internal/services/tem/** + - component_id: vpc + name: vpc + paths: + - internal/services/vpc/** + - component_id: vpcgw + name: vpcgw + paths: + - internal/services/vpcgw/** + - component_id: webhosting + name: webhosting + paths: + - internal/services/webhosting/** From b97400af70fb7a293d1c2acb9d02b18320ac27a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Wed, 22 Oct 2025 11:19:36 +0200 Subject: [PATCH 2/2] ci: add support for codecov components and add dedicated workflow --- codecov.yml => .github/codecov.yml | 0 .github/workflows/coverage.yml | 49 ++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) rename codecov.yml => .github/codecov.yml (100%) create mode 100644 .github/workflows/coverage.yml diff --git a/codecov.yml b/.github/codecov.yml similarity index 100% rename from codecov.yml rename to .github/codecov.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 000000000..03746b597 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,49 @@ +name: Code Coverage + +on: + pull_request: + merge_group: + push: + branches: + - main + - master + +permissions: + contents: read + +jobs: + coverage: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v5 + with: + fetch-depth: 1 + + - name: Install Go + uses: actions/setup-go@v6 + with: + go-version: stable + + - name: Install Terraform + uses: hashicorp/setup-terraform@v3 + + - name: Build binaries + run: make build + + - name: Verify go.mod is tidy + run: | + go mod tidy + git diff --exit-code + + - name: Run coverage + run: go tool gotestsum --format github-actions --junitfile junit.xml -- -coverprofile=coverage.out -covermode=count ./... + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v5 + + - name: Upload test results to Codecov + if: ${{ !cancelled() }} + uses: codecov/test-results-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }}