Skip to content

Commit 7f40721

Browse files
codewizdaveclaude
andcommitted
ci: add GitHub Actions workflows for CI/CD
Add 4 separate GitHub Actions workflows: - lint.yml: Ruff linting and format checking - typecheck.yml: MyPy type checking with pandas-stubs - test.yml: Pytest with 80% coverage requirement - ci.yml: Complete quality gate combining all checks All workflows: - Trigger on push/PR to main and develop branches - Use Python 3.14 with uv package manager - Cache dependencies for faster builds - Enforce strict quality gates (block on failures) Coverage requirement set to 80% with Codecov integration. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent fe4183c commit 7f40721

4 files changed

Lines changed: 175 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
jobs:
10+
quality-gate:
11+
name: Quality Gate
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v1
20+
with:
21+
enable-cache: true
22+
cache-dependency-glob: "pyproject.toml"
23+
24+
- name: Set up Python
25+
run: uv python install 3.14
26+
27+
- name: Install dependencies
28+
run: uv sync --all-extras
29+
30+
- name: Install pandas-stubs
31+
run: uv pip install pandas-stubs
32+
33+
- name: Run ruff
34+
run: |
35+
uv run ruff check . --output-format=github
36+
37+
- name: Run ruff format check
38+
run: |
39+
uv run ruff format --check .
40+
41+
- name: Run mypy
42+
run: |
43+
uv run mypy excel_toolkit/
44+
45+
- name: Run tests with coverage
46+
run: |
47+
uv run pytest \
48+
tests/ \
49+
--cov=excel_toolkit \
50+
--cov-fail-under=80 \
51+
--cov-report=xml \
52+
--cov-report=term-missing
53+
54+
- name: Upload coverage to Codecov
55+
uses: codecov/codecov-action@v4
56+
with:
57+
file: ./coverage.xml
58+
fail_ci_if_error: false
59+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/lint.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
jobs:
10+
ruff:
11+
name: Ruff Linting
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v1
20+
with:
21+
enable-cache: true
22+
cache-dependency-glob: "pyproject.toml"
23+
24+
- name: Set up Python
25+
run: uv python install 3.14
26+
27+
- name: Install dependencies
28+
run: uv sync --all-extras
29+
30+
- name: Run ruff check
31+
run: |
32+
uv run ruff check . --output-format=github
33+
34+
- name: Run ruff format check
35+
run: |
36+
uv run ruff format --check .

.github/workflows/test.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
jobs:
10+
pytest:
11+
name: Pytest with Coverage
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v1
20+
with:
21+
enable-cache: true
22+
cache-dependency-glob: "pyproject.toml"
23+
24+
- name: Set up Python
25+
run: uv python install 3.14
26+
27+
- name: Install dependencies
28+
run: uv sync --all-extras
29+
30+
- name: Run tests with coverage
31+
run: |
32+
uv run pytest \
33+
tests/ \
34+
--cov=excel_toolkit \
35+
--cov-fail-under=80 \
36+
--cov-report=xml \
37+
--cov-report=term-missing \
38+
--verbose
39+
40+
- name: Upload coverage to Codecov
41+
uses: codecov/codecov-action@v4
42+
with:
43+
file: ./coverage.xml
44+
fail_ci_if_error: false
45+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/typecheck.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Type Check
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
jobs:
10+
mypy:
11+
name: MyPy Type Checking
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v1
20+
with:
21+
enable-cache: true
22+
cache-dependency-glob: "pyproject.toml"
23+
24+
- name: Set up Python
25+
run: uv python install 3.14
26+
27+
- name: Install dependencies
28+
run: uv sync --all-extras
29+
30+
- name: Install pandas-stubs
31+
run: uv pip install pandas-stubs
32+
33+
- name: Run mypy
34+
run: |
35+
uv run mypy excel_toolkit/

0 commit comments

Comments
 (0)