Skip to content

Commit c554eb9

Browse files
committed
ci(dependencies): make sub actions to use multiple times
1 parent 5e4007b commit c554eb9

File tree

3 files changed

+37
-32
lines changed

3 files changed

+37
-32
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,7 @@ jobs:
1212
name: Building stack
1313

1414
steps:
15-
- name: Check out
16-
uses: actions/checkout@v4
17-
with:
18-
fetch-depth: 0
19-
20-
- name: Build ${{ matrix.projects }}
21-
run: |
22-
pnpm run build
15+
- build:
2316

2417
- name: Release
2518
uses: softprops/action-gh-release@v2

.github/workflows/setup.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: setup
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_call:
6+
7+
jobs:
8+
setup-dependencies:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: "Setup pnpm"
12+
uses: pnpm/action-setup@v4
13+
14+
- name: "Setup node"
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: 23.6.0
18+
cache: "pnpm"
19+
20+
- name: "Install dependencies"
21+
run: pnpm install
22+
23+
- name: "Install emscipten"
24+
uses: "mymindstorm/setup-emsdk@v14"
25+
with:
26+
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}

.github/workflows/tests.yml

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,19 @@ env:
1111
EM_CACHE_FOLDER: "emsdk-cache"
1212

1313
jobs:
14-
tests:
14+
checkout:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- name: "Checkout"
18-
uses: actions/checkout@v2
19-
with:
20-
fetch-depth: 0
21-
22-
- name: "Setup pnpm"
23-
uses: pnpm/action-setup@v4
24-
# with:
25-
# run_install: false
26-
27-
- name: "Setup node"
28-
uses: actions/setup-node@v4
29-
with:
30-
node-version: 23.6.0
31-
cache: "pnpm"
32-
33-
- name: "Install dependencies"
34-
run: pnpm install
35-
36-
- name: "Install emscipten"
37-
uses: "mymindstorm/setup-emsdk@v14"
38-
with:
39-
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}
17+
- name: Checkout
18+
uses: actions/checkout@v5
19+
setup:
20+
needs: checkout
21+
uses: './.github/workflows/setup.yml'
4022

23+
tests:
24+
runs-on: ubuntu-latest
25+
needs: [checkout, setup]
26+
steps:
4127
- name: "Run build"
4228
run: pnpm build
4329

0 commit comments

Comments
 (0)