Skip to content

Commit 9e0cb4e

Browse files
committed
fix(ci): fetch codex binary for autoreview
1 parent 3326e63 commit 9e0cb4e

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/codex-autoreview.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@ jobs:
2525
- uses: actions/checkout@v4
2626
with:
2727
fetch-depth: 0
28+
- name: Install Codex binary fetch dependencies
29+
run: python3 -m pip install zstandard
30+
- name: Fetch bundled codex binary
31+
env:
32+
CODEX_BINARY_RELEASE_TAG: ${{ vars.CODEX_BINARY_RELEASE_TAG || 'rust-v0.122.0' }}
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
run: |
35+
set -euo pipefail
36+
python3 scripts/fetch_codex_binary.py \
37+
--release-tag "$CODEX_BINARY_RELEASE_TAG" \
38+
--target-triple x86_64-unknown-linux-musl
39+
test -x codex/vendor/x86_64-unknown-linux-musl/codex/codex
2840
- name: Codex autonomous review
2941
uses: gersmann/codex-review-action@v1
3042
with:
@@ -44,6 +56,18 @@ jobs:
4456
- uses: actions/checkout@v4
4557
with:
4658
fetch-depth: 0
59+
- name: Install Codex binary fetch dependencies
60+
run: python3 -m pip install zstandard
61+
- name: Fetch bundled codex binary
62+
env:
63+
CODEX_BINARY_RELEASE_TAG: ${{ vars.CODEX_BINARY_RELEASE_TAG || 'rust-v0.122.0' }}
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
run: |
66+
set -euo pipefail
67+
python3 scripts/fetch_codex_binary.py \
68+
--release-tag "$CODEX_BINARY_RELEASE_TAG" \
69+
--target-triple x86_64-unknown-linux-musl
70+
test -x codex/vendor/x86_64-unknown-linux-musl/codex/codex
4771
- name: Codex autonomous edits
4872
uses: gersmann/codex-review-action@v1
4973
with:

tests/test_release_workflows.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ def test_binary_fetch_workflows_default_to_pinned_codex_release() -> None:
99
for workflow_path in (
1010
Path(".github/workflows/ci.yml"),
1111
Path(".github/workflows/release-published.yml"),
12+
Path(".github/workflows/codex-autoreview.yml"),
1213
):
1314
workflow = workflow_path.read_text()
1415

@@ -38,3 +39,14 @@ def test_release_workflow_rejects_pypi_oversized_files_before_publish() -> None:
3839
assert workflow.index("Verify PyPI file size limit") < workflow.index(
3940
"pypa/gh-action-pypi-publish"
4041
)
42+
43+
44+
def test_autoreview_workflow_fetches_codex_binary_before_action() -> None:
45+
workflow = Path(".github/workflows/codex-autoreview.yml").read_text()
46+
47+
assert workflow.count("Fetch bundled codex binary") == 2
48+
assert workflow.count("--target-triple x86_64-unknown-linux-musl") == 2
49+
assert workflow.count("test -x codex/vendor/x86_64-unknown-linux-musl/codex/codex") == 2
50+
assert workflow.index("Fetch bundled codex binary") < workflow.index(
51+
"gersmann/codex-review-action@v1"
52+
)

0 commit comments

Comments
 (0)