From d0a6fc4b8e1d58a29c92322d57c571e4b1efba0b Mon Sep 17 00:00:00 2001 From: Pierre de La Morinerie Date: Tue, 26 Oct 2021 12:34:11 +0000 Subject: [PATCH] ci: precompile (and cache) assets This avoids the assets to be compiled lazily during the first spec, which confuses test metrics. --- .github/workflows/ci.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 468dad6dc..fe3ab76fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -90,5 +90,24 @@ jobs: run: | 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 run: ${{ matrix.pattern }}