Repository navigation
docs: update registry agents (#2306) #6267
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "ci-${{ github.ref }}" | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| msrv: | |
| name: Minimum supported Rust version | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 | |
| - name: Read MSRV from Cargo.toml | |
| id: msrv | |
| run: | | |
| msrv="$(sed -n 's/^rust-version[[:space:]]*=[[:space:]]*"\([^"]*\)".*/\1/p' agent-client-protocol-schema/Cargo.toml)" | |
| test -n "$msrv" | |
| echo "version=$msrv" >> "$GITHUB_OUTPUT" | |
| - name: Setup Rust | |
| uses: actions-rust-lang/setup-rust-toolchain@ecabd13d1c56bd1345c230e542e9144811ad706f | |
| with: | |
| toolchain: ${{ steps.msrv.outputs.version }} | |
| - name: Check with MSRV | |
| run: cargo check --all-targets --all-features --locked | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 | |
| - name: Use Node.js | |
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 | |
| with: | |
| node-version: latest | |
| cache: "npm" | |
| - name: Setup Rust | |
| uses: actions-rust-lang/setup-rust-toolchain@ecabd13d1c56bd1345c230e542e9144811ad706f | |
| with: | |
| toolchain: nightly,stable | |
| components: rustfmt,clippy | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Check formatting | |
| run: npm run format:check | |
| - name: Check for typos | |
| uses: crate-ci/typos@00f422f3b19c57bc6338715ebfe3316d38768461 | |
| with: | |
| config: ./typos.toml | |
| - name: Lint | |
| run: | | |
| cargo clippy | |
| cargo clippy -p agent-client-protocol-schema --all-targets --no-default-features --features unstable,unstable_protocol_v2,tracing | |
| cargo clippy --all-targets --all-features | |
| - name: Build | |
| run: cargo build --all-targets --all-features | |
| - name: Check docs.rs build | |
| env: | |
| RUSTDOCFLAGS: --cfg docsrs | |
| run: cargo +nightly doc -p agent-client-protocol-schema --all-features --no-deps | |
| - name: Run tests | |
| run: cargo test --all-features | |
| # The generator builds one schema per feature set, and `--all-features` | |
| # only selects the unstable v2 one, so test the other published schemas too. | |
| - name: Run schema generator tests for each published schema | |
| run: | | |
| cargo test -p schema-generator | |
| cargo test -p schema-generator --features unstable | |
| cargo test -p schema-generator --features unstable_protocol_v2 | |
| # Some schema tests check behavior that only applies when an unstable | |
| # feature such as `unstable_end_turn_token_usage` is off. | |
| - name: Run schema tests without every unstable feature | |
| run: | | |
| cargo test -p agent-client-protocol-schema --features unstable_protocol_v2 | |
| cargo test -p agent-client-protocol-schema --features unstable_subagents | |
| - name: Check generated files are up to date | |
| run: | | |
| npm run generate | |
| git diff --exit-code || (echo "Generated files are out of date. Run 'npm run generate' and commit the changes." && exit 1) | |
| rust-changes: | |
| name: Detect Rust changes | |
| runs-on: ubuntu-latest | |
| outputs: | |
| changed: ${{ steps.rust-changes.outputs.changed }} | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Check for Rust file changes | |
| id: rust-changes | |
| env: | |
| EVENT_NAME: ${{ github.event_name }} | |
| BASE_SHA: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }} | |
| HEAD_SHA: ${{ github.sha }} | |
| run: | | |
| if [ "$EVENT_NAME" = "workflow_dispatch" ]; then | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| if [ "$BASE_SHA" = "0000000000000000000000000000000000000000" ]; then | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| if git diff --name-only "$BASE_SHA" "$HEAD_SHA" | grep -Eq '(^|/)(Cargo\.toml|Cargo\.lock)$|\.rs$'; then | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "changed=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| feature-powerset: | |
| name: Feature powerset (${{ matrix.partition }}) | |
| needs: rust-changes | |
| if: needs.rust-changes.outputs.changed == 'true' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| partition: ["1/4", "2/4", "3/4", "4/4"] | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 | |
| with: | |
| persist-credentials: false | |
| - name: Setup Rust | |
| uses: actions-rust-lang/setup-rust-toolchain@ecabd13d1c56bd1345c230e542e9144811ad706f | |
| with: | |
| toolchain: stable | |
| - name: Install cargo-hack | |
| uses: taiki-e/install-action@9983c65e42da123ff25d1f78505eb6de315aa172 | |
| with: | |
| tool: cargo-hack | |
| - name: Check feature powerset | |
| # `unstable` is an aggregate alias for the individual unstable_* features, | |
| # so excluding it avoids duplicate combinations. Limit the powerset to | |
| # feature pairs to keep CI practical; the regular CI all-features build | |
| # still covers the all-on case. | |
| run: cargo hack --locked check --feature-powerset --exclude-features unstable --no-dev-deps --depth 2 --partition ${{ matrix.partition }} |