Преглед изворни кода

chore(ci): Collect static files before running tests

Copy frontend-generated files into STATIC_ROOT before tests run so SVG
rendering tests can read their CSS directly.
Also add pull-requests read permission to the workflow.

Fixes #22150
Martin Hauser пре 1 недеља
родитељ
комит
3e4ad4a5da
1 измењених фајлова са 6 додато и 0 уклоњено
  1. 6 0
      .github/workflows/ci.yml

+ 6 - 0
.github/workflows/ci.yml

@@ -20,6 +20,7 @@ on:
 
 
 permissions:
 permissions:
   contents: read
   contents: read
+  pull-requests: read
 
 
 # Add concurrency group to control job running
 # Add concurrency group to control job running
 concurrency:
 concurrency:
@@ -125,6 +126,11 @@ jobs:
       - name: Check for missing migrations
       - name: Check for missing migrations
         run: python netbox/manage.py makemigrations --check
         run: python netbox/manage.py makemigrations --check
 
 
+      # Copy frontend-generated files into STATIC_ROOT before SVG rendering
+      # tests read their CSS directly.
+      - name: Collect static files
+        run: python netbox/manage.py collectstatic --no-input
+
       - name: Run tests
       - name: Run tests
         if: ${{ ! matrix.coverage }}
         if: ${{ ! matrix.coverage }}
         run: python netbox/manage.py test netbox/ --parallel
         run: python netbox/manage.py test netbox/ --parallel