From e5eac08831d52e6ca11859a5fe3ffcdcd5134b32 Mon Sep 17 00:00:00 2001 From: Jason Tsai Date: Wed, 24 Apr 2024 17:27:07 +0800 Subject: [PATCH 1/2] build: fix linux test with wayland --- .github/workflows/build.yml | 11 +++++++++++ Cargo.toml | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fb7057a5..6f7c198b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,6 +54,17 @@ jobs: run: | cargo build --release + - name: Test + run: | + export WAYLAND_DISPLAY=wayland-1 + export WLR_BACKENDS=headless + export WLR_LIBINPUT_NO_DEVICES=1 + export XDG_RUNTIME_DIR=/tmp + export XDG_SESSION_TYPE=wayland + sudo apt-get install sway + sway > /dev/null 2>&1 & + cargo test --release + - name: Tar Binary if: ${{ github.event_name == 'schedule' }} run: tar -czvf verso-x86_64-unknown-linux-gnu.tar.gz -C ./target/release/ verso diff --git a/Cargo.toml b/Cargo.toml index 991b67a3..57641e3f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,7 +35,7 @@ raw-window-handle = { version = "0.5", features = ["std"] } libservo = { git = "https://github.com/servo/servo.git", rev = "025a987", features = ["max_log_level", "native-bluetooth", "webdriver"] } crossbeam-channel = "0.5" getopts = "0.2.17" -surfman = { version = "0.9", features = ["chains", "sm-angle", "sm-angle-default", "sm-x11", "sm-raw-window-handle"] } +surfman = { version = "0.9", features = ["chains", "sm-angle-default", "sm-raw-window-handle"] } winit = { version = "0.29", features = ["rwh_05"] } [target."cfg(any(target_os = \"ios\", target_os = \"macos\"))".dependencies] From d787afd66b8621cecc8685d89a2ebdb805cccd37 Mon Sep 17 00:00:00 2001 From: Jason Tsai Date: Thu, 25 Apr 2024 16:27:00 +0800 Subject: [PATCH 2/2] apply suggestion --- .github/workflows/build.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6f7c198b..c9d6a7cb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,6 +22,11 @@ jobs: RUSTC_WRAPPER: sccache CCACHE: sccache SCCACHE_GHA_ENABLED: 'true' + WAYLAND_DISPLAY: wayland-1 + WLR_BACKENDS: headless + WLR_LIBINPUT_NO_DEVICES: 1 + XDG_RUNTIME_DIR: /tmp + XDG_SESSION_TYPE: wayland steps: - name: Checkout the repository uses: actions/checkout@v4 @@ -45,7 +50,7 @@ jobs: libgstrtspserver-1.0-dev gstreamer1.0-tools libges-1.0-dev \ libharfbuzz-dev liblzma-dev libunwind-dev libunwind-dev libvulkan1 \ libx11-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev \ - libxmu-dev libxmu6 libegl1-mesa-dev llvm-dev m4 xorg-dev + libxmu-dev libxmu6 libegl1-mesa-dev llvm-dev m4 xorg-dev sway - name: Run sccache-cache uses: mozilla-actions/sccache-action@v0.0.3 @@ -55,13 +60,8 @@ jobs: cargo build --release - name: Test + # Run sway(wayland compositor) in the background, winit will use it run: | - export WAYLAND_DISPLAY=wayland-1 - export WLR_BACKENDS=headless - export WLR_LIBINPUT_NO_DEVICES=1 - export XDG_RUNTIME_DIR=/tmp - export XDG_SESSION_TYPE=wayland - sudo apt-get install sway sway > /dev/null 2>&1 & cargo test --release