Skip to content

Commit f33be70

Browse files
authored
ci: switch ci to test matrix (#3748)
1 parent ccb190a commit f33be70

File tree

1 file changed

+12
-64
lines changed

1 file changed

+12
-64
lines changed

.github/workflows/CI.yml

+12-64
Original file line numberDiff line numberDiff line change
@@ -8,77 +8,25 @@ on:
88
types: [opened, synchronize]
99

1010
jobs:
11-
v18:
12-
runs-on: ubuntu-22.04
13-
container:
14-
image: 'ubuntu:22.04'
11+
build:
12+
strategy:
13+
matrix:
14+
os: [ubuntu-22.04, windows-2022]
15+
node: [18, 20]
16+
runs-on: ${{ matrix.os }}
1517
steps:
16-
- name: Install required dependencies
17-
run: |
18-
apt update
19-
apt install --yes sudo
20-
sudo apt install --yes git
21-
sudo apt install --yes curl
22-
curl --location https://deb.nodesource.com/setup_18.x | sudo --preserve-env bash -
23-
sudo DEBIAN_FRONTEND=noninteractive apt install --yes nodejs
2418
- uses: actions/checkout@v4
25-
# workaround for https://github.com/actions/runner/issues/2033
26-
- name: ownership workaround
27-
run: git config --global --add safe.directory '*'
28-
- name: Install yarn
29-
run: |
30-
npm install --global yarn
31-
node --version
32-
yarn global add yarn@latest
33-
- name: Install dependencies
34-
run: yarn install --ignore-engines --frozen-lockfile
35-
- name: Build packages
36-
run: yarn build
37-
- name: Test
38-
run: yarn test-ci
39-
40-
v20:
41-
runs-on: ubuntu-22.04
42-
container:
43-
image: 'ubuntu:22.04'
44-
steps:
45-
- name: Install required dependencies
46-
run: |
47-
apt update
48-
apt install --yes sudo
49-
sudo apt install --yes git
50-
sudo apt install --yes curl
51-
curl --location https://deb.nodesource.com/setup_20.x | sudo --preserve-env bash -
52-
sudo DEBIAN_FRONTEND=noninteractive apt install --yes nodejs
53-
- uses: actions/checkout@v4
54-
# workaround for https://github.com/actions/runner/issues/2033
55-
- name: ownership workaround
56-
run: git config --global --add safe.directory '*'
57-
- name: Install yarn
58-
run: |
59-
npm install --global yarn
60-
node --version
61-
yarn global add yarn@latest
62-
- name: Install dependencies
63-
run: yarn install --ignore-engines --frozen-lockfile
64-
- name: Build packages
65-
run: yarn build
66-
- name: Test
67-
run: yarn test-ci
6819

69-
windows:
70-
runs-on: windows-2022
71-
steps:
72-
- uses: actions/checkout@v4
20+
- uses: actions/setup-node@v3
7321
with:
74-
max_attempts: 3
75-
- name: Update yarn
76-
run: |
77-
node --version
78-
yarn global add yarn@latest
22+
node-version: ${{ matrix.node }}
23+
cache: yarn
24+
7925
- name: Install dependencies
8026
run: yarn install --ignore-engines --frozen-lockfile
27+
8128
- name: Build packages
8229
run: yarn build
30+
8331
- name: Test
8432
run: yarn test-ci

0 commit comments

Comments
 (0)