Update Kotlin to 2.1.0, atomicfu to 0.17.0 #462
Workflow file for this run
This file contains 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
name: build | |
on: | |
pull_request: | |
paths-ignore: | |
- '**/*.md' | |
push: | |
branches: | |
- 'main' | |
paths-ignore: | |
- '**/*.md' | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
env: | |
CI: true | |
TERM: dumb | |
GRADLE_OPTS: >- | |
-Dorg.gradle.jvmargs="-Xmx3G -XX:MaxMetaspaceSize=1G -XX:SoftRefLRUPolicyMSPerMB=10 -XX:+UseParallelGC" | |
-Dorg.gradle.dependency.verification.console=verbose | |
KOTLIN_DAEMON_JVMARGS: >- | |
-Xmx1G -XX:MaxMetaspaceSize=320M -XX:SoftRefLRUPolicyMSPerMB=10 -XX:+UseParallelGC -XX:NewRatio=1 | |
ORG_GRADLE_PROJECT_verboseTest: true | |
permissions: | |
checks: write | |
pull-requests: write | |
jobs: | |
assemble: | |
name: Assemble, run tests on Linux | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
if: ${{ !contains(github.event.head_commit.message, '[ci skip]') }} | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'corretto' | |
java-version: '23' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
build-scan-publish: true | |
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service" | |
build-scan-terms-of-use-agree: "yes" | |
cache-encryption-key: ${{ secrets.GRADLEENCRYPTIONKEY }} | |
dependency-graph: generate | |
- name: Restore Kotlin Native Cache | |
uses: actions/cache/restore@v4 | |
with: | |
path: ~/.konan | |
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle.kts', 'buildSrc') }} | |
restore-keys: ${{ runner.os }}-konan- | |
- name: Assemble debug build, run tests | |
run: > | |
./gradlew -Pkotlin.daemon.jvmargs="${{ env.KOTLIN_DAEMON_JVMARGS }}" | |
build --stacktrace --scan | |
- name: Publish test results | |
uses: EnricoMi/publish-unit-test-result-action/macos@v2 | |
if: ${{ !cancelled() && (github.actor != 'dependabot[bot]') }} | |
with: | |
comment_mode: off | |
junit_files: '**/build/*test-results/**/*.xml' | |
check_name: "Linux test results" | |
- name: Bundle the test reports and outputs | |
if: failure() | |
run: > | |
find . \( | |
-type d -path '*/build/reports' -o -type d -path '*/build/outputs' | |
\) -print0 | |
| xargs -0 tar -c -I 'zstd -19 -T0' -f test-reports-linux.tar.zst | |
- name: Upload test reports | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: test-reports | |
path: test-reports-linux.tar.zst | |
- name: Save Kotlin Native Cache | |
uses: actions/cache/save@v4 | |
if: github.ref_name == 'main' | |
with: | |
path: ~/.konan | |
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle.kts', 'buildSrc') }} | |
test-macos: | |
name: Run tests on MacOS | |
runs-on: macos-latest | |
timeout-minutes: 60 | |
if: ${{ !contains(github.event.head_commit.message, '[ci skip]') }} | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'corretto' | |
java-version: '23' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
build-scan-publish: true | |
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service" | |
build-scan-terms-of-use-agree: "yes" | |
cache-encryption-key: ${{ secrets.GradleEncryptionKey }} | |
dependency-graph: generate | |
- name: Restore Kotlin Native Cache | |
uses: actions/cache/restore@v4 | |
with: | |
path: ~/.konan | |
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle.kts', 'buildSrc') }} | |
restore-keys: ${{ runner.os }}-konan- | |
- name: Assemble debug build, run tests | |
run: > | |
./gradlew -Pkotlin.daemon.jvmargs="${{ env.KOTLIN_DAEMON_JVMARGS }}" | |
check --stacktrace --scan | |
- name: Publish test results | |
uses: EnricoMi/publish-unit-test-result-action/macos@v2 | |
if: ${{ !cancelled() && (github.actor != 'dependabot[bot]') }} | |
with: | |
comment_mode: off | |
junit_files: '**/build/*test-results/**/*.xml' | |
check_name: "macOS test results" | |
- name: Bundle the test reports and outputs | |
if: failure() | |
run: > | |
find . \( | |
-type d -path '*/build/reports' -o -type d -path '*/build/outputs' | |
\) -print0 | |
| xargs -0 tar -c --zstd --options zstd:compression-level=20 -f test-reports-macos.tar.zst | |
- name: Upload test reports | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: test-reports-macos | |
path: test-reports-macos.tar.zst | |
- name: Save Kotlin Native Cache | |
uses: actions/cache/save@v4 | |
if: github.ref_name == 'main' | |
with: | |
path: ~/.konan | |
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle.kts', 'buildSrc') }} | |
test-windows: | |
name: Run tests on Windows | |
runs-on: windows-latest | |
timeout-minutes: 60 | |
if: ${{ !contains(github.event.head_commit.message, '[ci skip]') }} | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'corretto' | |
java-version: '23' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
build-scan-publish: true | |
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service" | |
build-scan-terms-of-use-agree: "yes" | |
cache-encryption-key: ${{ secrets.GradleEncryptionKey }} | |
dependency-graph: generate | |
- name: Restore Kotlin Native Cache | |
uses: actions/cache/restore@v4 | |
with: | |
path: ~/.konan | |
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle.kts', 'buildSrc') }} | |
restore-keys: ${{ runner.os }}-konan- | |
- name: Assemble debug build, run tests | |
run: > | |
./gradlew '-Pkotlin.daemon.jvmargs="${{ env.KOTLIN_DAEMON_JVMARGS }}"' | |
check --stacktrace --scan | |
- name: Publish test results | |
uses: EnricoMi/publish-unit-test-result-action/windows@v2 | |
if: ${{ !cancelled() && (github.actor != 'dependabot[bot]') }} | |
with: | |
comment_mode: off | |
junit_files: '**/build/*test-results/**/*.xml' | |
check_name: "Windows test results" | |
- name: Bundle the test reports and outputs | |
if: failure() | |
run: > | |
tar -c --zstd --options zstd:compression-level=20 -f test-reports-windows.tar.zst | |
--exclude "configuration-cache" | |
@(Get-ChildItem -Path . -Include "reports" -Directory -Name -Recurse) | |
- name: Upload test reports | |
uses: actions/upload-artifact@v4 | |
if: failure() | |
with: | |
name: test-reports-windows | |
path: test-reports-windows.tar.zst | |
- name: Save Kotlin Native Cache | |
uses: actions/cache/save@v4 | |
if: github.ref_name == 'main' | |
with: | |
path: ~/.konan | |
key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle.kts', 'buildSrc') }} | |
static-analysis: | |
name: Style check | |
runs-on: ubuntu-latest | |
permissions: | |
security-events: write | |
timeout-minutes: 60 | |
if: >- | |
!contains(github.event.head_commit.message, '[ci skip]') | |
&& github.actor != 'dependabot[bot]' | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'corretto' | |
java-version: '23' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
with: | |
build-scan-publish: true | |
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service" | |
build-scan-terms-of-use-agree: "yes" | |
cache-encryption-key: ${{ secrets.GradleEncryptionKey }} | |
dependency-graph: generate | |
- name: Run static code analyzers | |
run: > | |
./gradlew -Pkotlin.daemon.jvmargs="${{ env.KOTLIN_DAEMON_JVMARGS }}" | |
styleCheck --continue | |
- name: Uploads Detekt .sarif files to GitHub | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: ./build/reports/detekt/report.sarif | |
category: detekt | |
- name: Uploads Diktat .sarif files to GitHub | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: ./build/reports/diktat/diktat.sarif | |
category: diktat | |
- name: Bundle the build report | |
if: ${{ !cancelled() }} | |
run: > | |
tar -c -I 'zstd -19 -T0' -f lint-outputs.tar.zst build/reports | |
- name: Upload lint outputs | |
if: ${{ !cancelled() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: lint-outputs | |
path: lint-outputs.tar.zst |