Skip to content

Commit 16f7d55

Browse files
ImTotemclaude
andcommitted
fix(ci): use .env.example for CI environment and handle empty test suite
- Copy .env.example to .env before lint/test so Settings can load - Allow pytest exit code 5 (no tests collected) to pass CI - Add tests/ directory with testpaths config - Use SERVER_PORT secret instead of hardcoded port Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0ea4fd1 commit 16f7d55

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

.github/workflows/ci-cd.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
cache: "pip"
2323
cache-dependency-path: pyproject.toml
2424

25+
- run: cp .env.example .env
2526
- run: pip install -e ".[dev]" pyright
2627
- run: pyright src/
2728

@@ -38,8 +39,9 @@ jobs:
3839
cache: "pip"
3940
cache-dependency-path: pyproject.toml
4041

42+
- run: cp .env.example .env
4143
- run: pip install -e ".[dev]"
42-
- run: pytest -v --junitxml=test-results.xml
44+
- run: pytest -v --junitxml=test-results.xml || [ $? -eq 5 ]
4345

4446
- uses: EnricoMi/publish-unit-test-result-action@v2
4547
if: always()
@@ -66,7 +68,7 @@ jobs:
6668
host: ${{ secrets.SERVER_HOST }}
6769
username: ${{ secrets.SERVER_USER }}
6870
key: ${{ secrets.SERVER_SSH_KEY }}
69-
port: 22222
71+
port: ${{ secrets.SERVER_PORT }}
7072
source: "credentials/bcsd-api/backend/*"
7173
target: "~/BCSD_API"
7274
strip_components: 3
@@ -81,7 +83,7 @@ jobs:
8183
host: ${{ secrets.SERVER_HOST }}
8284
username: ${{ secrets.SERVER_USER }}
8385
key: ${{ secrets.SERVER_SSH_KEY }}
84-
port: 22222
86+
port: ${{ secrets.SERVER_PORT }}
8587
script: |
8688
cd ~/BCSD_API
8789
git pull origin main

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ dev = [
2525
"httpx>=0.27.0",
2626
]
2727

28+
[tool.pytest.ini_options]
29+
testpaths = ["tests"]
30+
2831
[tool.uvicorn]
2932
reload = true
3033
reload-excludes = ["infra/*", "docs/*", ".github/*", "*.md", "*.json"]

tests/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)