Update CI scripts #262
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: Check | |
on: | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
- '**.adoc' | |
- '**/.gitignore' | |
- '.github/**' | |
- '!.github/workflows/test.yml' | |
push: | |
branches: | |
- '!master' | |
- '!snapshot/*' | |
paths-ignore: | |
- '**.md' | |
- '**.adoc' | |
- '**/.gitignore' | |
- '.github/**' | |
- '!.github/workflows/test.yml' | |
jobs: | |
check: | |
name: Check | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macOS-latest, windows-latest] | |
steps: | |
- name: Check out | |
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: | |
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@v4 | |
with: | |
path: ~/.gradle | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} | |
restore-keys: ${{ runner.os }}-gradle- | |
- name: Android environment | |
if: matrix.os != 'windows-latest' | |
shell: bash | |
run: | | |
echo "ANDROID_HOME=$ANDROID_HOME" >> $GITHUB_ENV | |
echo "ANDROID_NDK_VERSION=25.2.9519653" >> $GITHUB_ENV | |
- name: Cached Android NDK | |
if: matrix.os != 'windows-latest' | |
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 }} | |
- name: Set up shell | |
if: matrix.os == 'windows-latest' | |
run: | | |
echo "C:\msys64\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
rm.exe "C:/WINDOWS/system32/bash.EXE" | |
- name: Install Automake | |
if: matrix.os == 'macOS-latest' | |
run: brew install automake libtool | |
- name: Install Automake (windows) | |
if: matrix.os == 'windows-latest' | |
uses: msys2/setup-msys2@v2 | |
with: | |
path-type: minimal | |
update: true | |
install: >- | |
base-devel | |
autotools | |
mingw-w64-x86_64-gcc | |
- name: Setup Android | |
if: matrix.os != 'windows-latest' | |
shell: bash | |
run: | | |
${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager "ndk;$ANDROID_NDK_VERSION" | |
- name: Setup Android | |
if: matrix.os == 'windows-latest' | |
shell: msys2 {0} | |
run: | | |
echo "skip.android=true" > local.properties | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 17 | |
distribution: 'adopt' | |
- name: Check JVM | |
if: matrix.os != 'windows-latest' | |
run: ./gradlew jvmTest | |
- name: Check JVM (Windows) | |
if: matrix.os == 'windows-latest' | |
shell: msys2 {0} | |
run: ./gradlew jvmTest | |
- name: Check Linux | |
if: matrix.os == 'ubuntu-latest' | |
shell: bash | |
run: ./gradlew linuxX64Test | |
- name: Check iOS | |
if: matrix.os == 'macOS-latest' | |
shell: bash | |
run: ./gradlew iosX64Test | |
- name: Check Android | |
if: matrix.os == 'macOS-latest' | |
uses: reactivecircus/android-emulator-runner@v2 | |
with: | |
api-level: 27 | |
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none | |
ndk: ${{ env.ANDROID_NDK_VERSION }} | |
cmake: 3.22.1 | |
script: ./gradlew connectedCheck |