-
Notifications
You must be signed in to change notification settings - Fork 0
147 lines (118 loc) · 3.49 KB
/
Copy pathci.yml
File metadata and controls
147 lines (118 loc) · 3.49 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
env:
PYTHON_VERSION: "3.13"
jobs:
lint:
name: Lint & Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: pip install -e ".[dev]"
- name: Ruff lint
run: python -m ruff check src/ tests/
- name: Ruff format check
run: python -m ruff format --check src/ tests/
test:
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install -e ".[dev]"
- name: Run tests
run: python -m pytest tests/ --cov=flowboard --cov-report=xml -v --tb=short --junitxml=test-results.xml
- name: i18n coverage check
run: |
python -c "
import json, sys
en = set(json.load(open('src/flowboard/i18n/en.json')).keys())
pl = set(json.load(open('src/flowboard/i18n/pl.json')).keys())
missing = en - pl
for k in sorted(missing):
print(f'Missing in pl.json: {k}')
sys.exit(1 if missing else 0)
"
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-py${{ matrix.python-version }}
path: test-results.xml
build:
name: Build Package
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install build tools
run: pip install build
- name: Build wheel
run: python -m build
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
verify-install:
name: Verify Installed Package
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Download built wheel
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Install from wheel (not editable)
run: pip install dist/*.whl
- name: Verify CLI entrypoint
run: |
which flowboard
flowboard version
- name: Generate demo dashboard
run: |
mkdir -p output
flowboard demo --output output/demo.html
test -f output/demo.html
docker:
name: Docker Build & Smoke Test
runs-on: ubuntu-latest
needs: [test]
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Build Docker image
run: docker build -t flowboard:latest .
- name: Smoke test container
run: |
docker run -d --name fb-test -p 8084:8084 flowboard:latest serve --host 0.0.0.0 --port 8084
sleep 5
curl -sf http://localhost:8084/health/live || (docker logs fb-test && exit 1)
docker stop fb-test