-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (45 loc) · 1.79 KB
/
ci_tests.yml
File metadata and controls
52 lines (45 loc) · 1.79 KB
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
51
52
# .github/workflows/ci_tests.yml
name: Run Python Tests # Name of the workflow
# Controls when the workflow will run
on:
push: # Run on pushes to the main branch
branches: [ "main" ]
pull_request: # Run on pull requests targeting the main branch
branches: [ "main" ]
# Defines workflow settings
concurrency:
# Ensure that only one workflow runs at a time for the same branch/PR
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Defines the jobs that will run as part of the workflow
jobs:
test: # Job ID
name: Test on Python ${{ matrix.python-version }} # Name shown on GitHub Actions UI
runs-on: ubuntu-latest # Use the latest Ubuntu runner environment
strategy:
fail-fast: false # Don't cancel other jobs if one fails
matrix:
# Define the Python versions to test against
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
# Step 1: Check out the repository code
- name: Check out repository code
uses: actions/checkout@v4 # Use the standard checkout action
# Step 2: Set up the specified Python version
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # Cache pip dependencies to speed up builds
# Step 3: Install dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# Install the package in editable mode along with 'dev' optional dependencies
# This reads dependencies from pyproject.toml
pip install -e .[dev]
# Step 4: Run tests using pytest
- name: Run tests with pytest
run: |
# Run pytest with verbose output
python -m pytest -v