From e1ec269c79996cca5ddbab95e0b2766f987ecbe7 Mon Sep 17 00:00:00 2001 From: abdelrahman fahmy <104788132+Apdelrahman1911@users.noreply.github.com> Date: Sun, 6 Dec 2026 07:48:10 +0000 Subject: [PATCH] ci: run Rust launcher and mtlvk unit tests in ci.yml and upstream-sync.yml --- .github/workflows/ci.yml | 53 +++++++++++++++++++++++++++++ .github/workflows/upstream-sync.yml | 11 ++++-- 2 files changed, 61 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7ae637d..37505ef7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,3 +55,56 @@ jobs: tools/launcher/web/target key: web-${{ runner.os }}-${{ hashFiles('tools/launcher/web/Cargo.lock', 'tools/launcher/web/rust-toolchain.toml', 'build/web.sh') }} - run: build/web.sh --check + rust-launcher-tests: + if: github.event.action != 'labeled' || github.event.label.name == 'appimage' + runs-on: ubuntu-24.04 + timeout-minutes: 30 + permissions: + contents: read + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + - name: Install Rust stable + run: rustup toolchain install stable --profile minimal && rustup default stable + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + tools/launcher/target + key: ci-launcher-cargo-${{ runner.os }}-${{ hashFiles('tools/launcher/Cargo.lock') }} + restore-keys: ci-launcher-cargo-${{ runner.os }}- + - name: Run launcher unit tests and bin checks + run: | + cd tools/launcher + cargo test --lib -- --nocapture + cargo check --bins + rust-mtlvk-tests: + if: github.event.action != 'labeled' || github.event.label.name == 'appimage' + runs-on: ubuntu-24.04 + timeout-minutes: 25 + permissions: + contents: read + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + - name: Initialize metal2vulkan submodule over HTTPS + run: | + git config --global url."https://github.com/".insteadOf git@github.com: + git submodule update --init --depth 1 external/metal2vulkan + - name: Install Rust stable + run: rustup toolchain install stable --profile minimal && rustup default stable + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + linux/mtlvk/target + key: ci-mtlvk-cargo-${{ runner.os }}-${{ hashFiles('linux/mtlvk/Cargo.lock') }} + restore-keys: ci-mtlvk-cargo-${{ runner.os }}- + - name: Run mtlvk unit tests + run: | + cd linux/mtlvk + cargo test --bin mtlvk -- --nocapture diff --git a/.github/workflows/upstream-sync.yml b/.github/workflows/upstream-sync.yml index 18829cf9..956e9192 100644 --- a/.github/workflows/upstream-sync.yml +++ b/.github/workflows/upstream-sync.yml @@ -68,14 +68,19 @@ jobs: ref: ${{ needs.sync.outputs.has_changes == 'true' && needs.sync.outputs.sync_branch || (inputs.maintained_branch || 'main') }} persist-credentials: false + - name: Initialize metal2vulkan submodule over HTTPS + run: | + git config --global url."https://github.com/".insteadOf git@github.com: + git submodule update --init --depth 1 external/metal2vulkan + - name: Install Rust stable run: rustup toolchain install stable --profile minimal && rustup default stable - - name: Run launcher unit tests + - name: Run launcher and mtlvk unit tests id: compat run: | - cd tools/launcher - cargo test --lib + (cd tools/launcher && cargo test --lib && cargo check --bins) + (cd linux/mtlvk && cargo test --bin mtlvk) report: needs: [sync, compatibility-check]