GitComet/.github/workflows/cross-platform-tests.yml
2026-03-17 17:01:25 +02:00

244 lines
7.6 KiB
YAML

name: Cross-Platform Tests
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: cross-platform-tests-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
APP_FEATURES: --no-default-features --features gix
jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Cache Rust artifacts
uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --all --check
linux-ubuntu:
name: Linux Headless Suite (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-24.04]
steps:
- uses: actions/checkout@v6
- name: Show Git version
run: git --version
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust artifacts
uses: Swatinem/rust-cache@v2
- name: Run headless test suite
run: |
cargo test --workspace \
--exclude gitcomet-ui \
--exclude gitcomet-ui-gpui \
$APP_FEATURES \
--locked \
--verbose
linux-fedora:
name: Linux Headless Suite (Fedora container)
runs-on: ubuntu-latest
timeout-minutes: 60
container:
image: fedora:41
steps:
- name: Install build dependencies
run: |
dnf -y install \
bash \
curl \
findutils \
gcc \
gcc-c++ \
git \
make \
openssl-devel \
pkg-config \
tar \
which
- uses: actions/checkout@v6
- name: Show Git version
run: git --version
- name: Install Rust toolchain
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
- name: Run headless test suite
shell: bash
run: |
cargo test --workspace \
--exclude gitcomet-ui \
--exclude gitcomet-ui-gpui \
$APP_FEATURES \
--locked \
--verbose
linux-display-profiles:
name: Linux Display Profile (${{ matrix.profile.name }})
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
profile:
- name: x11-gnome
display: ":99"
wayland_display: ""
session_type: x11
desktop: GNOME
- name: wayland-gnome
display: ""
wayland_display: wayland-1
session_type: wayland
desktop: GNOME
- name: wayland-kde
display: ""
wayland_display: wayland-1
session_type: wayland
desktop: KDE
env:
DISPLAY: ${{ matrix.profile.display }}
WAYLAND_DISPLAY: ${{ matrix.profile.wayland_display }}
XDG_SESSION_TYPE: ${{ matrix.profile.session_type }}
XDG_CURRENT_DESKTOP: ${{ matrix.profile.desktop }}
steps:
- uses: actions/checkout@v6
- name: Show Git version
run: git --version
- name: Install Linux UI native dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
pkg-config \
libxcb1-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev
- name: Preflight Linux UI link dependencies
run: |
missing=0
for dep in xcb xkbcommon xkbcommon-x11; do
if ! pkg-config --exists "$dep"; then
echo "::error title=Missing Linux UI dependency::pkg-config could not find '$dep'. Install libxcb1-dev, libxkbcommon-dev, and libxkbcommon-x11-dev."
missing=1
fi
done
if [ "$missing" -ne 0 ]; then
echo "Linux display-profile job is missing required native UI link dependencies."
exit 1
fi
pkg-config --modversion xcb xkbcommon xkbcommon-x11
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust artifacts
uses: Swatinem/rust-cache@v2
- name: Print display profile
run: |
echo "DISPLAY=${DISPLAY:-<unset>}"
echo "WAYLAND_DISPLAY=${WAYLAND_DISPLAY:-<unset>}"
echo "XDG_SESSION_TYPE=${XDG_SESSION_TYPE:-<unset>}"
echo "XDG_CURRENT_DESKTOP=${XDG_CURRENT_DESKTOP:-<unset>}"
- name: Run display-selection integration tests
run: |
cargo test -p gitcomet $APP_FEATURES --test mergetool_git_integration gui_default --verbose
cargo test -p gitcomet $APP_FEATURES --test difftool_git_integration gui_default --verbose
- name: Run UI smoke test under selected profile
run: cargo test -p gitcomet-ui-gpui smoke_tests::smoke_view_renders_without_panicking -- --exact
macos-tests:
name: macOS Tests (${{ matrix.name }})
runs-on: ${{ matrix.runs_on }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- name: apple-silicon (macos-latest)
runs_on: macos-latest
- name: intel (macos-15-intel)
runs_on: macos-15-intel
steps:
- uses: actions/checkout@v6
- name: Show Git version
run: git --version
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust artifacts
uses: Swatinem/rust-cache@v2
- name: Show host target
run: rustc -vV
- name: Run headless test suite
run: |
cargo test --workspace \
--exclude gitcomet-ui \
--exclude gitcomet-ui-gpui \
$APP_FEATURES \
--locked \
--verbose
- name: Gatekeeper and code-signing check (informational)
run: |
cargo build -p gitcomet $APP_FEATURES --release --locked
codesign --verify --verbose target/release/gitcomet || true
spctl --assess --type execute --verbose target/release/gitcomet || true
windows-tests:
name: Windows Tests (PowerShell + CMD)
runs-on: windows-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v6
- name: Show Git version
shell: pwsh
run: git --version
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust artifacts
uses: Swatinem/rust-cache@v2
- name: Show path behavior (PowerShell + Git Bash)
shell: pwsh
run: |
Write-Host "PowerShell path: $pwd"
$bashPwd = bash -lc "pwd"
Write-Host "Git Bash path: $bashPwd"
- name: Run headless test suite (PowerShell)
shell: pwsh
run: |
cargo test --workspace `
--exclude gitcomet-ui `
--exclude gitcomet-ui-gpui `
--no-default-features `
--features gix `
--locked `
--verbose
- name: Run standalone smoke test in CMD
shell: cmd
run: cargo test -p gitcomet --no-default-features --features gix --test standalone_tool_mode_integration help_flag_exits_zero -- --exact
- name: Show path behavior (CMD + Git Bash)
shell: cmd
run: |
echo CMD path: %CD%
for /f "delims=" %%i in ('bash -lc "pwd"') do set BASH_PWD=%%i
echo Git Bash path: %BASH_PWD%