-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (48 loc) · 1.91 KB
/
Copy pathtest.yml
File metadata and controls
57 lines (48 loc) · 1.91 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
name: Tests
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
jobs:
test:
runs-on: ${{ matrix.os }}
# The suite runs in about a minute; anything approaching this is a hang,
# and without a bound a hung job occupies a runner for six hours.
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install package
run: pip install -e ".[dev]"
- name: Run Python tests
# faulthandler_timeout is stdlib-backed and adds no dependency: if any
# single test runs longer than three minutes it dumps that test's stack
# to the log, so a hang names itself instead of stalling silently.
run: pytest tests/ -v --tb=short -o faulthandler_timeout=180
- name: Run C unit tests (Linux/macOS only)
if: runner.os != 'Windows'
run: make test
- name: Smoke test CLI
run: |
echo "CASSLGIRRT" | python -m LZGraphs.cli decompose
python -m LZGraphs.cli --version
- name: Packaging smoke test (Linux, Python 3.12)
if: runner.os == 'Linux' && matrix.python-version == '3.12'
run: |
python -m pip install build
python -m build
python -m venv /tmp/lzg-sdist-venv
/tmp/lzg-sdist-venv/bin/pip install dist/*.tar.gz
/tmp/lzg-sdist-venv/bin/python -c "from LZGraphs import LZGraph; print('LZGraphs sdist OK')"
python -m venv /tmp/lzg-wheel-venv
/tmp/lzg-wheel-venv/bin/pip install dist/*.whl
/tmp/lzg-wheel-venv/bin/python -c "from LZGraphs import LZGraph; print('LZGraphs wheel OK')"