Skip to content

Commit 9677ca1

Browse files
cameronhopkinclaude
andcommitted
Add GitHub Actions CI/CD workflows
Configure automated pipelines: - CI workflow: lint, type check, security scan, tests - Multi-Python version testing (3.9-3.12) - Release workflow for PyPI publishing - Code coverage reporting Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 60fc24b commit 9677ca1

2 files changed

Lines changed: 113 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
python-version: ["3.9", "3.10", "3.11", "3.12"]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
cache: "pip"
25+
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install -e ".[dev]"
30+
31+
- name: Run linting
32+
run: |
33+
ruff check src/ tests/
34+
black --check src/ tests/
35+
36+
- name: Run type checking
37+
run: |
38+
mypy src/ --ignore-missing-imports
39+
40+
- name: Run security scan
41+
run: |
42+
bandit -r src/ -c pyproject.toml
43+
44+
- name: Run tests
45+
run: |
46+
pytest --cov=cmmc_validator --cov-report=xml --cov-report=term-missing
47+
48+
- name: Upload coverage
49+
uses: codecov/codecov-action@v4
50+
if: matrix.python-version == '3.11'
51+
with:
52+
file: ./coverage.xml
53+
fail_ci_if_error: false
54+
55+
build:
56+
runs-on: ubuntu-latest
57+
needs: test
58+
59+
steps:
60+
- uses: actions/checkout@v4
61+
62+
- name: Set up Python
63+
uses: actions/setup-python@v5
64+
with:
65+
python-version: "3.11"
66+
67+
- name: Install build tools
68+
run: |
69+
python -m pip install --upgrade pip
70+
pip install build twine
71+
72+
- name: Build package
73+
run: python -m build
74+
75+
- name: Check package
76+
run: twine check dist/*
77+
78+
- name: Upload artifacts
79+
uses: actions/upload-artifact@v4
80+
with:
81+
name: dist
82+
path: dist/

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Set up Python
15+
uses: actions/setup-python@v5
16+
with:
17+
python-version: "3.11"
18+
19+
- name: Install build tools
20+
run: |
21+
python -m pip install --upgrade pip
22+
pip install build twine
23+
24+
- name: Build package
25+
run: python -m build
26+
27+
- name: Publish to PyPI
28+
env:
29+
TWINE_USERNAME: __token__
30+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
31+
run: twine upload dist/*

0 commit comments

Comments
 (0)