Skip to content

Commit e873d97

Browse files
authored
Update unit-tests.yml
1 parent 8713f93 commit e873d97

File tree

1 file changed

+25
-40
lines changed

1 file changed

+25
-40
lines changed

.github/workflows/unit-tests.yml

Lines changed: 25 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,37 @@
1-
name: Unit Tests
1+
name: CI – Unit Tests
22

33
on:
4-
pull_request:
54
push:
6-
branches: ['**']
5+
pull_request:
76

87
jobs:
9-
test-js-py:
8+
client-tests:
9+
name: Client (React) Tests
1010
runs-on: ubuntu-latest
11-
12-
strategy:
13-
matrix:
14-
node: [18, 20]
15-
python: ['3.10', '3.11']
16-
1711
steps:
1812
- uses: actions/checkout@v4
19-
20-
# ───────────── JavaScript side ─────────────
21-
- name: Set up Node
22-
uses: actions/setup-node@v4
13+
- uses: actions/setup-node@v4
2314
with:
24-
node-version: ${{ matrix.node }}
25-
# ⚠️ no cache line → setup-node won’t look for package-lock.json
26-
# cache: 'npm'
27-
28-
- name: Install JS deps
15+
node-version: '18'
16+
- name: Install & Test Client
17+
working-directory: client
2918
run: |
30-
if [ -f package-lock.json ]; then
31-
echo "package-lock.json found → npm ci"
32-
npm ci
33-
else
34-
echo "No lock-file → npm install"
35-
npm install
36-
fi
19+
npm ci
20+
npm test -- --ci || echo "No client tests"
3721
38-
- name: Run JS unit tests (if any)
39-
run: npm test -- --ci || echo "No JS tests"
40-
41-
# ───────────── Python side ─────────────
42-
- name: Set up Python
43-
uses: actions/setup-python@v5
22+
python-tests:
23+
name: Python Tests
24+
runs-on: ubuntu-latest
25+
strategy:
26+
matrix:
27+
python-version: ['3.10', '3.11']
28+
steps:
29+
- uses: actions/checkout@v4
30+
- uses: actions/setup-python@v5
4431
with:
45-
python-version: ${{ matrix.python }}
46-
cache: 'pip'
47-
48-
- name: Install Python deps & run tests
49-
run: |
50-
pip install -r backend/requirements.txt
51-
pip install pytest
52-
pytest backend || echo "No Py tests"
32+
python-version: ${{ matrix.python-version }}
33+
cache: pip
34+
- name: Install Dependencies
35+
run: pip install -r requirements.txt
36+
- name: Run pytest
37+
run: pytest tests || echo "No Python tests"

0 commit comments

Comments
 (0)