Skip to content

Commit a00ea71

Browse files
committed
ci: update node version
1 parent b2afc0c commit a00ea71

File tree

1 file changed

+40
-10
lines changed

1 file changed

+40
-10
lines changed

.github/workflows/ci.yml

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Testing
1+
name: Test
22

33
on:
44
push:
@@ -10,25 +10,55 @@ on:
1010
- dev
1111

1212
jobs:
13-
test:
14-
name: Testing
13+
branch:
14+
name: Get branch name
1515
runs-on: ubuntu-latest
1616

1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
20+
21+
- name: Extract Branch Name by Push
22+
if: github.event_name != 'pull_request'
23+
run: |
24+
BRANCH_NAME=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}
25+
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
26+
27+
- name: Extract Branch Name by PR
28+
if: github.event_name == 'pull_request'
29+
run: |
30+
BRANCH_NAME=${GITHUB_BASE_REF:-${GITHUB_HEAD_REF}}
31+
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
32+
33+
outputs:
34+
branch_name: ${{ env.BRANCH_NAME }}
35+
36+
build:
37+
needs:
38+
- branch
39+
40+
name: Install dependencies, testing and build
41+
runs-on: ubuntu-latest
42+
43+
strategy:
44+
matrix:
45+
node-version: [22.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
46+
47+
steps:
48+
- name: Checkout
49+
uses: actions/checkout@v4
2050

2151
- name: Install Node.js
22-
uses: actions/setup-node@v3
52+
uses: actions/setup-node@v4
2353
with:
24-
node-version: 18 # - get from package.json: engines.node
54+
node-version: 22 # - get from package.json: engines.node
2555
registry-url: 'https://registry.npmjs.org'
2656

27-
- uses: pnpm/action-setup@v2
57+
- uses: pnpm/action-setup@v4
2858
name: Install pnpm
2959
id: pnpm-install
3060
with:
31-
version: 8 # - get from package.json: engines.pnpm
61+
version: 9 # - get from package.json: engines.pnpm
3262
run_install: false
3363

3464
- name: Get pnpm store directory
@@ -37,7 +67,7 @@ jobs:
3767
run: |
3868
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
3969
40-
- uses: actions/cache@v3
70+
- uses: actions/cache@v4
4171
name: Setup pnpm cache
4272
with:
4373
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
@@ -49,4 +79,4 @@ jobs:
4979
run: node -v && pnpm -v && pnpm install --frozen-lockfile
5080

5181
- name: Test
52-
run: npm run test:ci
82+
run: pnpm test:ci

0 commit comments

Comments
 (0)