mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-17 10:13:56 -05:00
Move frontend testing to test step
This commit is contained in:
parent
8633f2fe45
commit
ff23f11e0d
150
.github/workflows/ci.yml
vendored
150
.github/workflows/ci.yml
vendored
@ -252,62 +252,7 @@ jobs:
|
|||||||
run: cd src-ui && npm run lint
|
run: cd src-ui && npm run lint
|
||||||
-
|
-
|
||||||
name: Run Jest unit tests
|
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 }}
|
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 reports
|
|
||||||
if: always()
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: playwright-report-${{ matrix.shard-index }}
|
|
||||||
path: src-ui/playwright-report
|
|
||||||
retention-days: 7
|
|
||||||
-
|
|
||||||
name: Upload frontend test results
|
|
||||||
if: always()
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: junit-report-${{ matrix.shard-index }}
|
|
||||||
path: src-ui/junit-report-${{ matrix.shard-index }}.xml
|
|
||||||
retention-days: 7
|
|
||||||
|
|
||||||
tests-data-upload:
|
|
||||||
name: "Upload tests data to Codecov"
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
if: >-
|
|
||||||
always() &&
|
|
||||||
(needs.tests-backend.result == 'failure' || needs.tests-backend.result == 'success') &&
|
|
||||||
(needs.tests-frontend.result == 'failure' || needs.tests-frontend.result == 'success')
|
|
||||||
needs:
|
|
||||||
- tests-backend
|
|
||||||
- tests-frontend
|
|
||||||
steps:
|
|
||||||
-
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
# Results
|
|
||||||
-
|
|
||||||
name: Download frontend test results
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
path: src-ui/junit/
|
|
||||||
pattern: junit-report-*
|
|
||||||
merge-multiple: true
|
|
||||||
-
|
-
|
||||||
name: Upload frontend test results to Codecov
|
name: Upload frontend test results to Codecov
|
||||||
uses: codecov/test-results-action@v1
|
uses: codecov/test-results-action@v1
|
||||||
@ -315,34 +260,6 @@ jobs:
|
|||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
flags: frontend
|
flags: frontend
|
||||||
directory: src-ui/junit/
|
directory: src-ui/junit/
|
||||||
-
|
|
||||||
name: Download backend test results
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
path: src/
|
|
||||||
pattern: backend-test-results-*
|
|
||||||
merge-multiple: true
|
|
||||||
-
|
|
||||||
name: Upload backend test results to Codecov
|
|
||||||
uses: codecov/test-results-action@v1
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
|
||||||
flags: backend
|
|
||||||
directory: src/
|
|
||||||
# Coverage
|
|
||||||
-
|
|
||||||
name: Download frontend jest coverage
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
path: src-ui/coverage/
|
|
||||||
pattern: jest-coverage-report-*
|
|
||||||
-
|
|
||||||
name: Download Playwright test reports
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
path: src-ui/coverage/
|
|
||||||
pattern: playwright-report-*
|
|
||||||
merge-multiple: true
|
|
||||||
-
|
-
|
||||||
name: Upload frontend coverage to Codecov
|
name: Upload frontend coverage to Codecov
|
||||||
uses: codecov/codecov-action@v5
|
uses: codecov/codecov-action@v5
|
||||||
@ -350,22 +267,17 @@ jobs:
|
|||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
flags: frontend
|
flags: frontend
|
||||||
directory: src-ui/coverage/
|
directory: src-ui/coverage/
|
||||||
# dont include backend coverage files here
|
|
||||||
files: '!coverage.xml'
|
|
||||||
-
|
-
|
||||||
name: Download backend coverage
|
name: Run Playwright e2e tests
|
||||||
uses: actions/download-artifact@v4
|
run: cd src-ui && npx playwright test --shard ${{ matrix.shard-index }}/${{ matrix.shard-count }}
|
||||||
with:
|
|
||||||
name: backend-coverage-report
|
frontend-bundle-analysis:
|
||||||
path: src/
|
name: "Frontend Bundle Analysis"
|
||||||
-
|
runs-on: ubuntu-24.04
|
||||||
name: Upload backend coverage to Codecov
|
needs:
|
||||||
uses: codecov/codecov-action@v5
|
- tests-frontend
|
||||||
with:
|
steps:
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
- uses: actions/checkout@v4
|
||||||
flags: backend
|
|
||||||
directory: src/
|
|
||||||
# Bundle analysis
|
|
||||||
-
|
-
|
||||||
name: Use Node.js 20
|
name: Use Node.js 20
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
@ -391,6 +303,48 @@ jobs:
|
|||||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||||
run: cd src-ui && ng build --configuration=production
|
run: cd src-ui && ng build --configuration=production
|
||||||
|
|
||||||
|
tests-data-upload:
|
||||||
|
name: "Upload tests data to Codecov"
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
if: >-
|
||||||
|
always() &&
|
||||||
|
(needs.tests-backend.result == 'failure' || needs.tests-backend.result == 'success') &&
|
||||||
|
(needs.tests-frontend.result == 'failure' || needs.tests-frontend.result == 'success')
|
||||||
|
needs:
|
||||||
|
- tests-backend
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
# Results
|
||||||
|
-
|
||||||
|
name: Download backend test results
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
path: src/
|
||||||
|
pattern: backend-test-results-*
|
||||||
|
merge-multiple: true
|
||||||
|
-
|
||||||
|
name: Upload backend test results to Codecov
|
||||||
|
uses: codecov/test-results-action@v1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
flags: backend
|
||||||
|
directory: src/
|
||||||
|
# Coverage
|
||||||
|
-
|
||||||
|
name: Download backend coverage
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: backend-coverage-report
|
||||||
|
path: src/
|
||||||
|
-
|
||||||
|
name: Upload backend coverage to Codecov
|
||||||
|
uses: codecov/codecov-action@v5
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
flags: backend
|
||||||
|
directory: src/
|
||||||
|
|
||||||
build-docker-image:
|
build-docker-image:
|
||||||
name: Build Docker image for ${{ github.ref_name }}
|
name: Build Docker image for ${{ github.ref_name }}
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
|
Loading…
x
Reference in New Issue
Block a user