ci: add caching step for deps

This commit is contained in:
Rickard Andersson 2023-08-03 13:34:21 +03:00
parent d9f4380dc8
commit 8fa1a3f719
1 changed files with 30 additions and 2 deletions

View File

@ -3,15 +3,43 @@ name: 'UI tests'
on: push on: push
jobs: 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: interaction-and-and-accessibility:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: cache-dependencies
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/setup-node@v2 - uses: actions/setup-node@v2
with: with:
node-version: '18.x' node-version: '18.x'
- name: Install dependencies - name: Restore yarn dependencies
run: yarn 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 - name: Install Playwright
run: npx playwright install --with-deps run: npx playwright install --with-deps
- name: Build Storybook - name: Build Storybook