Update to Kotlin 2 #451
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: Tests | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
file-changes: | |
runs-on: ubuntu-latest | |
outputs: | |
any: ${{ steps.check.outputs.any_changed }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
fetch-depth: 0 | |
- name: Get changed files | |
id: check | |
uses: tj-actions/changed-files@v44 | |
with: | |
files: | | |
.github/workflows/tests.yml | |
gradle/libs.versions.toml | |
gradle/kotlin-js-store/** | |
**/*.kt | |
**/*.kts | |
tests: | |
strategy: | |
matrix: | |
os: [ macos-latest, ubuntu-latest, windows-latest ] | |
runs-on: ${{ matrix.os }} | |
needs: [ file-changes ] | |
if: needs.file-changes.outputs.any == 'true' | |
steps: | |
- uses: msys2/setup-msys2@v2 | |
if: startsWith(matrix.os, 'windows') | |
with: | |
msystem: MINGW64 | |
update: true | |
- name: Disable Visual Studio | |
if: startsWith(matrix.os, 'windows') | |
run: move "C:\Program Files\Microsoft Visual Studio" "C:\Program Files\Microsoft Visual Studio2" | |
- name: Install libcurl | |
if: startsWith(matrix.os, 'ubuntu') | |
run: sudo apt install libcurl4-openssl-dev | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: 17 | |
- name: Cache Build files | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.konan | |
~/.gradle | |
%USERPROFILE%\.gradle | |
%USERPROFILE%\.konan | |
key: ${{ runner.os }}-${{ hashFiles('gradle.properties') }} | |
- uses: gradle/gradle-build-action@v3 | |
name: Test Apple Targets | |
if: startsWith(matrix.os, 'macos') | |
with: | |
arguments: linkMacosX64 #:ktpack:macosX64Test :ktpack-cli-tests:macosX64Test | |
- uses: gradle/gradle-build-action@v3 | |
name: Test Linux Target | |
if: startsWith(matrix.os, 'ubuntu') | |
env: | |
KTPACK_PATH: /home/runner/work/ktpack | |
with: | |
arguments: linkLinuxX64 #:ktpack:linuxX64Test :ktpack-cli-tests:linuxX64Test | |
- uses: gradle/gradle-build-action@v3 | |
name: Test Windows Target | |
env: | |
GRADLE_OPTS: -Dorg.gradle.daemon=false | |
if: startsWith(matrix.os, 'windows') | |
with: | |
arguments: linkWindowsX64 #:ktpack:windowsX64Test :ktpack-cli-tests:windowsX64Test | |
- name: Publish Test Reports | |
uses: mikepenz/action-junit-report@v4 | |
if: always() | |
with: | |
report_paths: '**/TEST-*.xml' | |
- name: Archive test reports | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: test-reports | |
path: '**/build/reports/tests/**' |