This repository was archived by the owner on Jun 13, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (88 loc) · 2.65 KB
/
Copy pathci.yml
File metadata and controls
108 lines (88 loc) · 2.65 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
103
104
105
106
107
108
name: CI Pipeline
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
workflow_dispatch:
env:
PYTHON_VERSION: "3.11"
jobs:
lint-and-typecheck:
name: Lint and Type Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install dependencies
run: |
uv sync --frozen
uv pip install ruff mypy types-PyYAML types-requests
- name: Run ruff linter
run: |
uv run ruff check src/ tests/ main.py
uv run ruff format --check src/ tests/ main.py
- name: Run mypy type checker
run: |
uv run mypy src/ main.py --ignore-missing-imports
test:
name: Run Tests
runs-on: ubuntu-latest
needs: lint-and-typecheck
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install dependencies
run: uv sync --frozen
- name: Run tests with coverage
run: |
uv run pytest tests/ -v --cov=src --cov-report=xml --cov-report=term
- name: Upload coverage reports
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
continue-on-error: true
validate-docker:
name: Validate Dockerfile
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Validate Dockerfile exists
run: |
if [ ! -f "Dockerfile" ]; then
echo "Dockerfile not found!"
exit 1
fi
- name: Lint Dockerfile
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: Dockerfile
continue-on-error: true
- name: Test Dockerfile build (single platform)
run: |
# Test that the Dockerfile can build successfully
# We only test a single platform build here for speed
docker build -t test-build:ci .
# Verify the image was created
docker images | grep test-build
# Clean up
docker rmi test-build:ci || true