Files
codex/third_party/voice/cargo-ci/setup/action.yml
T
Benjamin Carlsson e02a32cd51 Wire native voice dependencies into full Rust CI (#58719)
## What changed

- Build native voice SDK and runtime artifacts with Bazel for Linux GNU, macOS, and Windows on x64 and ARM64, then configure Cargo jobs to consume them. Keep musl builds in a separate job without these inputs.
- Validate artifact receipts against the target, source commit, and source manifest; verify SDK file hashes and relocate pkg-config metadata. Package the runtime and plugins with nextest archives and restore `CODEX_TEST_VOICE_RUNTIME` when running shards.
- Prepare native Windows voice tools for argument-comment linting and install ARM64 DotSlash on Windows ARM64. Reduce archive disk usage, bound Linux ARM64 build concurrency, and correct the JUnit artifact path.
- Recognize TLS errors wrapped directly in `io::Error`. Make TLS fallback fixtures select the native backend explicitly, allow the MCP test server's non-loopback address, and isolate skill-root tests from ancestor Git markers. Install `git` in remote test containers and filter MCP discovery assertions to POST requests.

## Testing

Add tests for relocated voice inputs, Windows ARM64 import libraries with host-native pkgconf, and rejection of mismatched receipts or corrupt SDK files. Extend untrusted-certificate coverage to an explicitly selected rustls backend.

GitOrigin-RevId: da3ff690b94906edc1f8f60a3c7feda1bf66134a
2026-11-01 15:50:50 +00:00

63 lines
2.8 KiB
YAML

name: Set up Cargo voice inputs
description: Use the target SDK and prepared runtime from this workflow run.
inputs:
target:
description: Cargo target triple
required: true
runs:
using: composite
steps:
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.12"
- name: Ensure CMake is available for the Opus build
if: runner.os == 'Linux'
shell: bash
run: command -v cmake || sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends cmake
- name: Ensure host pkg-config is available
if: runner.os == 'macOS'
shell: bash
run: command -v pkg-config || brew install pkgconf
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: cargo-voice-${{ inputs.target }}
path: ${{ runner.temp }}/cargo-voice-inputs
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
if: runner.os == 'Windows'
with:
# The x64 archive builder must execute x64 pkgconf even for ARM64.
name: cargo-voice-pkgconf-${{ runner.arch }}
path: ${{ runner.temp }}/cargo-voice-pkgconf
- name: Configure target libraries for Cargo
env:
VOICE_TARGET: ${{ inputs.target }}
shell: python
run: |
import json
import os
from pathlib import Path
import subprocess
import sys
import tarfile
import tempfile
temp = Path(os.environ["RUNNER_TEMP"])
target_dir = Path(os.environ["CARGO_TARGET_DIR"])
root = Path(tempfile.mkdtemp(prefix="cargo-voice-", dir=target_dir))
with tarfile.open(temp / "cargo-voice-inputs/cargo-voice.tar.gz") as archive:
archive.extractall(root, filter="data")
if os.name == "nt":
os.environ["VOICE_PKG_CONFIG"] = str(temp / "cargo-voice-pkgconf/pkgconf.exe")
script = Path(os.environ["GITHUB_WORKSPACE"]) / "third_party/voice/cargo_ci.py"
subprocess.run([sys.executable, str(script), "configure", "--root", str(root),
"--target", os.environ["VOICE_TARGET"]], check=True)
# nextest collects linked libraries itself. Include the runtime manifest
# and plugins too so the whole runtime can move with the test binaries.
relative = (root / "runtime").relative_to(target_dir).as_posix()
config = root / "nextest.toml"
config.write_text('[profile.default]\narchive.include = [{ path = ' + json.dumps(relative)
+ ', relative-to = "target", on-missing = "error" }]\n')
with open(os.environ["GITHUB_ENV"], "a", encoding="utf-8") as env:
print(f"CODEX_VOICE_NEXTEST_CONFIG={config}", file=env)
print(f"CODEX_VOICE_RUNTIME_RELATIVE={relative}", file=env)