Skip to content

Commit 12d7cff

Browse files
authored
ci: add GitHub Actions workflow for lint and smoke test (#309)
* ci: add GitHub Actions workflow for lint and smoke test Add CI pipeline with two jobs: - lint: ruff check with pyflakes rules (F) on v2/ directory, ignoring F401 (unused imports) for now, excluding auto-generated grpcauto directory - smoke-test: Python 3.9/3.11/3.13 matrix, verify module imports Closes #305 Signed-off-by: cxhello <caixiaohuichn@gmail.com> * ci: update Python matrix from 3.9 to 3.10+ Both branches use PEP 604 union type syntax (X | None) which requires Python 3.10+. Update smoke-test matrix to ['3.10', '3.12', '3.13']. Signed-off-by: cxhello <caixiaohuichn@gmail.com> * ci: scope trigger branches to master only Each branch maintains its own CI config with branch-specific triggers to avoid cross-branch workflow interference. Signed-off-by: cxhello <caixiaohuichn@gmail.com> --------- Signed-off-by: cxhello <caixiaohuichn@gmail.com>
1 parent 402f7ec commit 12d7cff

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-python@v5
15+
with:
16+
python-version: '3.13'
17+
- run: pip install ruff==0.15.5
18+
- run: ruff check --select F --ignore F401 --exclude "*/grpcauto/*" v2/
19+
20+
smoke-test:
21+
runs-on: ubuntu-latest
22+
strategy:
23+
matrix:
24+
python-version: ['3.10', '3.12', '3.13']
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: actions/setup-python@v5
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
- run: pip install -r requirements.txt
31+
- name: Smoke test v1 module
32+
if: hashFiles('nacos/__init__.py') != ''
33+
run: python -c "import nacos; print('v1 import ok')"
34+
env:
35+
PYTHONPATH: .
36+
- name: Smoke test v2 module
37+
run: python -c "import v2.nacos; print('v2 import ok')"
38+
env:
39+
PYTHONPATH: .

0 commit comments

Comments
 (0)