forked from JetBrains/koog
-
Notifications
You must be signed in to change notification settings - Fork 0
235 lines (197 loc) · 7.53 KB
/
Copy pathchecks.yml
File metadata and controls
235 lines (197 loc) · 7.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
# 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:
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:
compilation:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Configure Git
run: |
git config --global core.autocrlf input
- uses: actions/checkout@v5
- 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@v4
- name: Assemble with Gradle Wrapper
run: ./gradlew assemble ktlintCheck
- name: TestClasses with Gradle Wrapper
run: ./gradlew jvmTestClasses jsTestClasses
docs:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Configure Git
run: |
git config --global core.autocrlf input
- uses: actions/checkout@v5
# 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@v6
with:
version: "0.8.15"
enable-cache: true
- name: Build docs
working-directory: ./docs
run: |
uv sync --frozen --all-extras
uv run mkdocs build
tests:
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
steps:
- name: Configure Git
run: |
git config --global core.autocrlf input
- uses: actions/checkout@v5
- 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@v4
- 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@v4
with:
name: gradle-coverage-data.zip
path: .qodana/code-coverage
- name: Collect reports
if: always()
uses: actions/upload-artifact@v4
with:
name: reports-${{ matrix.os }}
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
qodana:
needs: [ tests ]
if: github.repository == 'jetbrains/koog' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork == false)
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
checks: write
steps:
- uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit
fetch-depth: 0 # a full history is required for pull request analysis
persist-credentials: false # https://github.com/orgs/community/discussions/151365
# Add Java setup step
- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v5
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}
cache: gradle
# Download the coverage data artifact
- name: Download coverage data
uses: actions/download-artifact@v4
with:
name: gradle-coverage-data.zip
path: .qodana/code-coverage
- name: 'Qodana Scan'
uses: JetBrains/qodana-action@v2025.2
with:
pr-mode: false
args: --baseline,qodana.sarif.json
use-caches: true
cache-default-branch-only: true
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN_1399872884 }}
QODANA_ENDPOINT: 'https://qodana.cloud'
knit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-java@v5
with:
distribution: ${{ env.JAVA_DISTRIBUTION }}
java-version: ${{ env.JAVA_VERSION }}
- uses: gradle/actions/setup-gradle@v4
- name: Generate and verify code examples
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:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v5
- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v5
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Verify Dokka
run: ./gradlew dokkaGenerate