feat(prompt): introduce HttpClient factories for LLMClient implementations #6736
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
| # This workflow uses actions that are not certified by GitHub. | |
| # They are provided by a third-party and are governed by | |
| # separate terms of service, privacy policy, and support | |
| # documentation. | |
| # This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle | |
| name: Checks | |
| on: | |
| push: | |
| branches: [ "main", "develop" ] | |
| pull_request: | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| # Cancel only when the run is not on main or develop | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' || github.ref != 'refs/heads/develop' }} | |
| env: | |
| JAVA_VERSION: 17 | |
| JAVA_DISTRIBUTION: 'corretto' | |
| JAVA_OPTS: "-Xms8g -Xmx8g -Dfile.encoding=UTF-8 -Djava.awt.headless=true -Dkotlin.daemon.jvm.options=-Xmx6g" | |
| jobs: | |
| changes: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: read | |
| outputs: | |
| koog-src: ${{ steps.filter.outputs.koog-src_any_modified }} | |
| docs: ${{ steps.filter.outputs.docs_any_modified }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: tj-actions/changed-files@7dee1b0c1557f278e5c7dc244927139d78c0e22a # v47.0.4 | |
| name: Check changed files | |
| id: filter | |
| with: | |
| write_output_files: 'true' | |
| files_yaml_from_source_file: .github/file-filters.yml | |
| - run: .github/scripts/print_changed_files.sh | |
| name: 'Print changed files' | |
| compilation: | |
| needs: changes | |
| if: ${{ needs.changes.outputs.koog-src == 'true' }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Configure Git | |
| run: | | |
| git config --global core.autocrlf input | |
| - 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 }} | |
| # Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies. | |
| # See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| - name: Assemble with Gradle Wrapper | |
| run: ./gradlew assemble ktlintCheck | |
| - name: TestClasses with Gradle Wrapper | |
| run: ./gradlew jvmTestClasses jsTestClasses | |
| docs: | |
| needs: changes | |
| if: ${{ needs.changes.outputs.docs == 'true' }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Configure Git | |
| run: | | |
| git config --global core.autocrlf input | |
| - uses: actions/checkout@v6 | |
| # Using setup-python on CI to install Python might be faster than with uv (official uv recommendation) | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version-file: "./docs/.python-version" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: "0.8.15" | |
| enable-cache: true | |
| - name: Build docs | |
| working-directory: ./docs | |
| run: | | |
| uv sync --frozen --all-extras | |
| uv run mkdocs build | |
| # Do not set individual matrix jobs (e.g., "tests (ubuntu-latest)") as required in GitHub branch protection. | |
| # Instead, use the summary job `tests-result` below, which properly reports status when tests are skipped. | |
| tests: | |
| needs: compilation | |
| if: ${{ needs.changes.outputs.koog-src == 'true' }} | |
| runs-on: ${{ matrix.os }} | |
| permissions: | |
| contents: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ ubuntu-latest, windows-latest, macos-latest ] | |
| steps: | |
| - name: Configure Git | |
| run: | | |
| git config --global core.autocrlf input | |
| - 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 }} | |
| # Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies. | |
| # See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| - name: JvmTest with Gradle Wrapper and Kover coverage | |
| if: matrix.os == 'ubuntu-latest' | |
| run: |- | |
| ./gradlew jvmTest :koverBinaryReport --continue | |
| - name: Check Split Packages | |
| if: matrix.os == 'ubuntu-latest' && github.event.pull_request.draft == false | |
| run: |- | |
| ./gradlew jvmJar && ./gradlew checkSplitPackages | |
| - name: JvmTest with Gradle Wrapper | |
| if: matrix.os != 'ubuntu-latest' | |
| run: ./gradlew jvmTest --continue | |
| - name: iosSimulatorArm64Test with Gradle Wrapper | |
| if: matrix.os == 'macos-latest' && github.event.pull_request.draft == false && github.repository == 'jetbrains/koog' | |
| run: ./gradlew linkIosSimulatorArm64 iosSimulatorArm64Test --continue | |
| - name: Archive coverage data | |
| if: matrix.os == 'ubuntu-latest' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: gradle-coverage-data.zip | |
| path: .qodana/code-coverage | |
| - name: Collect reports | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: reports-${{ matrix.os }} | |
| path: | | |
| **/build/reports/ | |
| - name: Publish Test Report | |
| uses: mikepenz/action-junit-report@v6 | |
| 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 | |
| # Matrix jobs don't report status when skipped, causing required checks to hang. | |
| # This summary job always checks `tests` jobs result and reports status for branch protection. | |
| tests-result: | |
| needs: [ changes, tests ] | |
| if: always() | |
| runs-on: ubuntu-slim | |
| steps: | |
| - name: Check tests status | |
| #language=bash | |
| run: | | |
| if [[ "${{ needs.tests.result }}" == "skipped" ]]; then | |
| echo "Tests skipped" | |
| exit 0 | |
| elif [[ "${{ needs.tests.result }}" != "success" ]]; then | |
| echo "Tests didn't finish successfully" | |
| exit 1 | |
| fi | |
| knit: | |
| needs: changes | |
| if: ${{ needs.changes.outputs.koog-src == 'true' || needs.changes.outputs.docs == 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-java@v5 | |
| with: | |
| distribution: ${{ env.JAVA_DISTRIBUTION }} | |
| java-version: ${{ env.JAVA_VERSION }} | |
| - uses: gradle/actions/setup-gradle@v5 | |
| - name: Verify code snippets in docs | |
| run: | | |
| echo "Starting knit generation..." | |
| FILES_BEFORE_KNIT=$(find docs/src/ -name "*.kt" 2>/dev/null | wc -l || echo "0") | |
| echo "Files before knit: $FILES_BEFORE_KNIT" | |
| ./gradlew :docs:knit | |
| FILES_AFTER_KNIT=$(find docs/src/ -name "*.kt" 2>/dev/null | wc -l || echo "0") | |
| echo "Files after knit: $FILES_AFTER_KNIT" | |
| KNIT_GENERATED_FILES=$((FILES_AFTER_KNIT - FILES_BEFORE_KNIT)) | |
| echo "Knit generated $KNIT_GENERATED_FILES files" | |
| echo "Starting assemble..." | |
| ./gradlew :docs:assemble | |
| dokka: | |
| needs: changes | |
| if: ${{ needs.changes.outputs.koog-src == 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-java@v5 | |
| with: | |
| distribution: ${{ env.JAVA_DISTRIBUTION }} | |
| java-version: ${{ env.JAVA_VERSION }} | |
| - uses: gradle/actions/setup-gradle@v5 | |
| - name: Generate API docs | |
| run: | | |
| ./gradlew dokkaGenerate |