-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (37 loc) · 913 Bytes
/
yarn-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Node.js CI
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
workflow_dispatch: # Allows manual trigger
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20, 22]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
check-latest: true
- name: Enable Corepack
run: corepack enable # Enable Corepack to manage Yarn versions
- name: Set Yarn to version 2
run: yarn set version berry # Set Yarn to v2 (Berry)
- name: Install dependencies
run: yarn install
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
- name: Build project
run: yarn build
- name: Run tests
run: yarn test