Skip to content

Commit 0318e12

Browse files
committed
feat: add CI workflow, PR template, license, README updates, and hero image
1 parent 5ab5b49 commit 0318e12

5 files changed

Lines changed: 515 additions & 131 deletions

File tree

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!--- Provide a general summary of your changes in the Title above -->
2+
3+
## Description
4+
<!--- Describe your changes in detail -->
5+
6+
## Motivation and Context
7+
<!--- Why is this change required? What problem does it solve? -->
8+
9+
## Screenshots (if appropriate):
10+
11+
## Steps to reproduce (if appropriate):
12+
13+
## Types of changes
14+
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
15+
- [ ] Bug fix (non-breaking change which fixes an issue)
16+
- [ ] New feature (non-breaking change which adds functionality)
17+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
18+
19+
## Checklist:
20+
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
21+
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
22+
- [ ] My code follows the code style of this project.
23+
- [ ] My change requires documentation updates.
24+
- [ ] I have updated the documentation accordingly.
25+
- [ ] My change requires dependencies updates.
26+
- [ ] I have updated the dependencies accordingly.

.github/workflows/ci.yml

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ['3.12', '3.13']
15+
16+
services:
17+
# Optional: PostgreSQL service for more comprehensive testing
18+
# postgres:
19+
# image: postgres:15
20+
# env:
21+
# POSTGRES_PASSWORD: postgres
22+
# POSTGRES_DB: test_db
23+
# options: >-
24+
# --health-cmd pg_isready
25+
# --health-interval 10s
26+
# --health-timeout 5s
27+
# --health-retries 5
28+
# ports:
29+
# - 5432:5432
30+
31+
steps:
32+
- uses: actions/checkout@v4
33+
34+
- name: Install uv
35+
uses: astral-sh/setup-uv@v3
36+
with:
37+
version: 'latest'
38+
39+
- name: Set up Python ${{ matrix.python-version }}
40+
run: uv python install ${{ matrix.python-version }}
41+
42+
- name: Install dependencies
43+
run: |
44+
uv sync --frozen
45+
46+
- name: Create test environment file
47+
run: |
48+
cat > .env << EOF
49+
SECRET_KEY=test-secret-key-for-ci-only-not-secure
50+
DATABASE_URL=sqlite+aiosqlite:///./test.db
51+
DEBUG=true
52+
TESTING=true
53+
EOF
54+
55+
- name: Run database migrations
56+
run: |
57+
uv run alembic upgrade head
58+
59+
- name: Run tests with coverage
60+
run: |
61+
uv run pytest --cov=app --cov-report=xml --cov-report=term-missing
62+
63+
lint:
64+
runs-on: ubuntu-latest
65+
steps:
66+
- uses: actions/checkout@v4
67+
68+
- name: Install uv
69+
uses: astral-sh/setup-uv@v3
70+
with:
71+
version: 'latest'
72+
73+
- name: Set up Python
74+
run: uv python install 3.12
75+
76+
- name: Install dependencies
77+
run: |
78+
uv sync --frozen
79+
80+
- name: Run ruff linting
81+
run: |
82+
uv run ruff check app/
83+
84+
- name: Run ruff formatting check
85+
run: |
86+
uv run ruff format --check app/
87+
88+
- name: Run Black formatting check
89+
run: |
90+
uv run black --check app/
91+
92+
- name: Run isort import sorting check
93+
run: |
94+
uv run isort --check-only app/
95+
96+
type-check:
97+
runs-on: ubuntu-latest
98+
steps:
99+
- uses: actions/checkout@v4
100+
101+
- name: Install uv
102+
uses: astral-sh/setup-uv@v3
103+
with:
104+
version: 'latest'
105+
106+
- name: Set up Python
107+
run: uv python install 3.12
108+
109+
- name: Install dependencies
110+
run: |
111+
uv sync --frozen
112+
113+
- name: Run MyPy type checking
114+
run: |
115+
uv run mypy app/
116+
117+
security:
118+
runs-on: ubuntu-latest
119+
steps:
120+
- uses: actions/checkout@v4
121+
122+
- name: Install uv
123+
uses: astral-sh/setup-uv@v3
124+
with:
125+
version: 'latest'
126+
127+
- name: Set up Python
128+
run: uv python install 3.12
129+
130+
- name: Install dependencies
131+
run: |
132+
uv sync --frozen
133+
134+
- name: Run security checks with bandit
135+
run: |
136+
uv run pip install bandit
137+
uv run bandit -r app/ -f json -o bandit-report.json || true
138+
139+
- name: Upload security scan results
140+
uses: actions/upload-artifact@v4
141+
if: always()
142+
with:
143+
name: security-scan-results
144+
path: bandit-report.json
145+
146+
build:
147+
runs-on: ubuntu-latest
148+
needs: [test, lint, type-check]
149+
steps:
150+
- uses: actions/checkout@v4
151+
152+
- name: Install uv
153+
uses: astral-sh/setup-uv@v3
154+
with:
155+
version: 'latest'
156+
157+
- name: Set up Python
158+
run: uv python install 3.12
159+
160+
- name: Install dependencies
161+
run: |
162+
uv sync --frozen
163+
164+
- name: Create test environment file
165+
run: |
166+
cat > .env << EOF
167+
SECRET_KEY=test-secret-key-for-ci-only-not-secure
168+
DATABASE_URL=sqlite+aiosqlite:///./test.db
169+
DEBUG=false
170+
EOF
171+
172+
- name: Test application startup
173+
run: |
174+
uv run alembic upgrade head
175+
timeout 10s uv run uvicorn app.main:app --host 0.0.0.0 --port 8000 || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi
176+
177+
- name: Build package
178+
run: |
179+
uv build
180+
181+
- name: Upload build artifacts
182+
uses: actions/upload-artifact@v4
183+
with:
184+
name: dist-files
185+
path: dist/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Yash Agarwal
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)