From dc97c314f1fbb9ab9eb9234e0f9108cd652136d4 Mon Sep 17 00:00:00 2001 From: Christian Wolf Date: Sat, 16 Oct 2021 10:39:05 +0200 Subject: [PATCH 1/4] Made some descriptions more clear Signed-off-by: Christian Wolf --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2461e1b8e..8eca6579c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -174,7 +174,7 @@ jobs: server: ${{ matrix.httpServer }} coreVersion: ${{ matrix.coreVersion }} - - name: Upload the log file + - name: Upload the log file as artifact uses: actions/upload-artifact@v2 with: name: Nextcloud-logs (${{matrix.database}}, ${{matrix.coreVersion}}, ${{matrix.httpServer}}, ${{matrix.phpVersion}}) @@ -209,14 +209,14 @@ jobs: rsync -a .github/actions/run-tests/volumes/coverage/latest/ /tmp/coverage if: ${{ steps.run-tests.outputs.silentFail == 'false' }} - - name: Upload the code coverage report (unit tests) + - name: Upload the code coverage report (unit tests) as artifacts uses: actions/upload-artifact@v2 with: name: Code coverage (HTML) (${{matrix.database}}, ${{matrix.coreVersion}}, ${{matrix.httpServer}}, ${{matrix.phpVersion}}) path: "/tmp/coverage" if: ${{ steps.run-tests.outputs.silentFail == 'false' }} - - name: Upload the junit log file artifact + - name: Upload the junit log file artifact as artifact uses: actions/upload-artifact@v2 with: name: Junit test log files (${{matrix.database}}, ${{matrix.coreVersion}}, ${{matrix.httpServer}}, ${{matrix.phpVersion}}) From 7277f5678a7289296a65cf6abd9ca48c440eb82c Mon Sep 17 00:00:00 2001 From: Christian Wolf Date: Sat, 16 Oct 2021 10:30:22 +0200 Subject: [PATCH 2/4] Exported codecov upload into single step and switch to binary uploader Signed-off-by: Christian Wolf --- .github/workflows/tests.yml | 64 +++++++++++++++++++++++++++---------- 1 file changed, 48 insertions(+), 16 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8eca6579c..dc6af8e22 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -186,22 +186,6 @@ jobs: echo "Exiting with ${{ env.test_result }}" ; exit "${{ env.test_result }}" - - name: Upload the coverage reports to codecov.io - shell: bash - run: >- - bash <(curl -s https://codecov.io/bash) - -F unittests - -f .github/actions/run-tests/volumes/coverage/latest/coverage.unit.xml - -R . - -X gcov - && - bash <(curl -s https://codecov.io/bash) - -F integration - -f .github/actions/run-tests/volumes/coverage/latest/coverage.integration.xml - -R . - -X gcov - if: ${{ steps.run-tests.outputs.silentFail == 'false' }} - - name: Copy coverage-reports into non-link folder shell: bash run: >- @@ -224,6 +208,54 @@ jobs: if: always() + upload-codecov: + name: Upload artifacts to codecov.io + needs: + - unit-tests + runs-on: ubuntu-latest + + steps: + - name: Create folder structure + run: mkdir artifacts code + - name: Download artifacts + uses: actions/download-artifact@v2.0.10 + with: + path: artifacts + - name: Checkout of code base + uses: actions/checkout@v2 + with: + path: code + fetch-depth: 2 + + - name: Download the uploader + run: | + curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import + curl -Os https://uploader.codecov.io/latest/linux/codecov + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM + curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig + + gpgv codecov.SHA256SUM.sig codecov.SHA256SUM + shasum -a 256 -c codecov.SHA256SUM + + chmod +x codecov + + - name: Upload unit test codecov reports + run: >- + ./codecov + -F unittests + -f artifacts/Code coverage*/coverage.unit.xml + -R code + -X gcov + - name: Upload integration test codecov reports + run: >- + ./codecov + -F integration + -f artifacts/Code coverage*/coverage.integration.xml + -R code + -X gcov + + + source-package: name: Create source code artifacts needs: From 68c084d9a2a4b0da497b5bacc410aa26feb8ff73 Mon Sep 17 00:00:00 2001 From: Christian Wolf Date: Sat, 16 Oct 2021 12:06:21 +0200 Subject: [PATCH 3/4] Manually extract all coverages into folders for simpler upload Signed-off-by: Christian Wolf --- .github/workflows/tests.yml | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dc6af8e22..a74262479 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -216,7 +216,7 @@ jobs: steps: - name: Create folder structure - run: mkdir artifacts code + run: mkdir artifacts code unit-coverage integration-coverage - name: Download artifacts uses: actions/download-artifact@v2.0.10 with: @@ -239,20 +239,40 @@ jobs: chmod +x codecov + - name: Copy Coverage reports to separate folders + run: | + cd artifacts + + for i in Code* + do + if [ -f "$i/coverage.unit.xml" ]; then + mkdir -p "../unit-coverage/$i" + cp "$i/coverage.unit.xml" "../unit-coverage/$i/coverage.xml" + fi + if [ -f "$i/coverage.integration.xml" ]; then + mkdir -p "../integration-coverage/$i" + cp "$i/coverage.integration.xml" "../integration-coverage/$i/coverage.xml" + fi + done + - name: Show file structure + run: ls -lR unit-coverage integration-coverage + - name: Upload unit test codecov reports run: >- ./codecov -F unittests - -f artifacts/Code coverage*/coverage.unit.xml + -s unit-coverage -R code -X gcov + -v - name: Upload integration test codecov reports run: >- ./codecov -F integration - -f artifacts/Code coverage*/coverage.integration.xml + -s integration-coverage -R code -X gcov + -v From 968aaf96066d7ecee62ddb0f0f545a5dc6a52a47 Mon Sep 17 00:00:00 2001 From: Christian Wolf Date: Sat, 16 Oct 2021 14:32:12 +0200 Subject: [PATCH 4/4] Update Changelog Signed-off-by: Christian Wolf --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f39ebdf0..a612d64b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ [#807](https://github.com/nextcloud/cookbook/pull/807) @christianlupus - Correct unit testing for dependabot and forked branches [#811](https://github.com/nextcloud/cookbook/pull/811) @christianlupus +- Updated codecov parser to binary version (fix #810) + [#813](https://github.com/nextcloud/cookbook/pull/813) @christianlupus ## 0.9.4 - 2021-09-29