mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-09-16 21:55:37 -05:00
Try with a little more complexity
This commit is contained in:
70
.github/workflows/ci.yml
vendored
70
.github/workflows/ci.yml
vendored
@@ -151,10 +151,15 @@ jobs:
|
|||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
flags: backend-python-${{ matrix.python-version }}
|
flags: backend-python-${{ matrix.python-version }}
|
||||||
files: coverage.xml
|
files: coverage.xml
|
||||||
- name: SonarQube Scan
|
- name: Upload coverage artifacts
|
||||||
uses: SonarSource/sonarqube-scan-action@v5
|
uses: actions/upload-artifact@v4
|
||||||
env:
|
if: always()
|
||||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
with:
|
||||||
|
name: backend-coverage-${{ matrix.python-version }}
|
||||||
|
path: |
|
||||||
|
.coverage
|
||||||
|
coverage.xml
|
||||||
|
retention-days: 1
|
||||||
- name: Stop containers
|
- name: Stop containers
|
||||||
if: always()
|
if: always()
|
||||||
run: |
|
run: |
|
||||||
@@ -237,10 +242,13 @@ jobs:
|
|||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
flags: frontend-node-${{ matrix.node-version }}
|
flags: frontend-node-${{ matrix.node-version }}
|
||||||
directory: src-ui/coverage/
|
directory: src-ui/coverage/
|
||||||
- name: SonarQube Scan
|
- name: Upload coverage artifacts
|
||||||
uses: SonarSource/sonarqube-scan-action@v5
|
uses: actions/upload-artifact@v4
|
||||||
env:
|
if: always()
|
||||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
with:
|
||||||
|
name: frontend-coverage-${{ matrix.shard-index }}
|
||||||
|
path: src-ui/coverage/coverage-final.json
|
||||||
|
retention-days: 1
|
||||||
tests-frontend-e2e:
|
tests-frontend-e2e:
|
||||||
name: "Frontend E2E Tests (Node ${{ matrix.node-version }} - ${{ matrix.shard-index }}/${{ matrix.shard-count }})"
|
name: "Frontend E2E Tests (Node ${{ matrix.node-version }} - ${{ matrix.shard-index }}/${{ matrix.shard-count }})"
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
@@ -321,6 +329,52 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||||
run: cd src-ui && pnpm run build --configuration=production
|
run: cd src-ui && pnpm run build --configuration=production
|
||||||
|
sonarqube-analysis:
|
||||||
|
name: "SonarQube Analysis"
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
needs:
|
||||||
|
- tests-backend
|
||||||
|
- tests-frontend
|
||||||
|
if: github.repository_owner == 'paperless-ngx'
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Download all backend coverage
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
pattern: backend-coverage-*
|
||||||
|
path: ./coverage/
|
||||||
|
- name: Download all frontend coverage
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
pattern: frontend-coverage-*
|
||||||
|
path: ./coverage/
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
|
||||||
|
- name: Install coverage tools
|
||||||
|
run: |
|
||||||
|
pip install coverage
|
||||||
|
npm install -g nyc
|
||||||
|
# Merge backend coverage from all Python versions
|
||||||
|
- name: Merge backend coverage
|
||||||
|
run: |
|
||||||
|
coverage combine coverage/backend-coverage-*/.coverage
|
||||||
|
coverage xml -o merged-backend-coverage.xml
|
||||||
|
# Merge frontend coverage from all shards
|
||||||
|
- name: Merge frontend coverage
|
||||||
|
run: |
|
||||||
|
# Merge all coverage-final.json files
|
||||||
|
npx nyc merge coverage/frontend-coverage-*/ merged-frontend.json
|
||||||
|
# Generate LCOV from merged data
|
||||||
|
npx nyc report --reporter=lcov --temp-dir ./ --report-dir ./
|
||||||
|
- name: SonarQube Analysis
|
||||||
|
uses: SonarSource/sonarqube-scan-action@v5
|
||||||
|
env:
|
||||||
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
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
|
||||||
|
@@ -1,13 +1,25 @@
|
|||||||
sonar.projectKey=paperless-ngx_paperless-ngx
|
sonar.projectKey=paperless-ngx_paperless-ngx
|
||||||
sonar.organization=paperless-ngx
|
sonar.organization=paperless-ngx
|
||||||
|
sonar.projectName=Paperless-ngx
|
||||||
|
sonar.projectVersion=1.0
|
||||||
|
|
||||||
|
# Source and test directories
|
||||||
|
sonar.sources=src/,src-ui/src/
|
||||||
|
sonar.tests=src/,src-ui/src/
|
||||||
|
sonar.test.inclusions=**/test_*.py,**/tests.py,**/*.spec.ts,**/*.test.ts
|
||||||
|
|
||||||
# This is the name and version displayed in the SonarCloud UI.
|
# Language specific settings
|
||||||
sonar.projectName=paperless-ngx
|
sonar.python.version=3.10,3.11,3.12,3.13
|
||||||
#sonar.projectVersion=1.0
|
|
||||||
|
|
||||||
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
|
# Coverage reports
|
||||||
sonar.sources=.
|
sonar.python.coverage.reportPaths=merged-backend-coverage.xml
|
||||||
sonar.python.coverage.reportPaths=coverage.xml
|
sonar.javascript.lcov.reportPaths=lcov.info
|
||||||
sonar.python.version=3.10, 3.11, 3.12, 3.13
|
|
||||||
sonar.javascript.lcov.reportPaths=./coverage/lcov.info
|
# Test execution reports
|
||||||
|
sonar.junit.reportPaths=**/junit.xml,**/test-results.xml
|
||||||
|
|
||||||
|
# Encoding
|
||||||
|
sonar.sourceEncoding=UTF-8
|
||||||
|
|
||||||
|
# Exclusions
|
||||||
|
sonar.exclusions=**/migrations/**,**/node_modules/**,**/static/**,**/venv/**,**/.venv/**,**/dist/**
|
||||||
|
Reference in New Issue
Block a user