save cache on failed tests

This commit is contained in:
Mikhail Epifanov 2024-01-13 16:44:18 +01:00
parent 362c0340fc
commit 17163b0dba
No known key found for this signature in database

View File

@ -42,7 +42,7 @@ jobs:
key: | key: |
${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.node-version }}-collectstatic-${{ hashFiles('**/*.css', '**/*.js', 'vue/src/*') }} ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.node-version }}-collectstatic-${{ hashFiles('**/*.css', '**/*.js', 'vue/src/*') }}
# Build Vue frontend # Build Vue frontend & Dependencies
- name: Set up Node ${{ matrix.node-version }} - name: Set up Node ${{ matrix.node-version }}
if: steps.django_cache.outputs.cache-hit != 'true' if: steps.django_cache.outputs.cache-hit != 'true'
uses: actions/setup-node@v3 uses: actions/setup-node@v3
@ -61,13 +61,22 @@ jobs:
working-directory: ./vue working-directory: ./vue
run: yarn build run: yarn build
# Build backend
- name: Compile Django StatisFiles - name: Compile Django StatisFiles
if: steps.django_cache.outputs.cache-hit != 'true' if: steps.django_cache.outputs.cache-hit != 'true'
run: | run: |
python3 manage.py collectstatic --noinput python3 manage.py collectstatic --noinput
python3 manage.py collectstatic_js_reverse python3 manage.py collectstatic_js_reverse
- uses: actions/cache/save@v3
if: steps.django_cache.outputs.cache-hit != 'true'
with:
path: |
./cookbook/static
./vue/webpack-stats.json
./staticfiles
key: |
${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.node-version }}-collectstatic-${{ hashFiles('**/*.css', '**/*.js', 'vue/src/*') }}
- name: Django Testing project - name: Django Testing project
run: pytest --junitxml=junit/test-results-${{ matrix.python-version }}.xml run: pytest --junitxml=junit/test-results-${{ matrix.python-version }}.xml