tauri-runtime-servo 0.1.0

Servo bindings to the Tauri runtime — an experimental Tauri runtime backed by the Servo web engine
name: CI

on:
  push:
    branches: [main]
  pull_request:

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

env:
  # Servo's debug artifacts are enormous; hosted runners have neither the
  # disk nor the time for full debuginfo, and the checks don't need it.
  CARGO_PROFILE_DEV_DEBUG: 0
  CARGO_PROFILE_DEV_INCREMENTAL: false

jobs:
  fmt:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt
      - run: cargo fmt --all --check

  build:
    strategy:
      fail-fast: false
      matrix:
        platform:
          - { target: x86_64-pc-windows-msvc, os: windows-latest }
          - { target: x86_64-unknown-linux-gnu, os: ubuntu-latest }
          - { target: aarch64-apple-darwin, os: macos-latest }

    runs-on: ${{ matrix.platform.os }}
    timeout-minutes: 90

    steps:
      - uses: actions/checkout@v4

      # Servo's repository contains WPT test paths longer than Windows'
      # legacy MAX_PATH; without longpaths, cargo's checkout of the servo
      # git dependency fails with "path too long".
      - name: enable long paths (windows only)
        if: contains(matrix.platform.target, 'windows')
        run: git config --global core.longpaths true

      - name: install Servo build dependencies (ubuntu only)
        if: contains(matrix.platform.target, 'linux')
        run: |
          sudo apt-get update
          # libgtk-3-dev: tao's gtk backend needs gdk-3.0.pc at build time.
          # libwebkit2gtk-4.1-dev: the tauri dependency graph links
          # javascriptcore-rs-sys and soup3-sys on Linux; this provides
          # javascriptcoregtk-4.1.pc and pulls in libsoup-3.0-dev.
          sudo apt-get install -y libdbus-1-dev libegl1-mesa-dev libfontconfig1-dev libfreetype6-dev libgtk-3-dev libharfbuzz-dev libwebkit2gtk-4.1-dev libx11-dev libxkbcommon-x11-dev lld
          echo "RUSTFLAGS=-C link-arg=-fuse-ld=lld" >> "$GITHUB_ENV"

      - name: install Rust
        uses: dtolnay/rust-toolchain@1.95.0
        with:
          targets: ${{ matrix.platform.target }}
          components: clippy

      - uses: Swatinem/rust-cache@v2
        with:
          key: servo-${{ matrix.platform.target }}

      - name: test
        run: cargo test --lib --target ${{ matrix.platform.target }}

      - name: lint
        run: cargo clippy --lib --target ${{ matrix.platform.target }} -- -D warnings

      - name: build helloworld example
        run: cargo build -p helloworld-servo --target ${{ matrix.platform.target }}