Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6 to 7. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v6...v7) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@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
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
sample:
|
|
- kotlin-mcp-client
|
|
- kotlin-mcp-server
|
|
- weather-stdio-server
|
|
|
|
name: Build Sample (${{ matrix.sample }})
|
|
timeout-minutes: 10
|
|
env:
|
|
JAVA_OPTS: "-Xmx8g -Dfile.encoding=UTF-8 -Djava.awt.headless=true -Dkotlin.daemon.jvm.options=-Xmx6g"
|
|
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 --no-daemon build
|
|
|
|
- name: Upload Reports
|
|
if: ${{ !cancelled() }}
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: reports-samples-${{ matrix.sample }}
|
|
path: |
|
|
**/build/reports/
|