Install Vulkan drivers to Linux GitHub runners #122
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: CI build | |
on: [push] | |
env: | |
DISPLAY: ":99" | |
XVFB_PARAMS: "-screen 0 1920x1080x24" | |
RUNNING_ON_CI: true | |
jobs: | |
builds: | |
name: '${{ matrix.os }} with Java ${{ matrix.jdk }}' | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
jdk: [21, 23] | |
os: [ubuntu-latest, windows-latest] | |
fail-fast: false | |
max-parallel: 4 | |
timeout-minutes: 30 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Java ${{ matrix.jdk }} | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: ${{ matrix.jdk }} | |
- name: Install GStreamer and Plugins (Linux) | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y \ | |
libgstreamer1.0-0 \ | |
gstreamer1.0-libav \ | |
gstreamer1.0-plugins-base \ | |
gstreamer1.0-plugins-good \ | |
gstreamer1.0-plugins-bad \ | |
gstreamer1.0-plugins-ugly | |
- name: Set up Virtual Audio Device (Linux) | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get install -y pulseaudio | |
pulseaudio --start --exit-idle-time=-1 | |
pacmd load-module module-null-sink sink_name=DummyOutput | |
- name: Enable Media Features (Windows) | |
if: runner.os == 'Windows' | |
shell: pwsh | |
run: | | |
Enable-WindowsOptionalFeature -Online -FeatureName MediaPlayback -All | |
Enable-WindowsOptionalFeature -Online -FeatureName ServerMediaFoundation -All | |
- name: Set JavaFX Media Backend to WMF (Windows) | |
if: runner.os == 'Windows' | |
shell: pwsh | |
run: | | |
$env:JDK_JAVA_OPTIONS = "-Djfxmedia.platforms=Windows" | |
- name: Compile | |
run: | | |
./gradlew jar | |
./gradlew example:jar | |
- name: Set up Virtual Display (for Linux) | |
if: runner.os == 'Linux' | |
run: | | |
# Install Vulkan and tools for debugging | |
sudo apt-get install -y mesa-vulkan-drivers libvulkan1 vulkan-tools | |
# Set environment variables to ensure lavapipe is used | |
echo "VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.x86_64.json" >> $GITHUB_ENV | |
echo "MESA_VK_DEVICE_SELECT=lavapipe" >> $GITHUB_ENV | |
# Set up Virtual Display | |
Xvfb ${{env.DISPLAY}} ${{env.XVFB_PARAMS}} & | |
- name: Test | |
run: | | |
./gradlew test | |
shell: bash | |
- name: Javadoc | |
run: | | |
./gradlew javadoc |