mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-26 18:02:18 +00:00
Cache static directory on CI, skip npm install and gulp build on hit
Should speed up CI runs a lot
This commit is contained in:
11
.github/workflows/django.yml
vendored
11
.github/workflows/django.yml
vendored
@@ -18,8 +18,16 @@ jobs:
|
|||||||
# BROWSER: ${{ matrix.browser }}
|
# BROWSER: ${{ matrix.browser }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
- name: Cache Static Files
|
||||||
|
id: static-cache
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: 'static/'
|
||||||
|
key: ${{ hashFiles('package-lock.json') }}-${{ hashFiles('pipeline/source_assets') }}
|
||||||
- uses: bahmutov/npm-install@v1
|
- uses: bahmutov/npm-install@v1
|
||||||
|
if: steps.static-cache.outputs.cache-hit != 'true'
|
||||||
- run: node node_modules/gulp/bin/gulp build
|
- run: node node_modules/gulp/bin/gulp build
|
||||||
|
if: steps.static-cache.outputs.cache-hit != 'true'
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
@@ -34,7 +42,8 @@ jobs:
|
|||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install pycodestyle coveralls django_coverage_plugin pytest-cov
|
pip install pycodestyle coveralls django_coverage_plugin pytest-cov
|
||||||
pip install --upgrade --upgrade-strategy eager -r requirements.txt
|
pip install --upgrade --upgrade-strategy eager -r requirements.txt
|
||||||
python manage.py collectstatic --noinput
|
- run: python manage.py collectstatic --noinput
|
||||||
|
if: steps.static-cache.outputs.cache-hit != 'true'
|
||||||
- name: Basic Checks
|
- name: Basic Checks
|
||||||
run: |
|
run: |
|
||||||
pycodestyle . --exclude=migrations,node_modules
|
pycodestyle . --exclude=migrations,node_modules
|
||||||
|
|||||||
Reference in New Issue
Block a user