From 8d9fdc3b41d37a1c88a2755cb2dbcd761a116cd2 Mon Sep 17 00:00:00 2001 From: Florian Duros Date: Fri, 3 Mar 2023 10:38:04 +0100 Subject: [PATCH] Use cache for jest (#10124) --- .github/workflows/tests.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 55fb131d97..545c733a5c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,6 +39,12 @@ jobs: env: JS_SDK_GITHUB_BASE_REF: ${{ inputs.matrix-js-sdk-sha }} + - name: Jest Cache + uses: actions/cache@v3 + with: + path: /tmp/jest_cache + key: ${{ hashFiles('**/yarn.lock') }} + - name: Get number of CPU cores id: cpu-cores uses: SimenB/github-actions-cpu-cores@v1 @@ -54,7 +60,8 @@ jobs: yarn ${{ inputs.disable_coverage != 'true' && 'coverage' || 'test' }} \ --ci \ --reporters github-actions ${{ steps.metrics.outputs.extra-reporter }} \ - --max-workers ${{ steps.cpu-cores.outputs.count }} + --max-workers ${{ steps.cpu-cores.outputs.count }} \ + --cacheDirectory /tmp/jest_cache - name: Upload Artifact if: inputs.disable_coverage != 'true'