Skip to content

Commit 6c863dd

Browse files
Andaristspanishpear
authored andcommitted
Make CI setup reusable
1 parent 9a72da4 commit 6c863dd

File tree

3 files changed

+23
-48
lines changed

3 files changed

+23
-48
lines changed

.github/actions/ci-setup/action.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Setup CI
2+
3+
runs:
4+
using: composite
5+
steps:
6+
- name: Setup Node.js
7+
uses: actions/setup-node@v4
8+
with:
9+
node-version-file: ".node-version"
10+
11+
- name: Install dependencies
12+
shell: bash
13+
run: yarn install --frozen-lockfile

.github/workflows/changeset-release.yml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,11 @@ jobs:
1010
name: Release
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: Checkout Repo
14-
uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1514
with:
1615
fetch-depth: 0
16+
- uses: ./.github/actions/ci-setup
1717

18-
- name: Set Node.js 22.x
19-
uses: actions/setup-node@v4
20-
with:
21-
node-version-file: ".node-version"
22-
23-
- name: Install Yarn
24-
run: npm install --global yarn
25-
26-
- name: Install Dependencies
27-
run: yarn
2818
- run: git branch -a
2919

3020
- name: "Create Pull Request or Publish to npm"

.github/workflows/main.yml

Lines changed: 8 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,8 @@ jobs:
1111
name: Tests
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v3
15-
16-
- name: Set Node.js 22.x
17-
uses: actions/setup-node@v4
18-
with:
19-
node-version-file: ".node-version"
20-
21-
- name: Install Dependencies
22-
run: yarn
14+
- uses: actions/checkout@v4
15+
- uses: ./.github/actions/ci-setup
2316

2417
- name: Run Tests
2518
run: yarn test
@@ -28,15 +21,8 @@ jobs:
2821
name: TypeScript
2922
runs-on: ubuntu-latest
3023
steps:
31-
- uses: actions/checkout@v3
32-
33-
- name: Set Node.js 22.x
34-
uses: actions/setup-node@v4
35-
with:
36-
node-version-file: ".node-version"
37-
38-
- name: Install Dependencies
39-
run: yarn
24+
- uses: actions/checkout@v4
25+
- uses: ./.github/actions/ci-setup
4026

4127
- name: Check Types
4228
run: yarn tsc
@@ -45,15 +31,8 @@ jobs:
4531
name: Formatting
4632
runs-on: ubuntu-latest
4733
steps:
48-
- uses: actions/checkout@v3
49-
50-
- name: Set Node.js 22.x
51-
uses: actions/setup-node@v4
52-
with:
53-
node-version-file: ".node-version"
54-
55-
- name: Install Dependencies
56-
run: yarn
34+
- uses: actions/checkout@v4
35+
- uses: ./.github/actions/ci-setup
5736

5837
- name: Check Formatting
5938
run: yarn format:check
@@ -62,15 +41,8 @@ jobs:
6241
name: Knip
6342
runs-on: ubuntu-latest
6443
steps:
65-
- uses: actions/checkout@v3
66-
67-
- name: Set Node.js 22.x
68-
uses: actions/setup-node@v4
69-
with:
70-
node-version-file: ".node-version"
71-
72-
- name: Install Dependencies
73-
run: yarn
44+
- uses: actions/checkout@v4
45+
- uses: ./.github/actions/ci-setup
7446

7547
- name: Check Knip
7648
run: yarn knip

0 commit comments

Comments
 (0)