Repository navigation
90 lines (77 loc) · 2.91 KB
/
Copy pathci.yml
File metadata and controls
90 lines (77 loc) · 2.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
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
name: CI
on:
workflow_call:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
secrets:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Install gitleaks
shell: bash
run: |
set -euo pipefail
version="8.30.0"
curl -sSL "https://github.com/gitleaks/gitleaks/releases/download/v${version}/gitleaks_${version}_linux_x64.tar.gz" -o /tmp/gitleaks.tar.gz
tar -xzf /tmp/gitleaks.tar.gz -C /tmp gitleaks
sudo mv /tmp/gitleaks /usr/local/bin/gitleaks
gitleaks version
- name: Secret scan
run: gitleaks detect --source . --verbose --redact
test:
needs: secrets
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
os: [ubuntu-latest, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install -e ".[dev]"
- name: Security audit
if: matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest'
run: |
pip install --upgrade pip setuptools
pip install pip-audit
pip-audit
- name: Public surface audit
if: matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest'
run: python scripts/audit_public_surface.py
- name: CITATION.cff DOI sync check (warn-only)
if: matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest'
run: python scripts/check_citation_doi.py
continue-on-error: true
- name: CHANGELOG duplicate-Unreleased-header check
if: matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest'
shell: bash
run: |
# release.py removes the [Unreleased] header on tagging (renamed to the new
# version) and does not add a fresh one back, so 0 is a normal post-release
# state. Only 2+ is the actual defect: a stray unbracketed
# "## Unreleased" coexisting with the bracketed one, or a literal duplicate.
count=$(grep -c '^## \[Unreleased\]' CHANGELOG.md || true)
if [ "$count" -gt 1 ]; then
echo "Found $count '## [Unreleased]' headers in CHANGELOG.md, expected at most 1."
exit 1
fi
- name: Run tests
run: pytest tests/ -v --tb=short --cov=src/factorforge --cov-report=xml --cov-report=term-missing
- name: Upload coverage to Codecov
if: matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v7
with:
files: ./coverage.xml
fail_ci_if_error: false