Rust build, test & lint #1119
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Rust | |
| run-name: Rust build, test & lint | |
| on: | |
| pull_request: | |
| merge_group: | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| kubernetes: | |
| runs-on: ubuntu-latest | |
| env: | |
| KUBECTL_VERSION: v1.36.2 | |
| KUBECTL_SHA256: 1e9045ec32bea85da43de85f0065358529ea7c7a152eca78154fba5b58c27d82 | |
| KUBECONFORM_VERSION: v0.7.0 | |
| KUBECONFORM_SHA256: c31518ddd122663b3f3aa874cfe8178cb0988de944f29c74a0b9260920d115d3 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Install pinned Kubernetes validators | |
| run: | | |
| curl --fail --location --silent --show-error \ | |
| "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl" \ | |
| --output "${RUNNER_TEMP}/kubectl" | |
| echo "${KUBECTL_SHA256} ${RUNNER_TEMP}/kubectl" | sha256sum --check | |
| chmod +x "${RUNNER_TEMP}/kubectl" | |
| curl --fail --location --silent --show-error \ | |
| "https://github.com/yannh/kubeconform/releases/download/${KUBECONFORM_VERSION}/kubeconform-linux-amd64.tar.gz" \ | |
| --output "${RUNNER_TEMP}/kubeconform.tar.gz" | |
| echo "${KUBECONFORM_SHA256} ${RUNNER_TEMP}/kubeconform.tar.gz" | sha256sum --check | |
| tar --extract --gzip --file "${RUNNER_TEMP}/kubeconform.tar.gz" --directory "${RUNNER_TEMP}" kubeconform | |
| - name: Render and validate Kubernetes manifests | |
| run: | | |
| set -o pipefail | |
| "${RUNNER_TEMP}/kubectl" kustomize deploy/kubernetes \ | |
| | "${RUNNER_TEMP}/kubeconform" \ | |
| -kubernetes-version 1.36.0 \ | |
| -strict \ | |
| -summary | |
| rust: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| env: | |
| CARGO_INCREMENTAL: "0" | |
| CARGO_PROFILE_DEV_DEBUG: "0" | |
| CARGO_PROFILE_TEST_DEBUG: "0" | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1 | |
| with: | |
| toolchain: 1.98.0 | |
| components: clippy, rustfmt | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 | |
| with: | |
| cache-bin: false | |
| - name: Check formatting | |
| run: cargo fmt --check | |
| - name: Run clippy | |
| run: cargo clippy --all-targets -- -D warnings | |
| - name: Run tests | |
| run: cargo test | |
| - name: Test Codex and Claude launcher contracts | |
| run: bash scripts/tests/agentic-launchers-test.sh | |
| - name: Test agentic CLI end to end | |
| run: python3 scripts/tests/agentic-cli-e2e-test.py | |
| embedded-code-interpreter: | |
| name: Embedded code interpreter | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| env: | |
| CARGO_INCREMENTAL: "0" | |
| CARGO_PROFILE_DEV_DEBUG: "0" | |
| CARGO_PROFILE_TEST_DEBUG: "0" | |
| ERYX_PRECOMPILE_INSTALL_ROOT: ${{ github.workspace }}/.ci/eryx-precompile | |
| XDG_CACHE_HOME: ${{ github.workspace }}/.ci/eryx-cache | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1 | |
| with: | |
| toolchain: 1.98.1 | |
| components: clippy | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 | |
| with: | |
| cache-bin: false | |
| cache-targets: false | |
| - name: Cache Eryx precompiler | |
| uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v4 | |
| with: | |
| path: ${{ env.ERYX_PRECOMPILE_INSTALL_ROOT }} | |
| key: eryx-precompile-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('Cargo.lock') }} | |
| - name: Add Eryx precompiler to PATH | |
| run: echo "${ERYX_PRECOMPILE_INSTALL_ROOT}/bin" >> "${GITHUB_PATH}" | |
| - name: Test Eryx runtime setup script | |
| run: bash scripts/tests/setup-eryx-runtime-test.sh | |
| - name: Prepare Eryx runtime | |
| run: ./scripts/setup-eryx-runtime.sh | |
| - name: Create private Eryx temporary directory | |
| run: install -d -m 700 "${RUNNER_TEMP}/eryx-tmp" | |
| - name: Run feature-enabled clippy | |
| env: | |
| TMPDIR: ${{ runner.temp }}/eryx-tmp | |
| run: | | |
| cargo clippy -p agentic-server-core --all-targets --features embedded-code-interpreter -- -D warnings | |
| cargo clippy -p agentic-server --all-targets --features embedded-code-interpreter -- -D warnings | |
| - name: Run feature-enabled tests | |
| env: | |
| TMPDIR: ${{ runner.temp }}/eryx-tmp | |
| run: | | |
| cargo test -p agentic-server-core --lib --features embedded-code-interpreter | |
| cargo test -p agentic-server-core --test code_interpreter_characterization_test --features embedded-code-interpreter | |
| cargo test -p agentic-server --bin agentic-server --features embedded-code-interpreter code_interpreter | |
| postgres: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:17-alpine@sha256:742f40ea20b9ff2ff31db5458d127452988a2164df9e17441e191f3b72252193 | |
| env: | |
| POSTGRES_DB: agentic_api_test | |
| POSTGRES_PASSWORD: postgres | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U postgres -d agentic_api_test" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 10 | |
| env: | |
| TEST_POSTGRES_URL: postgresql://postgres:postgres@localhost:5432/agentic_api_test?sslmode=disable | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1 | |
| with: | |
| toolchain: 1.98.0 | |
| - name: Cache cargo registry and build | |
| uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: cargo-postgres-${{ runner.os }}-${{ hashFiles('Cargo.lock') }} | |
| restore-keys: | | |
| cargo-postgres-${{ runner.os }}- | |
| cargo-${{ runner.os }}- | |
| - name: Verify PostgreSQL schema upgrades and validation | |
| run: cargo test -p agentic-server-core --lib -- --ignored --test-threads=1 | |
| - name: Verify PostgreSQL migrations and restart persistence | |
| run: cargo test -p agentic-server-core --test postgres_storage_integration -- --ignored --test-threads=1 | |
| - name: Verify PostgreSQL conversation CRUD and tenant isolation | |
| run: cargo test -p agentic-server-core --test postgres_tenant_isolation_test -- --ignored --test-threads=1 | |
| provider-upstream: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| provider: [dynamo, sglang] | |
| env: | |
| CARGO_INCREMENTAL: "0" | |
| CARGO_PROFILE_TEST_DEBUG: "0" | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1 | |
| with: | |
| toolchain: 1.98.0 | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 | |
| with: | |
| cache-bin: false | |
| - name: Validate recorded cassettes | |
| if: matrix.provider == 'dynamo' | |
| run: | | |
| python3 -m pip install 'PyYAML==6.0.3' | |
| python3 scripts/validate-cassettes.py | |
| - name: Replay provider upstream cassettes | |
| run: cargo test -p agentic-server-core --test ${{ matrix.provider }}_cassette_test |