From 0fbffc77c4884b6ccf10b160429079e9b58c2100 Mon Sep 17 00:00:00 2001 From: "Felix Exner (fexner)" Date: Thu, 22 Feb 2024 12:52:24 +0100 Subject: [PATCH 1/9] Add token instructions to codecov-action Since 4v this is required. For this to work, adding a `CODECOV_TOKEN` action secret needs to be added to the GH repository. --- .github/workflows/reusable-build-coverage.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/reusable-build-coverage.yml b/.github/workflows/reusable-build-coverage.yml index 9af9401..86df0fd 100644 --- a/.github/workflows/reusable-build-coverage.yml +++ b/.github/workflows/reusable-build-coverage.yml @@ -53,6 +53,7 @@ jobs: file: ros_ws/lcov/total_coverage.info flags: unittests name: codecov-umbrella + token: ${{ secrets.CODECOV_TOKEN }} - uses: actions/upload-artifact@v4.3.1 with: name: colcon-logs-coverage-${{ inputs.ros_distro }} From a0fa19c0163b671be1be4d883bd2e36a6f0cfd81 Mon Sep 17 00:00:00 2001 From: Felix Exner Date: Thu, 22 Feb 2024 19:26:48 +0000 Subject: [PATCH 2/9] Add secret input This seems required for reusable workflows --- .github/workflows/reusable-build-coverage.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/reusable-build-coverage.yml b/.github/workflows/reusable-build-coverage.yml index 86df0fd..9592ed7 100644 --- a/.github/workflows/reusable-build-coverage.yml +++ b/.github/workflows/reusable-build-coverage.yml @@ -11,6 +11,9 @@ on: required: false default: 'ubuntu-latest' type: string + secrets: + CODECOV_TOKEN: + required: true env: # this will be src/{repo-owner}/{repo-name} From 3d339c6200ad23874dccf8401e9718238c25d105 Mon Sep 17 00:00:00 2001 From: Felix Exner Date: Thu, 22 Feb 2024 20:21:57 +0000 Subject: [PATCH 3/9] Add root-dir --- .github/workflows/reusable-build-coverage.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/reusable-build-coverage.yml b/.github/workflows/reusable-build-coverage.yml index 9592ed7..6a7d3cd 100644 --- a/.github/workflows/reusable-build-coverage.yml +++ b/.github/workflows/reusable-build-coverage.yml @@ -57,6 +57,8 @@ jobs: flags: unittests name: codecov-umbrella token: ${{ secrets.CODECOV_TOKEN }} + root_dir: ${{ env.path }} + - uses: actions/upload-artifact@v4.3.1 with: name: colcon-logs-coverage-${{ inputs.ros_distro }} From 8549487c03aabb81b2bb8091a4507e5239497633 Mon Sep 17 00:00:00 2001 From: Felix Exner Date: Thu, 22 Feb 2024 21:03:31 +0000 Subject: [PATCH 4/9] Use working directory --- .github/workflows/reusable-build-coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-build-coverage.yml b/.github/workflows/reusable-build-coverage.yml index 6a7d3cd..5dd215a 100644 --- a/.github/workflows/reusable-build-coverage.yml +++ b/.github/workflows/reusable-build-coverage.yml @@ -57,7 +57,7 @@ jobs: flags: unittests name: codecov-umbrella token: ${{ secrets.CODECOV_TOKEN }} - root_dir: ${{ env.path }} + working-directory: ${{ env.path }} - uses: actions/upload-artifact@v4.3.1 with: From ef24908e67b15dbab8bb7d8505ddb0dfd834f1b6 Mon Sep 17 00:00:00 2001 From: Felix Exner Date: Thu, 22 Feb 2024 21:22:30 +0000 Subject: [PATCH 5/9] Add workaround for failing codecov action --- .github/workflows/reusable-build-coverage.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/reusable-build-coverage.yml b/.github/workflows/reusable-build-coverage.yml index 5dd215a..4885f2b 100644 --- a/.github/workflows/reusable-build-coverage.yml +++ b/.github/workflows/reusable-build-coverage.yml @@ -50,6 +50,9 @@ jobs: } } colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml + - name: Workaround for codecov/feedback#263 + run: | + git config --global --add safe.directory "$GITHUB_WORKSPACE" - uses: codecov/codecov-action@v4.0.1 with: fail_ci_if_error: true From 8018462be2102a6f6c7b5152fd8395fc8b2b85cd Mon Sep 17 00:00:00 2001 From: Felix Exner Date: Thu, 22 Feb 2024 21:22:49 +0000 Subject: [PATCH 6/9] Add verbose: true to codecov-action --- .github/workflows/reusable-build-coverage.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/reusable-build-coverage.yml b/.github/workflows/reusable-build-coverage.yml index 4885f2b..77950aa 100644 --- a/.github/workflows/reusable-build-coverage.yml +++ b/.github/workflows/reusable-build-coverage.yml @@ -61,6 +61,7 @@ jobs: name: codecov-umbrella token: ${{ secrets.CODECOV_TOKEN }} working-directory: ${{ env.path }} + verbose: true - uses: actions/upload-artifact@v4.3.1 with: From 867b106643edda696509892e62386db765a9c15a Mon Sep 17 00:00:00 2001 From: Felix Exner Date: Fri, 23 Feb 2024 19:58:20 +0000 Subject: [PATCH 7/9] Use generic v4 to always use the latest one --- .github/workflows/reusable-build-coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reusable-build-coverage.yml b/.github/workflows/reusable-build-coverage.yml index 77950aa..8c61170 100644 --- a/.github/workflows/reusable-build-coverage.yml +++ b/.github/workflows/reusable-build-coverage.yml @@ -53,7 +53,7 @@ jobs: - name: Workaround for codecov/feedback#263 run: | git config --global --add safe.directory "$GITHUB_WORKSPACE" - - uses: codecov/codecov-action@v4.0.1 + - uses: codecov/codecov-action@v4 with: fail_ci_if_error: true file: ros_ws/lcov/total_coverage.info From 63c72b46340274e5767f030ed604776aa7410310 Mon Sep 17 00:00:00 2001 From: Felix Exner Date: Thu, 29 Feb 2024 11:53:13 +0000 Subject: [PATCH 8/9] Do not require CODECOV_TOKEN as input secret If we can simply use `inherit: true` in the calling workflow that would be nice. --- .github/workflows/reusable-build-coverage.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/reusable-build-coverage.yml b/.github/workflows/reusable-build-coverage.yml index 5c266a7..b3ea6fc 100644 --- a/.github/workflows/reusable-build-coverage.yml +++ b/.github/workflows/reusable-build-coverage.yml @@ -11,9 +11,6 @@ on: required: false default: 'ubuntu-latest' type: string - secrets: - CODECOV_TOKEN: - required: true jobs: coverage: From 0290dbbc6d6f26fbee626fded99e787f93470dfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Fr=C3=B6hlich?= Date: Fri, 1 Mar 2024 08:27:50 +0100 Subject: [PATCH 9/9] Remove verbose option Co-authored-by: Felix Exner (fexner) --- .github/workflows/reusable-build-coverage.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/reusable-build-coverage.yml b/.github/workflows/reusable-build-coverage.yml index b3ea6fc..7995296 100644 --- a/.github/workflows/reusable-build-coverage.yml +++ b/.github/workflows/reusable-build-coverage.yml @@ -46,8 +46,6 @@ jobs: flags: unittests name: codecov-umbrella token: ${{ secrets.CODECOV_TOKEN }} - verbose: true - - uses: actions/upload-artifact@v4.3.1 with: name: colcon-logs-coverage-${{ inputs.ros_distro }}