Skip to content

Commit 9bd15f1

Browse files
author
issayah
committed
ci: update ci
ci: refactor some ci ci: cache ci
1 parent 7300621 commit 9bd15f1

File tree

5 files changed

+184
-50
lines changed

5 files changed

+184
-50
lines changed

.github/workflows/ci.yaml

Lines changed: 88 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,31 @@ jobs:
2323
- name: Clone repository
2424
uses: actions/checkout@v3
2525

26+
- name: Install Node.js
27+
uses: actions/setup-node@v3
28+
with:
29+
node-version: 16
30+
2631
- name: Install pnpm
27-
uses: pnpm/[email protected]
32+
uses: pnpm/[email protected]
33+
id: pnpm-install
34+
with:
35+
version: 7
36+
run_install: false
37+
38+
- name: Get pnpm store directory
39+
id: pnpm-cache
40+
shell: bash
41+
run: |
42+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
2843
29-
- name: Set node version to 16
30-
uses: actions/setup-node@v2
44+
- name: Setup pnpm cache
45+
uses: actions/cache@v3
3146
with:
32-
node-version: 16
33-
cache: 'pnpm'
47+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
48+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
49+
restore-keys: |
50+
${{ runner.os }}-pnpm-store-
3451
3552
- name: Install dependencies
3653
run: pnpm install --ignore-scripts --frozen-lockfile
@@ -49,14 +66,31 @@ jobs:
4966
- name: Clone repository
5067
uses: actions/checkout@v3
5168

69+
- name: Install Node.js
70+
uses: actions/setup-node@v3
71+
with:
72+
node-version: 16
73+
5274
- name: Install pnpm
53-
uses: pnpm/[email protected]
75+
uses: pnpm/[email protected]
76+
id: pnpm-install
77+
with:
78+
version: 7
79+
run_install: false
80+
81+
- name: Get pnpm store directory
82+
id: pnpm-cache
83+
shell: bash
84+
run: |
85+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
5486
55-
- name: Set node version to 16
56-
uses: actions/setup-node@v2
87+
- name: Setup pnpm cache
88+
uses: actions/cache@v3
5789
with:
58-
node-version: 16
59-
cache: 'pnpm'
90+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
91+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
92+
restore-keys: |
93+
${{ runner.os }}-pnpm-store-
6094
6195
- name: Install dependencies
6296
run: pnpm install --ignore-scripts --frozen-lockfile
@@ -75,14 +109,31 @@ jobs:
75109
- name: Clone repository
76110
uses: actions/checkout@v3
77111

112+
- name: Install Node.js
113+
uses: actions/setup-node@v3
114+
with:
115+
node-version: 16
116+
78117
- name: Install pnpm
79-
uses: pnpm/[email protected]
118+
uses: pnpm/[email protected]
119+
id: pnpm-install
120+
with:
121+
version: 7
122+
run_install: false
123+
124+
- name: Get pnpm store directory
125+
id: pnpm-cache
126+
shell: bash
127+
run: |
128+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
80129
81-
- name: Set node version to 16
82-
uses: actions/setup-node@v2
130+
- name: Setup pnpm cache
131+
uses: actions/cache@v3
83132
with:
84-
node-version: 16
85-
cache: 'pnpm'
133+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
134+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
135+
restore-keys: |
136+
${{ runner.os }}-pnpm-store-
86137
87138
- name: Install dependencies
88139
run: pnpm install --ignore-scripts --frozen-lockfile
@@ -102,14 +153,31 @@ jobs:
102153
- name: Clone repository
103154
uses: actions/checkout@v3
104155

156+
- name: Install Node.js
157+
uses: actions/setup-node@v3
158+
with:
159+
node-version: 16
160+
105161
- name: Install pnpm
106-
uses: pnpm/[email protected]
162+
uses: pnpm/[email protected]
163+
id: pnpm-install
164+
with:
165+
version: 7
166+
run_install: false
167+
168+
- name: Get pnpm store directory
169+
id: pnpm-cache
170+
shell: bash
171+
run: |
172+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
107173
108-
- name: Set node version to 16
109-
uses: actions/setup-node@v2
174+
- name: Setup pnpm cache
175+
uses: actions/cache@v3
110176
with:
111-
node-version: 16
112-
cache: 'pnpm'
177+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
178+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
179+
restore-keys: |
180+
${{ runner.os }}-pnpm-store-
113181
114182
- name: Install dependencies
115183
run: pnpm install --ignore-scripts --frozen-lockfile

.github/workflows/docs-github-pages-deploy.yaml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,31 @@ jobs:
2424
- name: Clone repository
2525
uses: actions/checkout@v3
2626

27+
- name: Install Node.js
28+
uses: actions/setup-node@v3
29+
with:
30+
node-version: 16
31+
2732
- name: Install pnpm
28-
uses: pnpm/[email protected]
33+
uses: pnpm/[email protected]
34+
id: pnpm-install
35+
with:
36+
version: 7
37+
run_install: false
38+
39+
- name: Get pnpm store directory
40+
id: pnpm-cache
41+
shell: bash
42+
run: |
43+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
2944
30-
- name: Set node version to 16
31-
uses: actions/setup-node@v2
45+
- name: Setup pnpm cache
46+
uses: actions/cache@v3
3247
with:
33-
node-version: 16
34-
cache: 'pnpm'
48+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
49+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
50+
restore-keys: |
51+
${{ runner.os }}-pnpm-store-
3552
3653
- name: Install dependencies
3754
run: pnpm install --ignore-scripts --frozen-lockfile

.github/workflows/npm-publish.yaml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,31 @@ jobs:
2020
- name: Clone repository
2121
uses: actions/checkout@v3
2222

23+
- name: Install Node.js
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: 16
27+
2328
- name: Install pnpm
24-
uses: pnpm/[email protected]
29+
uses: pnpm/[email protected]
30+
id: pnpm-install
31+
with:
32+
version: 7
33+
run_install: false
34+
35+
- name: Get pnpm store directory
36+
id: pnpm-cache
37+
shell: bash
38+
run: |
39+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
2540
26-
- name: Set node version to 16
27-
uses: actions/setup-node@v2
41+
- name: Setup pnpm cache
42+
uses: actions/cache@v3
2843
with:
29-
node-version: 16
30-
cache: 'pnpm'
44+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
45+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
46+
restore-keys: |
47+
${{ runner.os }}-pnpm-store-
3148
3249
- name: Install dependencies
3350
run: pnpm install --ignore-scripts --frozen-lockfile

.github/workflows/release-dev.yaml

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,36 @@ jobs:
3535

3636
- name: Clone repository
3737
uses: actions/checkout@v3
38-
# these if statements ensure that a publication only occurs when
39-
# a new release is created:
4038
if: ${{ steps.release.outputs.releases_created }}
41-
39+
40+
- name: Install Node.js
41+
uses: actions/setup-node@v3
42+
with:
43+
node-version: 16
44+
if: ${{ steps.release.outputs.releases_created }}
45+
4246
- name: Install pnpm
43-
uses: pnpm/[email protected]
47+
uses: pnpm/[email protected]
48+
id: pnpm-install
49+
with:
50+
version: 7
51+
run_install: false
52+
if: ${{ steps.release.outputs.releases_created }}
53+
54+
- name: Get pnpm store directory
55+
id: pnpm-cache
56+
shell: bash
57+
run: |
58+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
4459
if: ${{ steps.release.outputs.releases_created }}
45-
46-
- name: Set node version to 16
47-
uses: actions/setup-node@v2
60+
61+
- name: Setup pnpm cache
62+
uses: actions/cache@v3
4863
with:
49-
node-version: 16
50-
cache: 'pnpm'
51-
registry-url: 'https://registry.npmjs.org'
64+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
65+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
66+
restore-keys: |
67+
${{ runner.os }}-pnpm-store-
5268
if: ${{ steps.release.outputs.releases_created }}
5369

5470
- name: Install dependencies

.github/workflows/release-main.yaml

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,36 @@ jobs:
3535

3636
- name: Clone repository
3737
uses: actions/checkout@v3
38-
# these if statements ensure that a publication only occurs when
39-
# a new release is created:
4038
if: ${{ steps.release.outputs.releases_created }}
41-
39+
40+
- name: Install Node.js
41+
uses: actions/setup-node@v3
42+
with:
43+
node-version: 16
44+
if: ${{ steps.release.outputs.releases_created }}
45+
4246
- name: Install pnpm
43-
uses: pnpm/[email protected]
47+
uses: pnpm/[email protected]
48+
id: pnpm-install
49+
with:
50+
version: 7
51+
run_install: false
52+
if: ${{ steps.release.outputs.releases_created }}
53+
54+
- name: Get pnpm store directory
55+
id: pnpm-cache
56+
shell: bash
57+
run: |
58+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
4459
if: ${{ steps.release.outputs.releases_created }}
45-
46-
- name: Set node version to 16
47-
uses: actions/setup-node@v2
60+
61+
- name: Setup pnpm cache
62+
uses: actions/cache@v3
4863
with:
49-
node-version: 16
50-
cache: 'pnpm'
51-
registry-url: 'https://registry.npmjs.org'
64+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
65+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
66+
restore-keys: |
67+
${{ runner.os }}-pnpm-store-
5268
if: ${{ steps.release.outputs.releases_created }}
5369

5470
- name: Install dependencies

0 commit comments

Comments
 (0)