| 1 |
name: Continuous Integration |
| 2 |
on: |
| 3 |
push: |
| 4 |
branches: |
| 5 |
- main |
| 6 |
pull_request: |
| 7 |
paths: |
| 8 |
- .github/workflows/ci.yml |
| 9 |
- cppy/* |
| 10 |
- tests/* |
| 11 |
- setup.py |
| 12 |
- pyproject.toml |
| 13 |
|
| 14 |
jobs: |
| 15 |
lint: |
| 16 |
name: Lints Python codes |
| 17 |
runs-on: ubuntu-latest |
| 18 |
steps: |
| 19 |
- uses: actions/checkout@v4 |
| 20 |
- name: pyflakes |
| 21 |
uses: reviewdog/action-pyflakes@v1 |
| 22 |
with: |
| 23 |
github_token: ${{ secrets.github_token }} |
| 24 |
reporter: ${{ github.event_name == 'pull_request' && 'github-pr-review' || 'github-check' }} |
| 25 |
|
| 26 |
tests: |
| 27 |
name: Unit tests |
| 28 |
runs-on: ${{ matrix.os }} |
| 29 |
strategy: |
| 30 |
matrix: |
| 31 |
os: [ubuntu-latest, windows-latest, macos-latest] |
| 32 |
python-version: ['3.10', '3.11', '3.12', '3.13'] |
| 33 |
fail-fast: false |
| 34 |
steps: |
| 35 |
- uses: actions/checkout@v4 |
| 36 |
- name: Get history and tags for SCM versioning to work |
| 37 |
run: | |
| 38 |
git fetch --prune --unshallow |
| 39 |
git fetch --depth=1 origin +refs/tags/*:refs/tags/* |
| 40 |
- name: Set up Python ${{ matrix.python-version }} |
| 41 |
uses: actions/setup-python@v5 |
| 42 |
with: |
| 43 |
python-version: ${{ matrix.python-version }} |
| 44 |
- name: Install dependencies |
| 45 |
run: | |
| 46 |
python -m pip install --upgrade pip |
| 47 |
python -m pip install pytest |
| 48 |
- name: Install project |
| 49 |
run: | |
| 50 |
pip install . |
| 51 |
- name: Test with pytest |
| 52 |
run: | |
| 53 |
pytest tests |