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:
2021-02-01 15:39:35 +00:00
parent 01ed05ecd9
commit fc6e66c7f5

View File

@@ -18,8 +18,16 @@ jobs:
# BROWSER: ${{ matrix.browser }}
steps:
- 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
if: steps.static-cache.outputs.cache-hit != 'true'
- run: node node_modules/gulp/bin/gulp build
if: steps.static-cache.outputs.cache-hit != 'true'
- name: Set up Python
uses: actions/setup-python@v2
with:
@@ -34,7 +42,8 @@ jobs:
python -m pip install --upgrade pip
pip install pycodestyle coveralls django_coverage_plugin pytest-cov
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
run: |
pycodestyle . --exclude=migrations,node_modules