Skip to content

Commit

Permalink
Merge pull request #1319 from silx-kit/cache-job
Browse files Browse the repository at this point in the history
Use single cache for both pnpm store and Cypress binaries in CI
  • Loading branch information
axelboc authored Dec 12, 2022
2 parents c951b63 + 72f227e commit 6be3e79
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 45 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/approve-snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,25 @@ jobs:
with:
ref: ${{ steps.getBranchName.outputs.branch }}

- name: Install pnpm ⚙️
uses: pnpm/action-setup@v2
with:
version: 7.x

- name: Use Node 16 🕹️
uses: actions/setup-node@v3
with:
node-version-file: 'package.json'
cache: 'pnpm'

- name: Cache Cypress binary 📌
- name: Install pnpm ⚙️
uses: pnpm/action-setup@v2
with:
version: 7.x

- name: Restore cache 📌
uses: actions/cache@v3
with:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
path: |
~/setup-pnpm/node_modules/.bin/store
~/.cache/Cypress
key: cache-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- name: Install dependencies ⚙️
run: pnpm install --frozen-lockfile
Expand Down
63 changes: 36 additions & 27 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,25 @@ jobs:
- name: Checkout 🏷️
uses: actions/checkout@v3

- name: Install pnpm ⚙️
uses: pnpm/action-setup@v2
with:
version: 7.x

- name: Use Node 16 🕹️
uses: actions/setup-node@v3
with:
node-version-file: 'package.json'
cache: 'pnpm'

- name: Cache Cypress binary 📌
- name: Install pnpm ⚙️
uses: pnpm/action-setup@v2
with:
version: 7.x

- name: Restore cache 📌
uses: actions/cache@v3
with:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
path: |
~/setup-pnpm/node_modules/.bin/store
~/.cache/Cypress
key: cache-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- name: Install dependencies ⚙️
run: pnpm install --frozen-lockfile
Expand All @@ -48,22 +51,25 @@ jobs:
- name: Checkout 🏷️
uses: actions/checkout@v3

- name: Install pnpm ⚙️
uses: pnpm/action-setup@v2
with:
version: 7.x

- name: Use Node 16 🕹️
uses: actions/setup-node@v3
with:
node-version-file: 'package.json'
cache: 'pnpm'

- name: Cache Cypress binary 📌
- name: Install pnpm ⚙️
uses: pnpm/action-setup@v2
with:
version: 7.x

- name: Restore cache 📌
uses: actions/cache@v3
with:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
path: |
~/setup-pnpm/node_modules/.bin/store
~/.cache/Cypress
key: cache-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- name: Install dependencies ⚙️
run: pnpm install --frozen-lockfile
Expand All @@ -82,22 +88,25 @@ jobs:
- name: Checkout 🏷️
uses: actions/checkout@v3

- name: Install pnpm ⚙️
uses: pnpm/action-setup@v2
with:
version: 7.x

- name: Use Node 16 🕹️
uses: actions/setup-node@v3
with:
node-version-file: 'package.json'
cache: 'pnpm'

- name: Cache Cypress binary 📌
- name: Install pnpm ⚙️
uses: pnpm/action-setup@v2
with:
version: 7.x

- name: Restore cache 📌
uses: actions/cache@v3
with:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
path: |
~/setup-pnpm/node_modules/.bin/store
~/.cache/Cypress
key: cache-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- name: Install dependencies ⚙️
run: pnpm install --frozen-lockfile
Expand Down
21 changes: 12 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,26 @@ jobs:
with:
TAG_PREFIX: v

- name: Install pnpm ⚙️
uses: pnpm/action-setup@v2
with:
version: 7.x

- name: Use Node 16 🕹️
uses: actions/setup-node@v3
with:
node-version-file: 'package.json'
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'

- name: Cache Cypress binary 📌
- name: Install pnpm ⚙️
uses: pnpm/action-setup@v2
with:
version: 7.x

- name: Restore cache 📌
uses: actions/cache@v3
with:
path: ~/.cache/Cypress
key: cypress-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
path: |
~/setup-pnpm/node_modules/.bin/store
~/.cache/Cypress
key: cache-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- name: Install dependencies ⚙️
run: pnpm install --frozen-lockfile
Expand Down

0 comments on commit 6be3e79

Please sign in to comment.