Skip to content

Regenerate SDK client core from Otari OpenAPI spec #196

Regenerate SDK client core from Otari OpenAPI spec

Regenerate SDK client core from Otari OpenAPI spec #196

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo check --all-features
fmt:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- run: cargo fmt --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --all-features --all-targets -- -D warnings
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo test --all-features
# sdk-endpoints.txt is pushed here by the gateway's codegen workflow. The
# drift gate that compares it against the OpenAPI spec now runs in the
# gateway, against the spec from the same commit; these checks are the
# offline structural ones. See the header of tests/endpoint_coverage.rs.
- name: Endpoint-coverage manifest checks
run: cargo test --all-features --test endpoint_coverage
docs:
name: Docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo doc --all-features --no-deps
env:
RUSTDOCFLAGS: -D warnings
# Integration tests that require API keys
integration-test:
name: Integration Tests
runs-on: ubuntu-latest
# Run on main only when a gateway is wired up (the RUN_INTEGRATION repo
# variable is set to 'true'), or on a PR labeled 'run-integration'. Without
# a configured gateway the live tests self-skip (see tests/common), so this
# gate mainly avoids spending CI minutes on a guaranteed no-op.
if: (github.ref == 'refs/heads/main' && vars.RUN_INTEGRATION == 'true') || contains(github.event.pull_request.labels.*.name, 'run-integration')
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run integration tests
run: cargo test --all-features -- --ignored
env:
OTARI_API_KEY: ${{ secrets.OTARI_API_KEY }}
OTARI_API_BASE: ${{ secrets.OTARI_API_BASE }}
# Ensure minimum supported Rust version works
msrv:
name: MSRV (1.83)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Use stable to generate a lockfile that respects rust-version.
# The "fallback" resolver (stable since 1.84) picks older dep
# versions when newer ones exceed the workspace MSRV.
- uses: dtolnay/rust-toolchain@stable
- name: Generate MSRV-compatible lockfile
run: |
mkdir -p .cargo
printf '[resolver]\nincompatible-rust-versions = "fallback"\n' >> .cargo/config.toml
cargo generate-lockfile
- uses: dtolnay/rust-toolchain@1.83
- uses: Swatinem/rust-cache@v2
- run: cargo check --all-features --locked