Skip to content

Commit

Permalink
chore: add caching
Browse files Browse the repository at this point in the history
  • Loading branch information
stepan662 committed Aug 22, 2023
1 parent 4444f52 commit 88e6c84
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/test-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:

jobs:
prepare:
name: Build and publish packages to github packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -22,13 +23,33 @@ jobs:
version: 7.16.0
run_install: false

- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: |
.pnpm-store/v3
~/.cache/Cypress
key: ${{ runner.os }}-pnpm-cypress-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-cypress-
- name: Turbo Cache
id: turbo-cache
uses: actions/cache@v3
with:
path: .turbo
key: turbo-cypress-${{ github.sha }}
restore-keys: |
turbo-cypress-
- name: Create branch
run: git checkout -b test.$(git rev-parse --short HEAD)

- name: Install root and packages dependencies
run: |
pnpm install --ignore-workspace
pnpm install --no-frozen-lockfile --filter='./packages/*'
pnpm install --no-frozen-lockfile --filter='./e2e'
- name: Update version with lerna
run: |
Expand Down Expand Up @@ -62,6 +83,7 @@ jobs:
dirs: ${{ steps.set-dirs.outputs.dirs }}

cypress:
name: Run cypress on all testapps
needs: prepare
runs-on: ubuntu-latest
strategy:
Expand All @@ -75,6 +97,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'

- uses: pnpm/[email protected]
name: Install pnpm
Expand All @@ -83,6 +106,16 @@ jobs:
version: 7.16.0
run_install: false

- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: |
.pnpm-store/v3
~/.cache/Cypress
key: ${{ runner.os }}-pnpm-cypress-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-cypress-
- name: Install for root and for e2e
run: |
pnpm install --ignore-workspace
Expand Down Expand Up @@ -120,3 +153,36 @@ jobs:
path: |
e2e/cypress/videos/**/*
e2e/cypress/screenshots/**/*
code-checks:
name: Eslint 🪲
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '18'

- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 7.16.0
run_install: false

- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: .pnpm-store/v3
key: ${{ runner.os }}-pnpm-eslint-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-eslint-
- name: Install
run: pnpm install --no-frozen-lockfile
working-directory: ./

- name: Eslint
run: pnpm run eslint
working-directory: ./

0 comments on commit 88e6c84

Please sign in to comment.