Merge pull request #159 from microsoft/colbylwilliams/colbylwilliams-… #416
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] | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| - run: npm ci | |
| - run: npm run typecheck | |
| - run: npm test | |
| rust: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: clients/rust | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: clients/rust | |
| - run: cargo clippy --workspace -- -D warnings | |
| - run: cargo test --workspace | |
| swift: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| - run: npm ci | |
| # Verify the committed Swift sources are in sync with the TypeScript | |
| # protocol definitions. If `npm run generate:swift` produces any diff, | |
| # the committed Generated/ files are stale. | |
| - name: Verify generated Swift is up to date | |
| run: | | |
| npm run generate:swift | |
| if ! git diff --quiet -- clients/swift/AgentHostProtocol; then | |
| echo "::error::Generated Swift sources are out of date. Run 'npm run generate:swift' and commit the result." | |
| git --no-pager diff -- clients/swift/AgentHostProtocol | |
| exit 1 | |
| fi | |
| - name: Build Swift package | |
| run: swift build | |
| - name: Test Swift package | |
| run: swift test | |
| kotlin: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| # Sanity-check the committed gradle-wrapper.jar against Gradle's | |
| # published checksums so a poisoned wrapper can't run arbitrary code | |
| # in CI. This is the standard Gradle hardening step recommended for | |
| # all public repos. | |
| - uses: gradle/actions/wrapper-validation@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| - uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: 17 | |
| - uses: gradle/actions/setup-gradle@v6 | |
| - run: npm ci | |
| # Verify the committed Kotlin sources are in sync with the TypeScript | |
| # protocol definitions. If `npm run generate:kotlin` produces any | |
| # diff (or new files), the committed generated files are stale. | |
| # We use `git status --porcelain` rather than `git diff` so a | |
| # newly-emitted file (untracked) also fails the check. | |
| - name: Verify generated Kotlin is up to date | |
| run: | | |
| npm run generate:kotlin | |
| if [ -n "$(git status --porcelain -- clients/kotlin)" ]; then | |
| echo "::error::Generated Kotlin sources are out of date. Run 'npm run generate:kotlin' and commit the result." | |
| git status --porcelain -- clients/kotlin | |
| git --no-pager diff -- clients/kotlin | |
| exit 1 | |
| fi | |
| - name: Build Kotlin package | |
| working-directory: clients/kotlin | |
| run: ./gradlew build --stacktrace | |
| typescript: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| - run: npm ci | |
| # The wire types under clients/typescript/src/types/ are generated | |
| # from the canonical types/ at the repo root and intentionally not | |
| # committed (avoids byte-for-byte duplication). Generate them | |
| # before installing/typechecking/testing the TS client. | |
| - name: Generate TypeScript client sources | |
| run: npm run generate:typescript | |
| - name: Install TypeScript client dependencies | |
| working-directory: clients/typescript | |
| run: npm ci | |
| - name: Typecheck TypeScript client | |
| working-directory: clients/typescript | |
| run: npm run typecheck | |
| - name: Test TypeScript client | |
| working-directory: clients/typescript | |
| run: npm test | |
| - name: Build TypeScript client | |
| working-directory: clients/typescript | |
| run: npm run build | |