From 8fa1a3f719c3f7888fc93cd48aae81fee84d9726 Mon Sep 17 00:00:00 2001 From: Rickard Andersson Date: Thu, 3 Aug 2023 13:34:21 +0300 Subject: [PATCH] ci: add caching step for deps --- .github/workflows/ui-tests.yaml | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ui-tests.yaml b/.github/workflows/ui-tests.yaml index 44c6282e..7ec8cf31 100644 --- a/.github/workflows/ui-tests.yaml +++ b/.github/workflows/ui-tests.yaml @@ -3,15 +3,43 @@ name: 'UI tests' on: push jobs: + cache-dependencies: + runs-on: ubuntu-latest + steps: + - name: Checkout Commit + uses: actions/checkout@v2 + - name: Cache yarn dependencies and cypress + uses: actions/cache@v2 + id: yarn-cache + with: + path: | + ~/.cache/Cypress + node_modules + key: ${{ runner.os }}-yarn-v3-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn-v3 + - name: Install dependencies if cache invalid + if: steps.yarn-cache.outputs.cache-hit != 'true' + run: yarn + interaction-and-and-accessibility: runs-on: ubuntu-latest + needs: cache-dependencies steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: node-version: '18.x' - - name: Install dependencies - run: yarn + - name: Restore yarn dependencies + uses: actions/cache@v2 + id: yarn-cache + with: + path: | + ~/.cache/Cypress + node_modules + key: ${{ runner.os }}-yarn-v3-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn-v3 - name: Install Playwright run: npx playwright install --with-deps - name: Build Storybook