-
Notifications
You must be signed in to change notification settings - Fork 16
99 lines (78 loc) · 2.52 KB
/
ci.yml
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
92
93
94
95
96
97
98
99
name: CI
on:
pull_request:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: astral-sh/setup-uv@v3
- uses: pre-commit/action@v3.0.1
with:
extra_args: --all-files --hook-stage manual
- name: PyLint
run: uvx nox -s pylint -- --output-format=github
checks:
name: Check ${{ matrix.os }} Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.8', '3.10', '3.13']
include:
- {os: macos-13, python-version: '3.9'}
- {os: macos-latest, python-version: '3.13'}
- {os: windows-latest, python-version: '3.8'}
- {os: windows-latest, python-version: '3.13'}
steps:
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- uses: astral-sh/setup-uv@v3
- name: Install package
run: uv pip install --system -e .[test]
- name: Pytest
if: runner.os == 'Linux'
run: python -m pip install pytest-github-actions-annotate-failures
- name: Test package
run: python -m pytest ./tests --cov=src/decaylanguage --cov-report=xml
- name: Test coverage with Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Test docstrings with doctest
if: "runner.os == 'Linux' && matrix.python-version == 3.12"
run: python -m pytest --doctest-modules src/decaylanguage
notebooks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: astral-sh/setup-uv@v3
- name: Install dot
run: sudo apt-get install graphviz
- name: Install package
run: uv pip install --system -e .[test]
- name: Install notebook requirements
run: uv pip install --system nbconvert jupyter_client ipykernel pydot
- name: Run the notebooks inplace
run: jupyter nbconvert --execute --inplace notebooks/DecayLanguageDemo.ipynb notebooks/ExampleDecFileParsingWithLark.ipynb