From de04b88381681b576295d0eb1000c7cdd80e8b7e Mon Sep 17 00:00:00 2001 From: Himanshu Mishra Date: Tue, 22 Sep 2020 14:43:41 +0200 Subject: [PATCH 1/3] Add codecov flags for core and core-api packages --- .codecov.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.codecov.yml b/.codecov.yml index bbe2ee8e93..148646abd7 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -6,3 +6,13 @@ coverage: default: threshold: 0% # Ref: https://docs.codecov.io/docs/codecovyml-reference#coveragestatus target: auto + +# Since Backstage is a mono repo, flags here help in getting the code coverage of individual packages. +# Documentation: https://docs.codecov.io/docs/flags +flags: + packages-core: + paths: + - packages/core/ + packages-core-api: + paths: + - packages/core-api/ From 53e171b8f7d1f873162fc42cfb131dadc4101302 Mon Sep 17 00:00:00 2001 From: Himanshu Mishra Date: Tue, 22 Sep 2020 14:55:54 +0200 Subject: [PATCH 2/3] Upload package specific code coverage to codecov We have declared the flags in .codecov.yml. From our master branch workflow we will upload specific coverage reports for these each individual flags. --- .github/workflows/master.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index f99c266241..a38301f913 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -63,6 +63,9 @@ jobs: run: | yarn lerna -- run test -- --coverage bash <(curl -s https://codecov.io/bash) + # Upload code coverage for some specific flags. Also see .codecov.yml + bash <(curl -s https://codecov.io/bash) -f packages/core/coverage/* -F packages-core + bash <(curl -s https://codecov.io/bash) -f packages/core-api/coverage/* -F packages-core-api # Publishes current version of packages that are not already present in the registry - name: publish From 03c483d7ce7aa547389a2211b04a9048b4ca672b Mon Sep 17 00:00:00 2001 From: Himanshu Mishra Date: Wed, 23 Sep 2020 10:02:45 +0200 Subject: [PATCH 3/3] Simplify codecov flag names --- .codecov.yml | 4 ++-- .github/workflows/master.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.codecov.yml b/.codecov.yml index 148646abd7..d03ad99836 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -10,9 +10,9 @@ coverage: # Since Backstage is a mono repo, flags here help in getting the code coverage of individual packages. # Documentation: https://docs.codecov.io/docs/flags flags: - packages-core: + core: paths: - packages/core/ - packages-core-api: + core-api: paths: - packages/core-api/ diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index a38301f913..bebca7c6f9 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -64,8 +64,8 @@ jobs: yarn lerna -- run test -- --coverage bash <(curl -s https://codecov.io/bash) # Upload code coverage for some specific flags. Also see .codecov.yml - bash <(curl -s https://codecov.io/bash) -f packages/core/coverage/* -F packages-core - bash <(curl -s https://codecov.io/bash) -f packages/core-api/coverage/* -F packages-core-api + bash <(curl -s https://codecov.io/bash) -f packages/core/coverage/* -F core + bash <(curl -s https://codecov.io/bash) -f packages/core-api/coverage/* -F core-api # Publishes current version of packages that are not already present in the registry - name: publish