From 798689403d0f801cb2d5df9011978d14127a15af Mon Sep 17 00:00:00 2001 From: FreneticScribbler Date: Tue, 23 Feb 2021 13:58:03 +0000 Subject: [PATCH] Another go at CI caching --- .github/workflows/django.yml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index 43df100b..43ca3ab5 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -18,34 +18,35 @@ jobs: uses: actions/setup-python@v2 with: python-version: 3.9 - - name: Cache python deps + - uses: actions/cache@v2 id: pcache - uses: actions/cache@v2 with: - path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-${{ hashFiles('Pipfile.lock') }} + path: ~/.local/share/virtualenvs + key: ${{ runner.os }}-pipenv-${{ hashFiles('Pipfile.lock') }} + restore-keys: | + ${{ runner.os }}-pipenv- - name: Install Dependencies run: | python -m pip install --upgrade pip pip install pipenv pipenv install -d - - name: Basic Checks - run: | - pipenv run pycodestyle . --exclude=migrations,node_modules - pipenv run python manage.py check - pipenv run python manage.py makemigrations --check --dry-run + if: steps.pcache.outputs.cache-hit != 'true' - name: Cache Static Files id: static-cache uses: actions/cache@v2 with: - path: 'static/' + path: 'pipeline/built_assets' 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' - - run: pipenv run python manage.py collectstatic --noinput - if: steps.static-cache.outputs.cache-hit != 'true' + - name: Basic Checks + run: | + pipenv run pycodestyle . --exclude=migrations,node_modules + pipenv run python manage.py check + pipenv run python manage.py makemigrations --check --dry-run + pipenv run python manage.py collectstatic --noinput - name: Run Tests run: pipenv run pytest -n auto -vv --cov - uses: actions/upload-artifact@v2