Skip to content

Commit 8a55d32

Browse files
committed
fix: unit test workflow
1 parent 928f2ae commit 8a55d32

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

.github/workflows/unit-test.yml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,26 @@ on:
55
types: [opened, synchronize, reopened]
66

77
jobs:
8-
# Create a job for each plugin dynamically
8+
# Install dependencies once globally
9+
install-dependencies:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Set up Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: '22'
19+
20+
- name: Install dependencies for all plugins
21+
run: |
22+
npm run setup-repo-old
23+
24+
# Test plugins dynamically
925
test-plugins:
1026
runs-on: ubuntu-latest
27+
needs: install-dependencies # Ensures this job runs after dependencies are installed
1128
strategy:
1229
matrix:
1330
plugin:
@@ -21,14 +38,9 @@ jobs:
2138
- name: Set up Node.js
2239
uses: actions/setup-node@v4
2340
with:
24-
node-version: '22'
25-
26-
- name: Install dependencies
27-
run: |
28-
cd packages/${{ matrix.plugin }} # Navigate to the plugin directory
29-
npm install
41+
node-version: '22'
3042

3143
- name: Run tests for the plugin
3244
run: |
33-
cd packages/${{ matrix.plugin }} # Navigate to the plugin directory
34-
npm run test:unit # Run unit tests for the plugin
45+
cd packages/${{ matrix.plugin }}
46+
npm run test:unit

0 commit comments

Comments
 (0)