-
Notifications
You must be signed in to change notification settings - Fork 63
102 lines (83 loc) · 2.67 KB
/
Copy pathci.yml
File metadata and controls
102 lines (83 loc) · 2.67 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
92
93
94
95
96
97
98
99
100
101
102
name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
jobs:
commitlint:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Validate conventional commits
run: |
python -m pip install --upgrade pip
pip install commitizen
cz check --rev-range "${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}"
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
exclude:
# Reduce matrix for faster CI
- os: windows-latest
python-version: '3.9'
- os: macos-latest
python-version: '3.9'
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Lint with ruff
run: ruff check src/ tests/
- name: Check formatting with black
run: black --check src/ tests/
- name: Type check with mypy
run: mypy src/
- name: Test with pytest
run: pytest tests/ --cov=src/withoutbg --cov-report=xml --run-real-processing
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install package and security tools
run: |
python -m pip install --upgrade pip
pip install --upgrade "setuptools>=83.0.0" # PYSEC-2026-3447
pip install -e ".[dev]"
pip install bandit[toml] pip-audit
- name: Audit dependencies for known vulnerabilities
run: pip-audit
- name: Run static security scan
run: bandit -r src/ -f json -o bandit-report.json || true
- name: Upload security results
uses: actions/upload-artifact@v4
with:
name: bandit-results
path: bandit-report.json