From e8b6345424b1ca81616513f8a9def1906d823f96 Mon Sep 17 00:00:00 2001 From: Mathieu Andrade Date: Mon, 25 Mar 2024 20:46:54 +0100 Subject: [PATCH] Update github actions to use turbo cache --- .github/actions/prepare-env/action.yml | 10 +++++++++- .github/workflows/tests.yml | 4 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/actions/prepare-env/action.yml b/.github/actions/prepare-env/action.yml index 2dd0839a..c341539e 100644 --- a/.github/actions/prepare-env/action.yml +++ b/.github/actions/prepare-env/action.yml @@ -41,12 +41,20 @@ runs: run: pnpm install -r --frozen-lockfile --strict-peer-dependencies shell: bash + - name: Cache turbo build setup + uses: actions/cache@v4 + with: + path: .turbo + key: ${{ runner.os }}-turbo-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-turbo- + - name: 📦 Build if: ${{ inputs.build == 'true' }} run: | if echo ${{ inputs.build-only-packages }} then - pnpm -r --filter "./packages/*" build + turbo build:packages else ${{ inputs.build-command }} fi diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a560e002..f6b0bc86 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -26,7 +26,7 @@ jobs: build-only-packages: true - name: ✅ Run Mocha/Chai unit tests - run: GITHUB_ACTION=true pnpm test:packages + run: GITHUB_ACTION=true turbo test:packages test-server: needs: [test-pacakges] @@ -42,7 +42,7 @@ jobs: build-only-packages: true - name: ✅ Run Mocha/Chai unit tests - run: GITHUB_ACTION=true pnpm coverage:junit + run: GITHUB_ACTION=true turbo coverage:junit - name: ⬆️ Publish Unit Test Results uses: EnricoMi/publish-unit-test-result-action@v1.9