- Remove redundant Gradle flags, env vars, and unused settings across all workflows - Minimize GitHub Actions permissions to least-privilege - Drop Windows build matrix (JVM tests covered by Linux) - Simplify CodeQL workflow (remove matrix, unused permissions, stale triggers) - Clean up gradle.properties (remove unused KMP settings) ## How Has This Been Tested? <!-- Have you tested this in a real application? Which scenarios were tested? --> ## Breaking Changes — ## Types of changes - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update ## Checklist - [x] I have read the [MCP Documentation](https://modelcontextprotocol.io) - [x] My code follows the repository's style guidelines - [x] New and existing tests pass locally - [ ] I have added appropriate error handling - [ ] I have added or updated documentation as needed --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
64 lines
1.6 KiB
YAML
64 lines
1.6 KiB
YAML
name: Build Samples
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
branches: [ main ]
|
|
paths:
|
|
- 'samples/**'
|
|
push:
|
|
branches: [ main ]
|
|
paths:
|
|
- 'samples/**'
|
|
|
|
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' }}
|
|
|
|
env:
|
|
JAVA_VERSION: 21
|
|
JAVA_DISTRIBUTION: temurin
|
|
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
sample:
|
|
- kotlin-mcp-client
|
|
- kotlin-mcp-server
|
|
- simple-streamable-server
|
|
- weather-stdio-server
|
|
|
|
name: Build Sample (${{ matrix.sample }})
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Set up JDK ${{ env.JAVA_VERSION }}
|
|
uses: actions/setup-java@v5
|
|
with:
|
|
java-version: ${{ env.JAVA_VERSION }}
|
|
distribution: ${{ env.JAVA_DISTRIBUTION }}
|
|
|
|
- name: Setup Gradle
|
|
uses: gradle/actions/setup-gradle@v5
|
|
with:
|
|
validate-wrappers: true
|
|
add-job-summary: 'always'
|
|
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
|
|
|
|
- name: "Build Sample: ${{ matrix.sample }}"
|
|
working-directory: ./samples/${{ matrix.sample }}
|
|
run: ./gradlew build
|
|
|
|
- name: Upload Reports
|
|
if: failure()
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: reports-samples-${{ matrix.sample }}
|
|
path: |
|
|
**/build/reports/
|