-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (41 loc) · 1.2 KB
/
run-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Run Unit Tests
on:
push:
branches:
- '**' # Run on all branches
pull_request:
branches:
- '**' # Run on all pull requests
jobs:
test:
strategy:
matrix:
python-version: [3.9, 3.11] # Specify Python versions >= 3.8
runs-on: ubuntu-latest
steps:
# Step 1: Check out the repository
- name: Checkout code
uses: actions/checkout@v3
# Step 2: Set up Python environment
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# Step 3: Install dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
# Step 4: Install package
- name: Install the Project
run: pip install -e .
# Step 5: Run unit tests and save logs
- name: Run Unit Tests
run: |
pytest --maxfail=0 --disable-warnings | tee pytest_${{ matrix.python-version }}.log
# Step 6: Always save logs
- name: Save Test Logs
uses: actions/upload-artifact@v3
with:
name: pytest-logs-${{ matrix.python-version }}
path: pytest_${{ matrix.python-version }}.log