-
Notifications
You must be signed in to change notification settings - Fork 22
49 lines (43 loc) · 1.36 KB
/
python-test.yml
File metadata and controls
49 lines (43 loc) · 1.36 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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: tests
on:
workflow_dispatch:
push:
pull_request:
permissions:
contents: read
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
architecture: ["x64", "x86"]
# Exclude Python 3.9 on Mac OS because of build failures with numpy 1.19 and 1.20
exclude:
- os: macos-latest
python-version: 3.9
steps:
- uses: actions/checkout@v4
- name: Install Ruff and lint code
uses: astral-sh/ruff-action@v3
with:
version: "latest"
- name: Format with Ruff
run: ruff format
- name: Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Test with tox
run: |
tox -f py${{ matrix.python-version }}