Skip to content

Commit

Permalink
ci: pnpm cache (shuding#583)
Browse files Browse the repository at this point in the history
* ci: pnpm cache

* ci: test cache
  • Loading branch information
promer94 authored Jul 24, 2022
1 parent 0268423 commit 14bfc99
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 10 deletions.
25 changes: 20 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,33 @@ jobs:
- name: Checkout Master
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16

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

- name: Use Node.js ${{matrix.node-version}}
uses: actions/setup-node@v3
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
node-version: ${{matrix.node-version}}
cache: pnpm
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install Dependencies
run: pnpm i
run: pnpm install

- name: Test
run: pnpm test
Expand Down
25 changes: 20 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,30 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: pnpm/[email protected]
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16

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

- name: Use Node.js ${{matrix.node-version}}
uses: actions/setup-node@v3
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
node-version: ${{matrix.node-version}}
cache: pnpm
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install Dependencies
run: pnpm i
Expand Down

0 comments on commit 14bfc99

Please sign in to comment.