| 1 |
name: Python build |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: [main] |
| 6 |
pull_request: |
| 7 |
|
| 8 |
jobs: |
| 9 |
build: |
| 10 |
runs-on: ubuntu-latest |
| 11 |
strategy: |
| 12 |
max-parallel: 8 |
| 13 |
matrix: |
| 14 |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] |
| 15 |
|
| 16 |
steps: |
| 17 |
- uses: actions/checkout@v3 |
| 18 |
|
| 19 |
- name: Set up Python ${{ matrix.python-version }} |
| 20 |
uses: actions/setup-python@v4 |
| 21 |
with: |
| 22 |
python-version: ${{ matrix.python-version }} |
| 23 |
architecture: x64 |
| 24 |
allow-prereleases: true |
| 25 |
- name: Install nox |
| 26 |
run: python -m pip install --upgrade nox |
| 27 |
- name: nox test |
| 28 |
# Little hack to detect major.minor version, matrix version not always compatible with nox expectation |
| 29 |
run: nox --python $(python -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")') --session test |
| 30 |
|
| 31 |
lint: |
| 32 |
runs-on: ubuntu-latest |
| 33 |
|
| 34 |
steps: |
| 35 |
- uses: actions/checkout@v3 |
| 36 |
- uses: actions/setup-python@v4 |
| 37 |
with: |
| 38 |
python-version: "3.11" |
| 39 |
- name: Install nox |
| 40 |
run: python -m pip install --upgrade nox |
| 41 |
- name: nox lint |
| 42 |
run: nox --session lint |
| 43 |
|
| 44 |
docs: |
| 45 |
runs-on: ubuntu-latest |
| 46 |
|
| 47 |
steps: |
| 48 |
- uses: actions/checkout@v3 |
| 49 |
- uses: actions/setup-python@v4 |
| 50 |
with: |
| 51 |
python-version: "3.11" |
| 52 |
- name: Install nox |
| 53 |
run: python -m pip install --upgrade nox |
| 54 |
- name: nox docs |
| 55 |
run: nox --session docs |