ci: precompile (and cache) assets

This avoids the assets to be compiled lazily during the first spec,
which confuses test metrics.
This commit is contained in:
Pierre de La Morinerie 2021-10-26 12:34:11 +00:00
parent a01a619ec0
commit d0a6fc4b8e

View file

@ -90,5 +90,24 @@ jobs:
run: | run: |
cp config/env.example .env cp config/env.example .env
- name: Assets cache
uses: actions/cache@v2
with:
path: |
public/assets
public/packs-test
tmp/cache/webpacker
key: asset-cache-${{ runner.os }}-${{ github.ref }}-${{ github.sha }}
restore-keys: |
asset-cache-${{ runner.os }}-${{ github.ref }}-${{ github.sha }}
asset-cache-${{ runner.os }}-${{ github.ref }}-
asset-cache-${{ runner.os }}-
- name: Precompile assets
env:
RAILS_ENV: test
run: |
bin/rails assets:precompile --trace
- name: Run tests - name: Run tests
run: ${{ matrix.pattern }} run: ${{ matrix.pattern }}