Skip to content

Refactor integration tests to use Testcontainers for TypeScript client and server #280

Refactor integration tests to use Testcontainers for TypeScript client and server

Refactor integration tests to use Testcontainers for TypeScript client and server #280

Workflow file for this run

name: Build
on:
workflow_dispatch:
pull_request:
branches: [ main ]
push:
branches: [ main ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
# Cancel only when the run is NOT on `main` branch
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
build:
runs-on: ${{ matrix.os }}
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest-xlarge
name: "macOS"
java-opts: "-Xmx8g -Dfile.encoding=UTF-8 -Djava.awt.headless=true -Dkotlin.daemon.jvm.options=-Xmx6g"
gradle-task: "clean ktlintCheck assemble macosArm64Test macosX64Test jvmTest koverLog koverHtmlReport"
test-type: "macos"
- os: ubuntu-latest
name: "Ubuntu"
java-opts: "-Xmx4g -Dfile.encoding=UTF-8 -Djava.awt.headless=true -Dkotlin.daemon.jvm.options=-Xmx3g"
gradle-task: "clean :kotlin-sdk-test:jvmTest"
test-type: "ubuntu"
env:
JAVA_OPTS: "${{ matrix.java-opts }}"
TS_SDK_IMAGE: "registry.jetbrains.team/p/grazi/grazie-infra-public/typescript-sdk-mcp@sha256:69f7762ec271b768b10e2d383e1dbc135c4df38a314a75c1ef35e9ff42276cb4"
steps:
- uses: actions/checkout@v5
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
with:
add-job-summary: 'always'
cache-read-only: true
- name: Build with Gradle
run: ./gradlew ${{ matrix.gradle-task }}
- name: Publish to Maven Local (macOS only)
if: matrix.test-type == 'macos'
run: ./gradlew :kotlin-sdk-core:publishToMavenLocal :kotlin-sdk-client:publishToMavenLocal :kotlin-sdk-server:publishToMavenLocal
- name: Build Kotlin-MCP-Client Sample
if: matrix.test-type == 'macos'
working-directory: ./samples/kotlin-mcp-client
run: ./../../gradlew clean build
- name: Build Kotlin-MCP-Server Sample
if: matrix.test-type == 'macos'
working-directory: ./samples/kotlin-mcp-server
run: ./../../gradlew clean build
- name: Build Weather-Stdio-Server Sample
if: matrix.test-type == 'macos'
working-directory: ./samples/weather-stdio-server
run: ./../../gradlew clean build
- name: Upload Reports
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: reports-${{ matrix.test-type }}
path: |
**/build/reports/
- name: Publish Test Report
uses: mikepenz/action-junit-report@v5
if: ${{ !cancelled() }} # always run even if the previous step fails
with:
report_paths: '**/test-results/**/TEST-*.xml'
detailed_summary: true
flaky_summary: true
include_empty_in_summary: false
include_time_in_summary: true
annotate_only: true
check_name: Test Report (${{ matrix.test-type }})
- name: Disable Auto-Merge on Fail
if: failure() && github.event_name == 'pull_request'
run: gh pr merge --disable-auto "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}