From c9651ef2577cbbb2756362b9a9f7a5b182079e70 Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Fri, 18 Oct 2024 19:11:08 +0200 Subject: [PATCH 1/3] github/workflows: set the codecov token The codecov-action v4 requires a token. Signed-off-by: Jan Luebbe --- .github/workflows/reusable-unit-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/reusable-unit-tests.yml b/.github/workflows/reusable-unit-tests.yml index b232bf63e..d638c71a1 100644 --- a/.github/workflows/reusable-unit-tests.yml +++ b/.github/workflows/reusable-unit-tests.yml @@ -68,3 +68,5 @@ jobs: pip install rstcheck rstcheck --ignore-languages=bash --report-level=WARNING README.rst - uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} From 6784f20c67cd8117c30d22777c9566b348d70fac Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Fri, 18 Oct 2024 19:14:36 +0200 Subject: [PATCH 2/3] github/workflows: upload coverage directly after testing Also add a name to the step. Signed-off-by: Jan Luebbe --- .github/workflows/reusable-unit-tests.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/reusable-unit-tests.yml b/.github/workflows/reusable-unit-tests.yml index d638c71a1..e907182b4 100644 --- a/.github/workflows/reusable-unit-tests.yml +++ b/.github/workflows/reusable-unit-tests.yml @@ -56,6 +56,10 @@ jobs: - name: Test with pytest run: | pytest --cov-config .coveragerc --cov=labgrid --local-sshmanager --ssh-username runner -k "not test_docker_with_daemon" + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} - name: Build documentation run: | make -C doc clean @@ -67,6 +71,3 @@ jobs: # check README.rst separately pip install rstcheck rstcheck --ignore-languages=bash --report-level=WARNING README.rst - - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} From c9119f29a702d23e1b9370691d56b12467afa47a Mon Sep 17 00:00:00 2001 From: Jan Luebbe Date: Fri, 18 Oct 2024 19:43:56 +0200 Subject: [PATCH 3/3] github/workflows: pass CODECOV_TOKEN to reusable workflow Signed-off-by: Jan Luebbe --- .github/workflows/push-pr-unit-tests.yml | 2 ++ .github/workflows/reusable-unit-tests.yml | 3 +++ .github/workflows/scheduled-unit-tests.yml | 2 ++ 3 files changed, 7 insertions(+) diff --git a/.github/workflows/push-pr-unit-tests.yml b/.github/workflows/push-pr-unit-tests.yml index ca44774fa..4923ad254 100644 --- a/.github/workflows/push-pr-unit-tests.yml +++ b/.github/workflows/push-pr-unit-tests.yml @@ -10,6 +10,8 @@ jobs: matrix: python-version: ['3.9', '3.10', '3.11', '3.12'] uses: ./.github/workflows/reusable-unit-tests.yml + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: python-version: ${{ matrix.python-version }} push-pr-unit-tests-docker: diff --git a/.github/workflows/reusable-unit-tests.yml b/.github/workflows/reusable-unit-tests.yml index e907182b4..619a9c1e1 100644 --- a/.github/workflows/reusable-unit-tests.yml +++ b/.github/workflows/reusable-unit-tests.yml @@ -9,6 +9,9 @@ on: branch: type: string required: false + secrets: + CODECOV_TOKEN: + required: false jobs: build: diff --git a/.github/workflows/scheduled-unit-tests.yml b/.github/workflows/scheduled-unit-tests.yml index edd55096b..ea4524cbe 100644 --- a/.github/workflows/scheduled-unit-tests.yml +++ b/.github/workflows/scheduled-unit-tests.yml @@ -13,6 +13,8 @@ jobs: python-version: ['3.9', '3.10', '3.11', '3.12'] branch: ['master'] uses: ./.github/workflows/reusable-unit-tests.yml + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: python-version: ${{ matrix.python-version }} branch: ${{ matrix.branch }}