From abfc74c221c876bed9859cb7fdc009d6f879b802 Mon Sep 17 00:00:00 2001 From: sstone Date: Tue, 17 Sep 2024 17:12:06 +0200 Subject: [PATCH 1/3] Update CI scripts --- .github/workflows/release.yml | 34 +++++++++++++++++++++++-------- .github/workflows/snapshot.yml | 37 +++++++++++++++++++++++++--------- .github/workflows/test.yml | 13 ++++++------ 3 files changed, 60 insertions(+), 24 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9847fe6..6f7fe1e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,13 +17,13 @@ jobs: with: submodules: 'true' - name: Cached Konan - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.konan key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} restore-keys: ${{ runner.os }}-konan- - name: Cached Gradle - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.gradle key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} @@ -36,7 +36,7 @@ jobs: echo "ANDROID_NDK_VERSION=25.2.9519653" >> $GITHUB_ENV - name: Cached Android NDK if: matrix.os != 'windows-latest' - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ format('{0}/ndk/{1}', env.ANDROID_HOME, env.ANDROID_NDK_VERSION) }} key: ${{ runner.os }}-android-ndk-${{ env.ANDROID_NDK_VERSION }} @@ -47,7 +47,7 @@ jobs: rm.exe "C:/WINDOWS/system32/bash.EXE" - name: Install Automake if: matrix.os == 'macOS-latest' - run: brew install automake + run: brew install automake libtool - name: Install Automake (windows) if: matrix.os == 'windows-latest' uses: msys2/setup-msys2@v2 @@ -69,9 +69,10 @@ jobs: run: | echo "skip.android=true" > local.properties - name: Set up JDK 11 - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: java-version: 11 + distribution: 'adopt' - name: Check JVM if: matrix.os != 'windows-latest' run: ./gradlew jvmTest @@ -112,10 +113,27 @@ jobs: run: | mkdir -p maven-local/release cp -r ~/.m2/repository/* maven-local/release - - name: Upload artifacts - uses: actions/upload-artifact@v2 + - name: Upload linux artifacts + if: matrix.os == 'ubuntu-latest' + uses: actions/upload-artifact@v4 + with: + name: release-linux + path: | + maven-local + !maven-local/**/maven-metadata-local.xml + - name: Upload macos artifacts + if: matrix.os == 'macOS-latest' + uses: actions/upload-artifact@v4 with: - name: release + name: release-macos path: | maven-local !maven-local/**/maven-metadata-local.xml + - name: Upload windows artifacts + if: matrix.os == 'windows-latest' + uses: actions/upload-artifact@v4 + with: + name: release-windows + path: | + maven-local + !maven-local/**/maven-metadata-local.xml \ No newline at end of file diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index f6ba47d..2080e99 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -22,17 +22,17 @@ jobs: os: [ubuntu-latest, macOS-latest, windows-latest] steps: - name: Check out - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: 'true' - name: Cached Konan - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.konan key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} restore-keys: ${{ runner.os }}-konan- - name: Cached Gradle - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.gradle key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} @@ -45,7 +45,7 @@ jobs: echo "ANDROID_NDK_VERSION=25.2.9519653" >> $GITHUB_ENV - name: Cached Android NDK if: matrix.os != 'windows-latest' - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ format('{0}/ndk/{1}', env.ANDROID_HOME, env.ANDROID_NDK_VERSION) }} key: ${{ runner.os }}-android-ndk-${{ env.ANDROID_NDK_VERSION }} @@ -56,7 +56,7 @@ jobs: rm.exe "C:/WINDOWS/system32/bash.EXE" - name: Install Automake if: matrix.os == 'macOS-latest' - run: brew install automake + run: brew install automake libtool - name: Install Automake (windows) if: matrix.os == 'windows-latest' uses: msys2/setup-msys2@v2 @@ -78,9 +78,10 @@ jobs: run: | echo "skip.android=true" > local.properties - name: Set up JDK 11 - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: java-version: 11 + distribution: 'adopt' - name: Check JVM if: matrix.os != 'windows-latest' run: ./gradlew jvmTest @@ -121,11 +122,27 @@ jobs: run: | mkdir -p maven-local/snapshot cp -r ~/.m2/repository/* maven-local/snapshot - - name: Upload artifacts - uses: actions/upload-artifact@v2 + - name: Upload linux artifacts + if: matrix.os == 'ubuntu-latest' + uses: actions/upload-artifact@v4 with: - name: snapshot + name: snapshot-linux path: | maven-local !maven-local/**/maven-metadata-local.xml - + - name: Upload macos artifacts + if: matrix.os == 'macOS-latest' + uses: actions/upload-artifact@v4 + with: + name: snapshot-macos + path: | + maven-local + !maven-local/**/maven-metadata-local.xml + - name: Upload windows artifacts + if: matrix.os == 'windows-latest' + uses: actions/upload-artifact@v4 + with: + name: snapshot-windows + path: | + maven-local + !maven-local/**/maven-metadata-local.xml \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fc3a042..3be8f28 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,17 +28,17 @@ jobs: os: [ubuntu-latest, macOS-latest, windows-latest] steps: - name: Check out - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: 'true' - name: Cached Konan - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.konan key: ${{ runner.os }}-konan-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} restore-keys: ${{ runner.os }}-konan- - name: Cached Gradle - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ~/.gradle key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} @@ -51,7 +51,7 @@ jobs: echo "ANDROID_NDK_VERSION=25.2.9519653" >> $GITHUB_ENV - name: Cached Android NDK if: matrix.os != 'windows-latest' - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ format('{0}/ndk/{1}', env.ANDROID_HOME, env.ANDROID_NDK_VERSION) }} key: ${{ runner.os }}-android-ndk-${{ env.ANDROID_NDK_VERSION }} @@ -62,7 +62,7 @@ jobs: rm.exe "C:/WINDOWS/system32/bash.EXE" - name: Install Automake if: matrix.os == 'macOS-latest' - run: brew install automake + run: brew install automake libtool - name: Install Automake (windows) if: matrix.os == 'windows-latest' uses: msys2/setup-msys2@v2 @@ -84,9 +84,10 @@ jobs: run: | echo "skip.android=true" > local.properties - name: Set up JDK 11 - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: java-version: 11 + distribution: 'adopt' - name: Check JVM if: matrix.os != 'windows-latest' run: ./gradlew jvmTest From 86e9a90c147e18d8b09890bb5f6a43c1abe793f3 Mon Sep 17 00:00:00 2001 From: sstone Date: Tue, 17 Sep 2024 18:05:12 +0200 Subject: [PATCH 2/3] CI: use jdk 17 --- .github/workflows/release.yml | 2 +- .github/workflows/snapshot.yml | 2 +- .github/workflows/test.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6f7fe1e..7d23027 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -71,7 +71,7 @@ jobs: - name: Set up JDK 11 uses: actions/setup-java@v4 with: - java-version: 11 + java-version: 17 distribution: 'adopt' - name: Check JVM if: matrix.os != 'windows-latest' diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 2080e99..a73748a 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -80,7 +80,7 @@ jobs: - name: Set up JDK 11 uses: actions/setup-java@v4 with: - java-version: 11 + java-version: 17 distribution: 'adopt' - name: Check JVM if: matrix.os != 'windows-latest' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3be8f28..af2cb06 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -86,7 +86,7 @@ jobs: - name: Set up JDK 11 uses: actions/setup-java@v4 with: - java-version: 11 + java-version: 17 distribution: 'adopt' - name: Check JVM if: matrix.os != 'windows-latest' From d424763dc450f2263e55f22fbe6dadea15419b13 Mon Sep 17 00:00:00 2001 From: sstone Date: Tue, 17 Sep 2024 18:28:52 +0200 Subject: [PATCH 3/3] CI: run Android tests on ubuntu --- .github/workflows/release.yml | 10 ++++++++-- .github/workflows/snapshot.yml | 10 ++++++++-- .github/workflows/test.yml | 8 +++++++- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7d23027..78874b3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,6 +16,12 @@ jobs: uses: actions/checkout@v2 with: submodules: 'true' + - name: Enable KVM + if: matrix.os == 'ubuntu-latest' + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm - name: Cached Konan uses: actions/cache@v4 with: @@ -89,7 +95,7 @@ jobs: shell: bash run: ./gradlew iosX64Test - name: Check Android - if: matrix.os == 'macOS-latest' + if: matrix.os == 'ubuntu-latest' uses: reactivecircus/android-emulator-runner@v2 with: api-level: 27 @@ -100,7 +106,7 @@ jobs: - name: Publish Linux if: matrix.os == 'ubuntu-latest' shell: bash - run: ./gradlew publishLinuxX64PublicationToMavenLocal :jni:jvm:linux:publishJvmPublicationToMavenLocal + run: ./gradlew publishAndroidPublicationToMavenLocal publishLinuxX64PublicationToMavenLocal :jni:jvm:linux:publishJvmPublicationToMavenLocal - name: Publish Windows if: matrix.os == 'windows-latest' shell: msys2 {0} diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index a73748a..6cbaf61 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -25,6 +25,12 @@ jobs: uses: actions/checkout@v4 with: submodules: 'true' + - name: Enable KVM + if: matrix.os == 'ubuntu-latest' + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm - name: Cached Konan uses: actions/cache@v4 with: @@ -98,7 +104,7 @@ jobs: shell: bash run: ./gradlew iosX64Test - name: Check Android - if: matrix.os == 'macOS-latest' + if: matrix.os == 'ubuntu-latest' uses: reactivecircus/android-emulator-runner@v2 with: api-level: 27 @@ -109,7 +115,7 @@ jobs: - name: Publish Linux if: matrix.os == 'ubuntu-latest' shell: bash - run: ./gradlew publishLinuxX64PublicationToMavenLocal :jni:jvm:linux:publishJvmPublicationToMavenLocal -PsnapshotNumber=${{ github.run_number }} -PgitRef=${{ github.ref }} + run: ./gradlew publishAndroidPublicationToMavenLocal publishLinuxX64PublicationToMavenLocal :jni:jvm:linux:publishJvmPublicationToMavenLocal -PsnapshotNumber=${{ github.run_number }} -PgitRef=${{ github.ref }} - name: Publish Windows if: matrix.os == 'windows-latest' shell: msys2 {0} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index af2cb06..ff6c438 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,6 +31,12 @@ jobs: uses: actions/checkout@v4 with: submodules: 'true' + - name: Enable KVM + if: matrix.os == 'ubuntu-latest' + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm - name: Cached Konan uses: actions/cache@v4 with: @@ -104,7 +110,7 @@ jobs: shell: bash run: ./gradlew iosX64Test - name: Check Android - if: matrix.os == 'macOS-latest' + if: matrix.os == 'ubuntu-latest' uses: reactivecircus/android-emulator-runner@v2 with: api-level: 27