-
Notifications
You must be signed in to change notification settings - Fork 0
151 lines (120 loc) · 4.25 KB
/
Copy pathci.yml
File metadata and controls
151 lines (120 loc) · 4.25 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
148
149
150
151
name: CI
on:
push:
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
rust:
name: Rust checks
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@1.86.0
with:
components: clippy, rustfmt
- name: Cache Rust artifacts
uses: Swatinem/rust-cache@v2
- name: Show tool versions
run: |
rustc --version
cargo --version
docker --version
docker compose version
- name: Check formatting
run: cargo fmt --check
- name: Run unit and integration tests
run: cargo test --workspace
- name: Run clippy
run: cargo clippy --workspace -- -D warnings
fake-responses:
name: Fake Responses contracts
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@1.86.0
- name: Cache Rust artifacts
uses: Swatinem/rust-cache@v2
- name: Install shell test tools
run: sudo apt-get update && sudo apt-get install -y ripgrep
- name: Show tool versions
run: |
rustc --version
cargo --version
docker --version
docker compose version
- name: Validate default ChatGPT/Codex Envoy config
run: ./test/validate-openai-config.sh
- name: Run fake Responses regression
run: ./test/e2e-openai-responses-full.sh
- name: Capture docker compose state on failure
if: failure()
run: |
mkdir -p /tmp/codex-blackbox-ci
docker compose ps > /tmp/codex-blackbox-ci/compose-ps.txt 2>&1 || true
docker compose logs --no-color > /tmp/codex-blackbox-ci/compose-logs.txt 2>&1 || true
- name: Upload failure logs
if: failure()
uses: actions/upload-artifact@v4
with:
name: docker-compose-logs
path: /tmp/codex-blackbox-ci
- name: Tear down stack
if: always()
run: docker compose down -t 5 || true
installer:
name: Installer syntax
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Check install.sh syntax
run: sh -n install.sh
package-smoke:
name: Release package smoke
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@1.86.0
- name: Cache Rust artifacts
uses: Swatinem/rust-cache@v2
- name: Build release CLI
run: cargo build --release -p codex-blackbox-cli
- name: Package and verify CLI archive
shell: bash
run: |
set -euo pipefail
target="x86_64-unknown-linux-gnu"
archive="codex-blackbox-${target}.tar.gz"
staging="dist/${target}"
verify_dir="dist/verify"
mkdir -p "$staging" "$verify_dir"
cp target/release/codex-blackbox "$staging/codex-blackbox"
cp README.md LICENSE "$staging/"
tar -czf "dist/${archive}" -C "$staging" codex-blackbox README.md LICENSE
(cd dist && sha256sum "$archive" > "${archive}.sha256")
expected="$(awk '{print $1}' "dist/${archive}.sha256")"
actual="$(sha256sum "dist/${archive}" | awk '{print $1}')"
test "$expected" = "$actual"
tar -xzf "dist/${archive}" -C "$verify_dir"
"$verify_dir/codex-blackbox" --version
"$verify_dir/codex-blackbox" run --dry-run -- codex exec --sandbox read-only "release package smoke" > dist/package-smoke.txt
grep -q "Config files: not modified" dist/package-smoke.txt
grep -q "features.enable_request_compression=false" dist/package-smoke.txt
- name: Upload smoke package
uses: actions/upload-artifact@v4
with:
name: codex-blackbox-package-smoke
path: |
dist/codex-blackbox-x86_64-unknown-linux-gnu.tar.gz
dist/codex-blackbox-x86_64-unknown-linux-gnu.tar.gz.sha256
dist/package-smoke.txt