-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (62 loc) · 1.74 KB
/
Copy pathci.yml
File metadata and controls
77 lines (62 loc) · 1.74 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
name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
lint-type-test:
name: Lint / Type / Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "0.5.11"
enable-cache: true
cache-dependency-glob: |
pyproject.toml
uv.lock
- name: Set up Python 3.12
run: uv python install 3.12
- name: Install dependencies (dev)
run: uv sync --dev
- name: Ruff — lint
run: uv run ruff check .
- name: Ruff — format check
run: uv run ruff format --check .
- name: Mypy
run: uv run mypy app
- name: Pytest (skip if no tests)
run: |
if [ -d tests ] && ls tests/test_*.py tests/**/test_*.py 2>/dev/null | grep -q .; then
uv run pytest
else
echo "tests/ 비어있음 → pytest skip"
fi
docker-build:
name: Docker build (smoke)
runs-on: ubuntu-latest
needs: lint-type-test
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: Build image (no push)
uses: docker/build-push-action@v6
with:
context: .
push: false
load: true
tags: glit-ai:ci-${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Smoke — import app inside image
run: |
docker run --rm --entrypoint python glit-ai:ci-${{ github.sha }} \
-c "import app.main; print('ok', app.main.app.title)"