Skip to content

Commit b2e2af0

Browse files
sloved erros
1 parent cedb991 commit b2e2af0

1 file changed

Lines changed: 18 additions & 11 deletions

File tree

.github/workflows/python-tests.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,39 @@
1+
# .github/workflows/python-tests.yml
12
name: Python (Chapters)
23

34
on:
45
push:
5-
branches: [ main, master ]
6+
branches: [ "main" ]
67
pull_request:
7-
branches: [ main, master ]
88

99
jobs:
1010
test:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
python-version: ["3.10", "3.11"]
14+
chapter: [ch2_rl_formulation, ch3_bandits] # add/remove chapters as needed
1515
steps:
16-
- uses: actions/checkout@v4
16+
- name: Checkout
17+
uses: actions/checkout@v4
1718

1819
- name: Set up Python
1920
uses: actions/setup-python@v5
2021
with:
21-
python-version: ${{ matrix.python-version }}
22+
python-version: "3.10"
2223

23-
- name: Install root deps
24+
- name: Install deps
2425
run: |
2526
python -m pip install --upgrade pip
26-
pip install -r requirements.txt
27+
# Root requirements (optional)
28+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
29+
# Chapter-specific requirements (if present)
30+
if [ -f "${{ matrix.chapter }}/requirements.txt" ]; then \
31+
pip install -r "${{ matrix.chapter }}/requirements.txt"; \
32+
fi
33+
pip install pytest
2734
28-
- name: Run Chapter 2 tests
29-
run: pytest -q ch2_rl_formulation/tests
35+
- name: Make repo importable
36+
run: echo "PYTHONPATH=${GITHUB_WORKSPACE}" >> $GITHUB_ENV
3037

31-
- name: Run Chapter 3 tests
32-
run: pytest -q ch3_multi_armed_bandits/tests
38+
- name: Run ${{ matrix.chapter }} tests
39+
run: pytest -q ${{ matrix.chapter }}/tests

0 commit comments

Comments
 (0)