]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Chore: ensure codecov upload gets attempted (#9308)
authorshamoon <4887959+shamoon@users.noreply.github.com>
Fri, 7 Mar 2025 17:29:55 +0000 (09:29 -0800)
committerGitHub <noreply@github.com>
Fri, 7 Mar 2025 17:29:55 +0000 (09:29 -0800)
---------

Co-authored-by: Trenton H <797416+stumpylog@users.noreply.github.com>
.codecov.yml
.github/workflows/ci.yml

index 5fa8e16396626b76bf48f7139e2de68f1dd79479..d9a12a77316300dd5c7ff4def0571a98ae05d89b 100644 (file)
@@ -1,18 +1,18 @@
 codecov:
   require_ci_to_pass: true
-# https://docs.codecov.com/docs/flags#recommended-automatic-flag-management
-# Require each flag to have 1 upload before notification
-flag_management:
-  individual_flags:
-    - name: backend
+  # https://docs.codecov.com/docs/components
+component_management:
+  individual_components:
+    - component_id: backend
       paths:
-        - src/
-    - name: frontend
+        - src/**
+    - component_id: frontend
       paths:
-        - src-ui/
+        - src-ui/**
 # https://docs.codecov.com/docs/pull-request-comments
 # codecov will only comment if coverage changes
 comment:
+  layout: "header, diff, components, flags, files"
   require_changes: true
   # https://docs.codecov.com/docs/javascript-bundle-analysis
   require_bundle_changes: true
index c85961eaf67c1d8fb4f961c7640af233e0fbba57..d7a89f14c9a340b606f266e9d53499d68aaf6253 100644 (file)
@@ -162,16 +162,20 @@ jobs:
             --frozen \
             pytest
       -
-        name: Upload coverage
-        if: ${{ matrix.python-version == env.DEFAULT_PYTHON_VERSION }}
-        uses: actions/upload-artifact@v4
+        name: Upload backend test results to Codecov
+        if: always()
+        uses: codecov/test-results-action@v1
         with:
-          name: backend-coverage-report
-          path: |
-            coverage.xml
-            junit.xml
-          retention-days: 7
-          if-no-files-found: error
+          token: ${{ secrets.CODECOV_TOKEN }}
+          flags: python-${{ matrix.python-version }}
+          files: junit.xml
+      -
+        name: Upload backend coverage to Codecov
+        uses: codecov/codecov-action@v5
+        with:
+          token: ${{ secrets.CODECOV_TOKEN }}
+          flags: python-${{ matrix.python-version }}
+          files: coverage.xml
       -
         name: Stop containers
         if: always()
@@ -179,7 +183,7 @@ jobs:
           docker compose --file ${{ github.workspace }}/docker/compose/docker-compose.ci-test.yml logs
           docker compose --file ${{ github.workspace }}/docker/compose/docker-compose.ci-test.yml down
 
-  install-frontend-depedendencies:
+  install-frontend-dependencies:
     name: "Install Frontend Dependencies"
     runs-on: ubuntu-24.04
     needs:
@@ -214,7 +218,7 @@ jobs:
     name: "Frontend Tests (Node ${{ matrix.node-version }} - ${{ matrix.shard-index }}/${{ matrix.shard-count }})"
     runs-on: ubuntu-24.04
     needs:
-      - install-frontend-depedendencies
+      - install-frontend-dependencies
     strategy:
       fail-fast: false
       matrix:
@@ -245,111 +249,33 @@ jobs:
         run: cd src-ui && npm run lint
       -
         name: Run Jest unit tests
-        env:
-          JEST_JUNIT_OUTPUT_FILE: junit-report-${{ matrix.shard-index }}.xml
         run: cd src-ui && npm run test -- --max-workers=2 --shard=${{ matrix.shard-index }}/${{ matrix.shard-count }}
-      -
-        name: Upload Jest coverage
-        if: always()
-        uses: actions/upload-artifact@v4
-        with:
-          name: jest-coverage-report-${{ matrix.shard-index }}
-          path: |
-            src-ui/coverage/coverage-final.json
-            src-ui/coverage/lcov.info
-            src-ui/coverage/clover.xml
-          retention-days: 7
-          if-no-files-found: error
       -
         name: Run Playwright e2e tests
         run: cd src-ui && npx playwright test --shard ${{ matrix.shard-index }}/${{ matrix.shard-count }}
       -
-        name: Upload Playwright test results
+        name: Upload frontend test results to Codecov
+        uses: codecov/test-results-action@v1
         if: always()
-        uses: actions/upload-artifact@v4
         with:
-          name: playwright-report-${{ matrix.shard-index }}
-          path: src-ui/playwright-report
-          retention-days: 7
+          token: ${{ secrets.CODECOV_TOKEN }}
+          flags: node-${{ matrix.node-version }}
+          directory: src-ui/
       -
-        name: Upload frontend test results
-        if: always()
-        uses: actions/upload-artifact@v4
+        name: Upload frontend coverage to Codecov
+        uses: codecov/codecov-action@v5
         with:
-          name: junit-report-${{ matrix.shard-index }}
-          path: src-ui/junit-report-${{ matrix.shard-index }}.xml
-          retention-days: 7
+          token: ${{ secrets.CODECOV_TOKEN }}
+          flags: node-${{ matrix.node-version }}
+          directory: src-ui/coverage/
 
-  tests-coverage-upload:
-    name: "Upload to Codecov"
+  frontend-bundle-analysis:
+    name: "Frontend Bundle Analysis"
     runs-on: ubuntu-24.04
     needs:
-      - tests-backend
       - tests-frontend
     steps:
-      -
-        uses: actions/checkout@v4
-      -
-        name: Download frontend jest coverage
-        uses: actions/download-artifact@v4
-        with:
-          path: src-ui/coverage/
-          pattern: jest-coverage-report-*
-      -
-        name: Download frontend playwright coverage
-        uses: actions/download-artifact@v4
-        with:
-          path: src-ui/coverage/
-          pattern: playwright-report-*
-          merge-multiple: true
-      -
-        name: Download frontend test results
-        uses: actions/download-artifact@v4
-        with:
-          path: src-ui/junit/
-          pattern: junit-report-*
-          merge-multiple: true
-      -
-        name: Upload frontend coverage to Codecov
-        uses: codecov/codecov-action@v5
-        with:
-          # not required for public repos, but intermittently fails otherwise
-          token: ${{ secrets.CODECOV_TOKEN }}
-          flags: frontend
-          directory: src-ui/coverage/
-          # dont include backend coverage files here
-          files: '!coverage.xml'
-      -
-        name: Upload frontend test results to Codecov
-        if: ${{ !cancelled() }}
-        uses: codecov/test-results-action@v1
-        with:
-          token: ${{ secrets.CODECOV_TOKEN }}
-          flags: frontend
-          directory: src-ui/junit/
-      -
-        name: Download backend coverage
-        uses: actions/download-artifact@v4
-        with:
-          name: backend-coverage-report
-          path: src/
-      -
-        name: Upload coverage to Codecov
-        uses: codecov/codecov-action@v5
-        with:
-          # not required for public repos, but intermittently fails otherwise
-          token: ${{ secrets.CODECOV_TOKEN }}
-          # future expansion
-          flags: backend
-          directory: src/
-      -
-        name: Upload backend test results to Codecov
-        if: ${{ !cancelled() }}
-        uses: codecov/test-results-action@v1
-        with:
-          token: ${{ secrets.CODECOV_TOKEN }}
-          flags: backend
-          directory: src/
+      - uses: actions/checkout@v4
       -
         name: Use Node.js 20
         uses: actions/setup-node@v4