Skip to content

Commit cbbafa5

Browse files
committed
Combined "test on code change" workflows into one
1 parent 5fa47b0 commit cbbafa5

4 files changed

Lines changed: 70 additions & 87 deletions

File tree

.github/workflows/git-diff-check.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/test-linux-and-macos.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/test-windows.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Test on Code Change
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [main]
7+
pull_request:
8+
types: [opened, synchronize, reopened]
9+
branches: [main]
10+
11+
env:
12+
PACKAGE_MANAGER: "npm"
13+
14+
jobs:
15+
git-diff-check:
16+
runs-on: windows-latest
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v5
21+
with:
22+
fetch-depth: 2
23+
show-progress: false
24+
25+
- name: Run git diff check
26+
run: |
27+
git config --global core.whitespace cr-at-eol,tab-in-indent
28+
git diff --check HEAD^
29+
30+
test-linux-and-macOS:
31+
runs-on: ${{ matrix.os }}
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
os: [ubuntu-latest, macOS-latest]
36+
node: [18, 20, 22]
37+
38+
steps:
39+
- name: Checkout repository
40+
uses: actions/checkout@v5
41+
with:
42+
show-progress: false
43+
44+
- name: Install required node.js version
45+
uses: actions/setup-node@v6
46+
with:
47+
node-version: ${{ matrix.node }}
48+
49+
- name: Test package installation
50+
run: sudo npm install
51+
52+
test-windows:
53+
runs-on: windows-latest
54+
strategy:
55+
matrix:
56+
node: [18, 20, 22]
57+
58+
steps:
59+
- name: Checkout repository
60+
uses: actions/checkout@v5
61+
with:
62+
show-progress: false
63+
64+
- name: Install required node.js version
65+
uses: actions/setup-node@v6
66+
with:
67+
node-version: ${{ matrix.node }}
68+
69+
- name: Test package installation
70+
run: npm install

0 commit comments

Comments
 (0)