Skip to content

Commit c8cdc17

Browse files
authored
[examples] Add CI checks for code agent examples (#1280)
Since Code Agent examples depend on the actual Koog sources using Gradle's composite builds (just like `simple-examples`), changes in Koog might break these examples. Added a new CI configuration to check Code Agent compilation on PRs and pushes to `develop`
1 parent c0cbe6a commit c8cdc17

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Code Agent Examples
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ "main", "develop" ]
7+
pull_request:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
11+
# Cancel only when the run is not on main or develop
12+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop' }}
13+
14+
env:
15+
JAVA_VERSION: 17
16+
JAVA_DISTRIBUTION: 'corretto'
17+
18+
jobs:
19+
compilation:
20+
name: Compile ${{ matrix.step }}
21+
22+
runs-on: ubuntu-latest
23+
permissions:
24+
contents: read
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
step:
29+
- step-01-minimal-agent
30+
- step-02-add-execution-tool
31+
- step-03-add-observability
32+
- step-04-add-subagent
33+
34+
steps:
35+
- name: Configure Git
36+
run: |
37+
git config --global core.autocrlf input
38+
- uses: actions/checkout@v5
39+
- name: Set up JDK ${{ env.JAVA_VERSION }}
40+
uses: actions/setup-java@v5
41+
with:
42+
java-version: ${{ env.JAVA_VERSION }}
43+
distribution: ${{ env.JAVA_DISTRIBUTION }}
44+
cache: gradle
45+
46+
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
47+
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
48+
- name: Setup Gradle
49+
uses: gradle/actions/setup-gradle@v5
50+
with:
51+
# Cache downloaded JDKs/konan in addition to the default directories.
52+
gradle-home-cache-includes: |
53+
caches
54+
notifications
55+
jdks
56+
~/.konan/**
57+
58+
- name: Compile
59+
working-directory: ./examples/code-agent/${{ matrix.step }}
60+
run: ./gradlew assemble testClasses --stacktrace
61+
env:
62+
JAVA_OPTS: "-Xmx8g -Dfile.encoding=UTF-8 -Djava.awt.headless=true -Dkotlin.daemon.jvm.options=-Xmx6g"

0 commit comments

Comments
 (0)