Repository navigation
91 lines (72 loc) · 2.02 KB
/
Copy pathpython_tests.yml
File metadata and controls
91 lines (72 loc) · 2.02 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Run Python tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.13"
- name: Installing Ruff
run: python -m pip install ruff==0.17.0
- name: Checking with Ruff
run: ruff check --output-format=github .
- name: Checking format with Ruff
run: ruff format --check .
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 20
# Python 3.15 is not tested: vtk (pyvista) does not publish wheels for it yet, so `import pymcnp` fails.
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v7
- name: Setting Up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Upgrading pip
run: python -m pip install --upgrade pip
- name: Installing packages
run: python -m pip install -e .[dev,docs,test]
- name: Testing with PyTest
run: python -m pytest
package:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-python@v7
with:
python-version: "3.13"
- name: Building the package
run: |
python -m pip install build twine
python -m build
python -m twine check dist/*
docs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-python@v7
with:
python-version: "3.13"
- name: Installing packages
run: python -m pip install -e .[docs]
- name: Building the documentation
run: python -m sphinx -W --keep-going -b html docs/source docs/build/html