Skip to content

Commit 38d9d55

Browse files
Check collectstatic (#2554)
* add a github action check to ensure collectstatic runs * install prod reqs * fallback to .python-version * explicitly set python-version-file --------- Co-authored-by: Jacob Coffee <[email protected]>
1 parent 68fa4c1 commit 38d9d55

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

Diff for: .github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
sudo dpkg -i pandoc-2.17.1.1-1-amd64.deb
3232
- uses: actions/setup-python@v5
3333
with:
34-
python-version: 3.12.6
34+
python-version-file: '.python-version'
3535
- name: Cache Python dependencies
3636
uses: actions/cache@v4
3737
env:

Diff for: .github/workflows/static.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Check collectstatic
2+
on: [push, pull_request]
3+
jobs:
4+
test:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- name: Check out repository
8+
uses: actions/checkout@v4
9+
- uses: actions/setup-python@v5
10+
with:
11+
python-version-file: '.python-version'
12+
- name: Cache Python dependencies
13+
uses: actions/cache@v4
14+
env:
15+
cache-name: pythondotorg-cache-pip
16+
with:
17+
path: ~/.cache/pip
18+
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('requirements.txt', '*-requirements.txt') }}
19+
restore-keys: |
20+
${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-
21+
${{ runner.os }}-${{ github.job }}-
22+
${{ runner.os }}-
23+
- name: Install Python dependencies
24+
run: |
25+
pip install -U pip setuptools wheel
26+
pip install -r requirements.txt -r prod-requirements.txt
27+
- name: Run Tests
28+
run: |
29+
DJANGO_SETTINGS_MODULE=pydotorg.settings.static python manage.py collectstatic --noinput

0 commit comments

Comments
 (0)