Files
skiko/.github/workflows/ci.yml
Igor Demin 67e0c0b8eb Fix "ComposePanel doesn't use hardware acceleration with RenderSettings.SwingGraphics on Linux" (#1103)
Fixes https://youtrack.jetbrains.com/issue/CMP-8936

`glXChooseFBConfig` fails to find a config with `GLX_DOUBLEBUFFER,
False` on my machine, it only has double buffered configs. But
double/single buffering doesn't matter as we use pixel buffers.

Also choose a correct config that is required by
https://registry.khronos.org/OpenGL-Refpages/gl2.1/xhtml/glXCreatePbuffer.xml:
```
BadMatch is generated if config does not support rendering to pixel buffers (e.g., GLX_DRAWABLE_TYPE does not contain GLX_PBUFFER_BIT)
```

## Testing
- manually, in the clocks example
- the modified test failed before the fix, now it doesn't fail

## Release Notes (Skiko)
Fix "SkiaSwingLayer doesn't use hardware acceleration on Linux"

## Release Notes (Compose)
### Fixes - Desktop 
Fix "ComposePanel doesn't use hardware acceleration with
RenderSettings.SwingGraphics on Linux"
2025-09-17 12:00:43 +02:00

308 lines
10 KiB
YAML

# Default Skiko CI
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
macOS:
runs-on: macos-13
steps:
- uses: actions/checkout@v3
name: 'Check out code'
- uses: actions/setup-java@v3
name: 'Set up JDK 21'
with:
distribution: 'adopt'
java-version: '21'
cache: 'gradle'
- shell: bash
name: 'Compile and run AWT tests'
run: ./gradlew --stacktrace --info -Pskiko.native.enabled=true -Pskiko.test.onci=true :skiko:awtTest
- shell: bash
name: 'Compile and run macOS x64 tests'
run: ./gradlew --stacktrace --info -Pskiko.native.enabled=true -Pskiko.test.onci=true :skiko:macosX64Test
- shell: bash
name: 'Publish to Maven Local, check AWT sample'
run: |
./gradlew --stacktrace --info -Pskiko.native.enabled=true :skiko:publishToMavenLocal
./gradlew --stacktrace --info :SkiaAwtSample:installDist
- shell: bash
name: 'Publish Debug to Maven Local'
run: |
./gradlew --stacktrace --info -Pskiko.native.enabled=true :skiko:publishToMavenLocal -Pskiko.debug=true
- uses: actions/upload-artifact@v4
name: 'Save test results as artifact'
if: always()
with:
name: test-reports-macos
path: ./skiko/build/reports/tests
retention-days: 5
iOS:
runs-on: macos-13
steps:
- uses: actions/checkout@v3
name: 'Check out code'
- uses: actions/setup-java@v3
name: 'Set up JDK 21'
with:
distribution: 'adopt'
java-version: '21'
cache: 'gradle'
- name: 'Print the devices list'
run: xcrun simctl list devices available --json
# install jq - cli tool for json querying
# retrieve the device .udid to use in tests and store it in env var
- name: 'Set Up Simulator UUID'
run: |
brew install jq &&
IOS_SIM_UUID=$(xcrun simctl list devices available --json | jq -r '.devices."com.apple.CoreSimulator.SimRuntime.iOS-17-0"[] | select(.name == "iPhone 14") | .udid') &&
echo "IOS_SIM_UUID=$IOS_SIM_UUID" >> $GITHUB_ENV
- name: 'Print Selected UUID'
run: echo $IOS_SIM_UUID
- name: 'Compile and run iOS x64 tests'
uses: nick-fields/retry@v2
with:
max_attempts: 10
timeout_minutes: 60
shell: bash
command: ./gradlew --stacktrace --info -Pskiko.native.enabled=true -Pskiko.test.onci=true -Pskiko.iosSimulatorUUID="${{ env.IOS_SIM_UUID }}" :skiko:iosX64TestWithMetal
# iosSimulatorArm64Test will build the binary but the tests will be skipped due to X64 host machine
- shell: bash
name: 'Compile iOS arm64 tests'
run: ./gradlew --stacktrace --info -Pskiko.native.enabled=true -Pskiko.test.onci=true :skiko:iosSimulatorArm64Test
# TODO run iOS specific tests on iPhone simulator
- shell: bash
name: 'Publish to Maven Local'
run: ./gradlew --stacktrace --info -Pskiko.native.enabled=true :skiko:publishToMavenLocal
- uses: actions/upload-artifact@v4
name: 'Save test results as artifact'
if: always()
with:
name: test-reports-ios
path: ./skiko/build/reports/tests
retention-days: 5
tvOS:
runs-on: macos-13
steps:
- uses: actions/checkout@v3
name: 'Check out code'
- uses: actions/setup-java@v3
name: 'Set up JDK 21'
with:
distribution: 'adopt'
java-version: '21'
cache: 'gradle'
- shell: bash
run: |
./gradlew --stacktrace --info -Pskiko.native.enabled=true -Pskiko.test.onci=true :skiko:tvosX64Test
# tvosSimulatorArm64Test will build the binary but the tests will be skipped due to X64 host machine
./gradlew --stacktrace --info -Pskiko.native.enabled=true -Pskiko.test.onci=true :skiko:tvosSimulatorArm64Test
- uses: actions/upload-artifact@v4
if: always()
with:
name: test-reports-tvos
path: ./skiko/build/reports/tests
retention-days: 5
linux:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
name: 'Check out code'
- uses: actions/setup-java@v3
name: 'Set up JDK 21'
with:
distribution: 'adopt'
java-version: '21'
cache: 'gradle'
- uses: nttld/setup-ndk@v1
name: 'Set up Android NDK'
id: setup-ndk
with:
ndk-version: r21e
- uses: android-actions/setup-android@v2
name: 'Set up Android SDK'
- shell: bash
name: 'Set up Linux build environment'
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
run: |
sudo apt-get update -y
sudo apt-get install libglu1-mesa-dev libxrandr-dev libdbus-1-dev multistrap -y
sudo apt-get install gcc-9 g++-9 -y
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9
sudo update-alternatives --config gcc
sudo apt-get install gcc-9-aarch64-linux-gnu g++-9-aarch64-linux-gnu -y
sudo update-alternatives --install /usr/bin/aarch64-linux-gnu-gcc aarch64-linux-gnu-gcc /usr/bin/aarch64-linux-gnu-gcc-9 60 --slave /usr/bin/aarch64-linux-gnu-g++ aarch64-linux-gnu-g++ /usr/bin/aarch64-linux-gnu-g++-9
sudo update-alternatives --config aarch64-linux-gnu-gcc
sudo Xvfb :0 -screen 0 1280x720x24 +extension GLX &
- shell: bash
name: 'Compile and run Linux x64 tests'
run: |
export DISPLAY=:0
./gradlew --no-daemon --stacktrace --info -Pskiko.native.enabled=true -Pkotlin.native.cacheKind.linuxX64=none -Pskiko.test.onci=true :skiko:linuxX64Test
# Linux arm64 tests are executed on a separate runner
- shell: bash
name: 'Compile Linux arm64 tests'
run: |
./gradlew --no-daemon --stacktrace --info -Pskiko.native.enabled=true -Pskiko.test.onci=true :skiko:linkDebugTestLinuxArm64
- shell: bash
name: 'Compile and run AWT tests'
run: |
export DISPLAY=:0
./gradlew --no-daemon --stacktrace --info -Pskiko.native.enabled=true -Pkotlin.native.cacheKind.linuxX64=none -Pskiko.test.onci=true :skiko:awtTest
timeout-minutes: 25
- shell: bash
name: 'Publish to Maven Local, check AWT sample'
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
run: |
./gradlew --no-daemon --stacktrace --info -Pkotlin.native.cacheKind.linuxX64=none :skiko:publishToMavenLocal
./gradlew --no-daemon --stacktrace --info :SkiaAwtSample:installDist
./gradlew --no-daemon -Pskiko.android.enabled=true :skiko:publishSkikoJvmRuntimeAndroidX64PublicationToMavenLocal :skiko:publishSkikoJvmRuntimeAndroidArm64PublicationToMavenLocal :skiko:publishAndroidReleasePublicationToMavenLocal
- uses: actions/upload-artifact@v4
name: 'Save test results as artifact'
if: always()
with:
name: test-reports-linux
path: ./skiko/build/reports/tests
retention-days: 5
- uses: actions/upload-artifact@v4
name: 'Save linuxArm64 test binary as artifact'
with:
name: test-binary-linuxArm64
path: ./skiko/build/bin/linuxArm64
if-no-files-found: error
retention-days: 5
linux-arm:
needs: linux
runs-on: ubuntu-22.04-arm
steps:
- uses: actions/checkout@v3
name: 'Check out code'
- uses: actions/setup-java@v3
name: 'Set up JDK 21'
with:
distribution: 'adopt'
java-version: '21'
cache: 'gradle'
- uses: actions/download-artifact@v4
with:
name: test-binary-linuxArm64
path: ./skiko/build/bin/linuxArm64
- shell: bash
name: 'Set up Linux build environment'
run: |
sudo apt-get update -y
sudo apt-get install libglu1-mesa-dev libxrandr-dev libdbus-1-dev -y
sudo apt-get install clang-11 -y
sudo apt-get remove g++ -y
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-11 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-11 100
sudo Xvfb :0 -screen 0 1280x720x24 +extension GLX &
- shell: bash
name: 'Run Linux arm64 tests'
working-directory: ./skiko
run: |
export DISPLAY=:0
chmod +x ./build/bin/linuxArm64/debugTest/test.kexe
./build/bin/linuxArm64/debugTest/test.kexe
- shell: bash
name: 'Compile and run AWT tests'
run: |
export DISPLAY=:0
./gradlew --no-daemon --stacktrace --info -Pskiko.test.onci=true :skiko:awtTest
timeout-minutes: 25
- shell: bash
name: 'Publish to Maven Local, check AWT sample'
run: |
./gradlew --no-daemon --stacktrace --info :skiko:publishToMavenLocal
./gradlew --no-daemon --stacktrace --info :SkiaAwtSample:installDist
- uses: actions/upload-artifact@v4
name: 'Save test results as artifact'
if: always()
with:
name: test-reports-linux-arm
path: ./skiko/build/reports/tests
retention-days: 5
windows:
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
name: 'Check out code'
- uses: microsoft/setup-msbuild@v1
- uses: ilammy/msvc-dev-cmd@v1
- uses: actions/setup-java@v3
name: 'Set up JDK 21'
with:
distribution: 'adopt'
java-version: '21'
cache: 'gradle'
# OPENGL is ignored as it doesn't exist on the Windows GitHub agent
- shell: bash
name: 'Compile and run AWT tests'
run: ./gradlew --stacktrace --info -Pskiko.test.onci=true -Pskiko.test.ui.renderApi.ignoreAssertsFor=OPENGL :skiko:awtTest
- shell: bash
name: 'Publish to Maven Local, check AWT sample'
run: |
./gradlew --stacktrace --info :skiko:publishToMavenLocal
./gradlew --stacktrace --info :SkiaAwtSample:installDist
- uses: actions/upload-artifact@v4
name: 'Save test results as artifact'
if: always()
with:
name: test-reports-windows
path: ./skiko/build/reports/tests
retention-days: 5