Skip to content

Commit af7e282

Browse files
authored
Merge pull request #64 from kutsan/improve-ci-workflow
Improve CI workflow
2 parents 34ba52e + aadab4d commit af7e282

6 files changed

Lines changed: 30 additions & 54 deletions

File tree

.changeset/long-rockets-give.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

.github/actions/setup/action.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Setup
2+
description: Install pnpm and Node, install dependencies.
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Install pnpm
8+
uses: pnpm/action-setup@v6
9+
10+
- name: Set up Node
11+
uses: actions/setup-node@v6
12+
with:
13+
node-version: '26'
14+
15+
- name: Install dependencies
16+
shell: bash
17+
run: pnpm install --frozen-lockfile

.github/workflows/_build.yaml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,8 @@ jobs:
2222
- name: Checkout code
2323
uses: actions/checkout@v6
2424

25-
- name: Install pnpm
26-
uses: pnpm/action-setup@v6
27-
28-
- name: Set up Node
29-
uses: actions/setup-node@v6
30-
with:
31-
node-version: '26'
32-
33-
- name: Install dependencies
34-
run: pnpm install --frozen-lockfile
25+
- name: Setup
26+
uses: ./.github/actions/setup
3527

3628
- name: Set artifact name
3729
id: set-artifact-name

.github/workflows/_checks.yaml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,8 @@ jobs:
2424
- name: Checkout code
2525
uses: actions/checkout@v6
2626

27-
- name: Install pnpm
28-
uses: pnpm/action-setup@v6
29-
30-
- name: Set up Node
31-
uses: actions/setup-node@v6
32-
with:
33-
node-version: '26'
34-
35-
- name: Install dependencies
36-
run: |
37-
pnpm install --frozen-lockfile
27+
- name: Setup
28+
uses: ./.github/actions/setup
3829

3930
- name: ${{ matrix.name }}
40-
run: |
41-
pnpm run ${{ matrix.command }}
31+
run: pnpm run ${{ matrix.command }}

.github/workflows/ci.yaml

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,8 @@ jobs:
2222
with:
2323
fetch-depth: 0
2424

25-
- name: Install pnpm
26-
uses: pnpm/action-setup@v6
27-
28-
- name: Set up Node
29-
uses: actions/setup-node@v6
30-
with:
31-
node-version: '26'
32-
33-
- name: Install dependencies
34-
run: pnpm install --frozen-lockfile
25+
- name: Setup
26+
uses: ./.github/actions/setup
3527

3628
- name: Lint commit messages
3729
run: pnpm dlx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
@@ -46,16 +38,8 @@ jobs:
4638
with:
4739
fetch-depth: 0
4840

49-
- name: Install pnpm
50-
uses: pnpm/action-setup@v6
51-
52-
- name: Set up Node
53-
uses: actions/setup-node@v6
54-
with:
55-
node-version: '26'
56-
57-
- name: Install dependencies
58-
run: pnpm install --frozen-lockfile
41+
- name: Setup
42+
uses: ./.github/actions/setup
5943

6044
- name: Fetch base branch
6145
run: git fetch origin ${{ github.event.pull_request.base.ref }} --depth=1

.github/workflows/release.yaml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,8 @@ jobs:
3333
- name: Checkout code
3434
uses: actions/checkout@v6
3535

36-
- name: Install pnpm
37-
uses: pnpm/action-setup@v6
38-
39-
- name: Set up Node
40-
uses: actions/setup-node@v6
41-
with:
42-
node-version: '26'
43-
registry-url: 'https://registry.npmjs.org'
44-
45-
- name: Install dependencies
46-
run: pnpm install --frozen-lockfile
36+
- name: Setup
37+
uses: ./.github/actions/setup
4738

4839
- name: Download build artifact
4940
uses: actions/download-artifact@v8

0 commit comments

Comments
 (0)