Repository navigation
78 lines (61 loc) · 2.23 KB
/
Copy pathci.yml
File metadata and controls
78 lines (61 loc) · 2.23 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
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: read
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
# Quote versions so YAML doesn't parse e.g. 3.10 as a float (3.1).
python-version: ['3.13']
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install build/test dependencies
run: |
python -m pip install numpy pytest setuptools wheel scipy
- name: Install Python linter (ruff)
run: python -m pip install ruff
- name: Run Python linter (ruff)
run: |
# Ruff will use pyproject.toml config for exclusions
python -m ruff check .
- name: Setup Node for Markdown linting
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '18'
- name: Install markdownlint-cli
run: npm install -g markdownlint-cli
- name: Run Markdown linter
run: |
# Use repository-level config and exclude build/venv directories
markdownlint -c .markdownlint.json "**/*.md" \
--ignore "venv/**" \
--ignore "build/**" \
--ignore "htmlcov/**" \
--ignore "**/__pycache__/**" \
--ignore "**/node_modules/**"
- name: Build C extensions in-place
run: python3 setup.py build_ext --inplace
- name: Run tests
run: python -m pytest -q
- name: Quickstart smoke test
# Run the smoke test from the repo root; require PYTHONPATH so the
# in-place-built extension modules are importable.
run: |
PYTHONPATH=src python3 scripts/quickstart_smoke.py