Repository navigation
67 lines (56 loc) · 1.73 KB
/
Copy pathci.yml
File metadata and controls
67 lines (56 loc) · 1.73 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
lint-and-test:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: latest
- name: Lint
run: make lint
- name: Test
run: make test
- name: Upload coverage report
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-xml
path: coverage.xml
if-no-files-found: ignore
- name: Detect integration test availability
id: integration
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
if [ -n "${OPENAI_API_KEY:-}" ]; then
echo "enabled=true" >> "$GITHUB_OUTPUT"
else
echo "enabled=false" >> "$GITHUB_OUTPUT"
fi
- name: Resolve bundled codex binary for integration test
if: ${{ steps.integration.outputs.enabled == 'true' }}
run: |
set -euo pipefail
bin=$(uv run --group dev python -c 'from codex._binary import bundled_codex_path; print(bundled_codex_path())')
test -x "$bin"
echo "CODEX_BINARY_PATH=$bin" >> "$GITHUB_ENV"
- name: Integration test (real codex binary)
if: ${{ steps.integration.outputs.enabled == 'true' }}
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
CODEX_INTEGRATION_TEST: "1"
run: uv run --group dev pytest -q tests/test_integration_real_binary.py