* attempt fix for flakey playwright test * fix link * disable blitz-shell file dialog * remove rfd integration in native for now * undo file-dialog pass-thru in anticipation of blitz-shell update * upgrade to blacksmith * blitz-shell bump * use faster runner
392 lines
16 KiB
YAML
392 lines
16 KiB
YAML
# Whenever an open PR is updated, the workflow will be triggered
|
|
#
|
|
# This can get expensive, so we do a lot of caching and checks to prevent unnecessary runs
|
|
|
|
name: Rust CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- packages/**
|
|
- examples/**
|
|
- docs/guide/**
|
|
- src/**
|
|
- .github/**
|
|
- lib.rs
|
|
- Cargo.toml
|
|
- Makefile.toml
|
|
|
|
pull_request:
|
|
types: [opened, synchronize, reopened, ready_for_review]
|
|
branches:
|
|
- main
|
|
paths:
|
|
- packages/**
|
|
- examples/**
|
|
- src/**
|
|
- .github/**
|
|
- lib.rs
|
|
- Cargo.toml
|
|
|
|
# workflow_dispatch:
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
CARGO_INCREMENTAL: 0 # todo(jon): cargo-cache wipes incremental artifacts, but we eventually want to cache them
|
|
RUST_BACKTRACE: 1
|
|
rust_nightly: nightly-2025-10-05
|
|
|
|
jobs:
|
|
check-msrv:
|
|
if: github.event.pull_request.draft == false
|
|
name: Check MSRV
|
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- uses: dtolnay/rust-toolchain@1.88.0
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
cache-all-crates: "true"
|
|
# https://github.com/foresterre/cargo-msrv/blob/4345edfe3f4fc91cc8ae6c7d6804c0748fae92ae/.github/workflows/msrv.yml
|
|
- name: install_cargo_msrv
|
|
run: cargo install cargo-msrv --all-features --version 0.16.3 --locked
|
|
- name: version_of_cargo_msrv
|
|
run: cargo msrv --version
|
|
- name: run_cargo_msrv
|
|
run: cargo msrv --output-format json verify -- cargo check
|
|
- name: run_cargo_msrv_on_verify_failure
|
|
if: ${{ failure() }}
|
|
run: cargo msrv --output-format json -- cargo check
|
|
|
|
test:
|
|
if: github.event.pull_request.draft == false
|
|
name: Test Suite
|
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- name: Free Disk Space
|
|
uses: ./.github/actions/free-disk-space
|
|
- uses: awalsh128/cache-apt-pkgs-action@latest
|
|
with:
|
|
packages: libwebkit2gtk-4.1-dev libgtk-3-dev libasound2-dev libudev-dev libayatana-appindicator3-dev libxdo-dev libglib2.0-dev
|
|
version: 1.0
|
|
- uses: dtolnay/rust-toolchain@1.88.0
|
|
with:
|
|
components: rustfmt, clippy
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
cache-all-crates: "true"
|
|
- uses: browser-actions/setup-firefox@latest
|
|
- run: cargo test --lib --bins --tests --examples --workspace --exclude dioxus-desktop
|
|
|
|
release-test:
|
|
if: github.event.pull_request.draft == false
|
|
name: Test Suite with Optimizations
|
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- name: Free Disk Space
|
|
uses: ./.github/actions/free-disk-space
|
|
- uses: awalsh128/cache-apt-pkgs-action@latest
|
|
with:
|
|
packages: libwebkit2gtk-4.1-dev libgtk-3-dev libasound2-dev libudev-dev libayatana-appindicator3-dev libxdo-dev libglib2.0-dev
|
|
version: 1.0
|
|
- uses: dtolnay/rust-toolchain@1.88.0
|
|
with:
|
|
components: rustfmt, clippy
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
cache-all-crates: "true"
|
|
- uses: browser-actions/setup-firefox@latest
|
|
- run: cargo test --lib --bins --tests --examples --workspace --exclude dioxus-desktop --profile release-unoptimized
|
|
|
|
fmt:
|
|
if: github.event.pull_request.draft == false
|
|
name: Rustfmt
|
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- uses: dtolnay/rust-toolchain@1.88.0
|
|
with:
|
|
components: rustfmt
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
cache-all-crates: "true"
|
|
- run: cargo fmt --all -- --check
|
|
|
|
docs:
|
|
if: github.event.pull_request.draft == false
|
|
name: Docs
|
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- uses: awalsh128/cache-apt-pkgs-action@latest
|
|
with:
|
|
packages: libwebkit2gtk-4.1-dev libgtk-3-dev libasound2-dev libudev-dev libayatana-appindicator3-dev libxdo-dev libglib2.0-dev
|
|
version: 1.0
|
|
- name: Install Rust ${{ env.rust_nightly }}
|
|
uses: dtolnay/rust-toolchain@nightly
|
|
with:
|
|
toolchain: ${{ env.rust_nightly }}
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
cache-all-crates: "true"
|
|
- name: "doc --lib --all-features"
|
|
run: |
|
|
cargo doc --workspace --no-deps --all-features --document-private-items
|
|
env:
|
|
RUSTDOCFLAGS: -Dwarnings --document-private-items
|
|
|
|
test-docs:
|
|
if: github.event.pull_request.draft == false
|
|
name: Test Docs
|
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- uses: awalsh128/cache-apt-pkgs-action@latest
|
|
with:
|
|
packages: libwebkit2gtk-4.1-dev libgtk-3-dev libasound2-dev libudev-dev libayatana-appindicator3-dev libxdo-dev libglib2.0-dev
|
|
version: 1.0
|
|
- name: Install Rust ${{ env.rust_nightly }}
|
|
uses: dtolnay/rust-toolchain@nightly
|
|
with:
|
|
toolchain: ${{ env.rust_nightly }}
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
cache-all-crates: "true"
|
|
- name: "doc --lib --all-features"
|
|
run: |
|
|
cargo test --doc --workspace --all-features
|
|
|
|
check:
|
|
if: github.event.pull_request.draft == false
|
|
name: Check
|
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- uses: awalsh128/cache-apt-pkgs-action@latest
|
|
with:
|
|
packages: libwebkit2gtk-4.1-dev libgtk-3-dev libasound2-dev libudev-dev libayatana-appindicator3-dev libxdo-dev libglib2.0-dev
|
|
version: 1.0
|
|
- uses: dtolnay/rust-toolchain@1.88.0
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
cache-all-crates: "true"
|
|
- run: cargo check --workspace --all-features --all-targets
|
|
|
|
clippy:
|
|
if: github.event.pull_request.draft == false
|
|
name: Clippy
|
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- uses: awalsh128/cache-apt-pkgs-action@latest
|
|
with:
|
|
packages: libwebkit2gtk-4.1-dev libgtk-3-dev libasound2-dev libudev-dev libayatana-appindicator3-dev libxdo-dev libglib2.0-dev
|
|
version: 1.0
|
|
- uses: dtolnay/rust-toolchain@1.90.0
|
|
with:
|
|
components: rustfmt, clippy
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
cache-all-crates: "true"
|
|
- run: cargo clippy --workspace --examples --tests --all-features --all-targets -- -D warnings
|
|
|
|
nix:
|
|
if: github.event.pull_request.draft == false
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [blacksmith-4vcpu-ubuntu-2404, macos-latest]
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- uses: nixbuild/nix-quick-install-action@master
|
|
- uses: nix-community/cache-nix-action@main
|
|
with:
|
|
primary-key: nix-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/*.nix', '**/flake.lock') }}
|
|
restore-prefixes-first-match: nix-${{ runner.os }}-${{ runner.arch }}
|
|
- name: Install omnix
|
|
run: nix --accept-flake-config profile install "github:juspay/omnix"
|
|
- name: Build all flake outputs
|
|
run: om ci
|
|
- name: Ensure devShell has all build deps
|
|
run: nix develop -c cargo build -p dioxus-cli --features no-downloads
|
|
|
|
playwright:
|
|
if: github.event.pull_request.draft == false
|
|
name: Playwright Tests
|
|
runs-on: ${{ matrix.os }}
|
|
timeout-minutes: 45
|
|
strategy:
|
|
matrix:
|
|
os: [blacksmith-4vcpu-windows-2025, blacksmith-8vcpu-ubuntu-2404]
|
|
platform:
|
|
- { toolchain: beta }
|
|
# - { toolchain: 1.86.0 }
|
|
steps:
|
|
# Do our best to cache the toolchain and node install steps
|
|
- uses: actions/checkout@v5
|
|
- name: Free Disk Space
|
|
if: ${{ matrix.os == 'ubuntu-24.04' || matrix.os == 'ubuntu-24.04-arm' || matrix.os == 'blacksmith-4vcpu-ubuntu-2404' || matrix.os == 'blacksmith-4vcpu-ubuntu-2404-arm' || matrix.os == 'blacksmith-8vcpu-ubuntu-2404' }}
|
|
uses: ./.github/actions/free-disk-space
|
|
- uses: awalsh128/cache-apt-pkgs-action@latest
|
|
if: ${{ matrix.os == 'ubuntu-24.04' || matrix.os == 'ubuntu-24.04-arm' || matrix.os == 'blacksmith-4vcpu-ubuntu-2404' || matrix.os == 'blacksmith-4vcpu-ubuntu-2404-arm' || matrix.os == 'blacksmith-8vcpu-ubuntu-2404' }}
|
|
with:
|
|
packages: glib-networking glib-networking-common glib-networking-services libaa1 libabsl20220623t64 libass9 libasyncns0 libavc1394-0 libavcodec60 libavfilter9 libavformat60 libavtp0 libavutil58 libblas3 libbluray2 libbs2b0 libcaca0 libcairo-script-interpreter2 libcdparanoia0 libchromaprint1 libcjson1 libcodec2-1.2 libdav1d7 libdc1394-25 libdca0 libdecor-0-0 libdirectfb-1.7-7t64 libdv4t64 libdvdnav4 libdvdread8t64 libfaad2 libflac12t64 libfluidsynth3 libfreeaptx0 libgav1-1 libgme0 libgraphene-1.0-0 libgsm1 libgssdp-1.6-0 libgstreamer-plugins-good1.0-0 libgtk-4-common libgupnp-1.6-0 libgupnp-igd-1.6-0 libhwy1t64 libiec61883-0 libimath-3-1-29t64 libinstpatch-1.0-2 libjack-jackd2-0 libjxl0.7 liblapack3 liblc3-1 libldacbt-enc2 liblilv-0-0 liblrdf0 libltc11 libmbedcrypto7t64 libmfx1 libmjpegutils-2.1-0t64 libmodplug1 libmp3lame0 libmpcdec6 libmpeg2encpp-2.1-0t64 libmpg123-0t64 libmplex2-2.1-0t64 libmysofa1 libneon27t64 libnice10 libogg0 libopenal-data libopenal1 libopenexr-3-1-30 libopenh264-7 libopenmpt0t64 libopenni2-0 liborc-0.4-0t64 libpipewire-0.3-0t64 libplacebo338 libpocketsphinx3 libpostproc57 libproxy1v5 libpulse0 libqrencode4 libraptor2-0 librav1e0 libraw1394-11 librist4 librubberband2 libsamplerate0 libsbc1 libsdl2-2.0-0 libsecret-common libserd-0-0 libshine3 libshout3 libsndfile1 libsndio7.0 libsord-0-0 libsoundtouch1 libsoup-3.0-0 libsoup-3.0-common libsoxr0 libspa-0.2-modules libspandsp2t64 libspeex1 libsphinxbase3t64 libsratom-0-0 libsrt1.5-gnutls libsrtp2-1 libssh-gcrypt-4 libsvtav1enc1d1 libswresample4 libswscale7 libtag1v5 libtag1v5-vanilla libtheora0 libtwolame0 libudfread0 libunibreak5 libv4l-0t64 libv4lconvert0t64 libva-drm2 libva-x11-2 libva2 libvdpau1 libvidstab1.1 libvisual-0.4-0 libvo-aacenc0 libvo-amrwbenc0 libvorbis0a libvorbisenc2 libvorbisfile3 libvpl2 libwavpack1 libwebrtc-audio-processing1 libwildmidi2 libx265-199 libxcb-xkb1 libxkbcommon-x11-0 libcups2t64 libxml2 libxml2-dev libxvidcore4 libyuv0 libzbar0t64 libzimg2 libzix-0-0 libzvbi-common libzvbi0t64 libzxing3 ocl-icd-libopencl1 timgm6mb-soundfont xfonts-encodings xfonts-utils binutils lld binutils-devel binutils-gold fonts-freefont-ttf fonts-ipafont-gothic fonts-tlwg-loma-otf fonts-unifont fonts-wqy-zenhei gstreamer1.0-libav gstreamer1.0-plugins-bad gstreamer1.0-plugins-good libavif16 libevent-2.1-7t64 libgstreamer-plugins-bad1.0-0 libharfbuzz-icu0 libhyphen0 libmanette-0.2-0 libsecret-1-0 libwoff1 xfonts-cyrillic xfonts-scalable fonts-ipafont-mincho fonts-tlwg-loma gstreamer1.0-x
|
|
version: 1.0
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 24
|
|
- name: Install Rust
|
|
uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: ${{ matrix.platform.toolchain }}
|
|
targets: x86_64-unknown-linux-gnu,wasm32-unknown-unknown
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
key: "playwright-${{ matrix.platform.toolchain }}-${{ runner.os }}"
|
|
cache-all-crates: "true"
|
|
cache-on-failure: "true"
|
|
- name: Wipe dx cache
|
|
if: ${{ matrix.os == 'ubuntu-24.04' || matrix.os == 'ubuntu-24.04-arm' || matrix.os == 'blacksmith-4vcpu-ubuntu-2404' || matrix.os == 'blacksmith-4vcpu-ubuntu-2404-arm' || matrix.os == 'blacksmith-8vcpu-ubuntu-2404' }}
|
|
run: |
|
|
rm -rf ./target/dx
|
|
- name: Playwright
|
|
working-directory: ./packages/playwright-tests
|
|
env:
|
|
# The hot patch test requires incremental compilation
|
|
CARGO_INCREMENTAL: 1
|
|
run: |
|
|
npm ci
|
|
npm install -D @playwright/test
|
|
npx playwright install
|
|
npx playwright test
|
|
- uses: actions/upload-artifact@v6
|
|
if: always()
|
|
with:
|
|
name: playwright-report-${{ matrix.platform.toolchain }}-${{ runner.os }}
|
|
path: ./packages/playwright-tests/playwright-report/
|
|
retention-days: 30
|
|
|
|
matrix_test:
|
|
runs-on: ${{ matrix.platform.os }}
|
|
if: github.event.pull_request.draft == false
|
|
env:
|
|
RUST_CARGO_COMMAND: ${{ matrix.platform.cross == true && 'cross' || 'cargo' }}
|
|
strategy:
|
|
matrix:
|
|
platform:
|
|
- {
|
|
target: aarch64-apple-darwin,
|
|
os: macos-latest,
|
|
toolchain: "1.88.0",
|
|
cross: false,
|
|
command: "test",
|
|
args: "--all --tests",
|
|
platform: "desktop",
|
|
}
|
|
- {
|
|
target: aarch64-apple-ios,
|
|
os: macos-latest,
|
|
toolchain: "1.88.0",
|
|
cross: false,
|
|
command: "build",
|
|
args: "--package dioxus-desktop",
|
|
platform: "ios",
|
|
}
|
|
- {
|
|
target: aarch64-unknown-linux-gnu,
|
|
os: ubuntu-24.04-arm,
|
|
toolchain: "1.88.0",
|
|
cross: false,
|
|
command: "build",
|
|
args: "--all --tests",
|
|
platform: "desktop",
|
|
}
|
|
- {
|
|
target: aarch64-linux-android,
|
|
os: blacksmith-4vcpu-ubuntu-2404,
|
|
toolchain: "1.88.0",
|
|
cross: true,
|
|
command: "build",
|
|
args: "--package dioxus-desktop",
|
|
platform: "android",
|
|
}
|
|
# commented out because it's having issues with space on the device, but we already test it above
|
|
# - {
|
|
# target: x86_64-unknown-linux-gnu,
|
|
# os: ubuntu-24.04,
|
|
# toolchain: "1.88.0",
|
|
# cross: false,
|
|
# command: "build",
|
|
# args: "--all --tests",
|
|
# platform: "desktop",
|
|
# }
|
|
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- name: Free Disk Space
|
|
if: ${{ matrix.platform.os == 'ubuntu-24.04' || matrix.platform.os == 'ubuntu-24.04-arm' || matrix.platform.os == 'blacksmith-4vcpu-ubuntu-2404' || matrix.platform.os == 'blacksmith-4vcpu-ubuntu-2404-arm' }}
|
|
uses: ./.github/actions/free-disk-space
|
|
|
|
- uses: awalsh128/cache-apt-pkgs-action@latest
|
|
if: ${{ matrix.platform.os == 'ubuntu-24.04' || matrix.platform.os == 'ubuntu-24.04-arm' || matrix.platform.os == 'blacksmith-4vcpu-ubuntu-2404' || matrix.platform.os == 'blacksmith-4vcpu-ubuntu-2404-arm' }}
|
|
with:
|
|
packages: libwebkit2gtk-4.1-dev libgtk-3-dev libasound2-dev libudev-dev libayatana-appindicator3-dev libxdo-dev libglib2.0-dev
|
|
version: ${{ matrix.platform.target }}-${{ matrix.platform.os }} # disambiguate since we're in a matrix and this caching action doesn't factor in these variables
|
|
|
|
- name: install stable
|
|
uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: ${{ matrix.platform.toolchain }}
|
|
targets: ${{ matrix.platform.target }}
|
|
components: rustfmt
|
|
|
|
- name: Install nasm for windows (tls)
|
|
if: ${{ matrix.platform.target == 'x86_64-pc-windows-msvc' }}
|
|
uses: ilammy/setup-nasm@v1
|
|
|
|
- name: Install cross
|
|
if: ${{ matrix.platform.cross == true }}
|
|
uses: taiki-e/install-action@cross
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
key: "matrix-${{ matrix.platform.target }}"
|
|
cache-all-crates: "true"
|
|
|
|
- name: test
|
|
run: |
|
|
${{ env.RUST_CARGO_COMMAND }} ${{ matrix.platform.command }} ${{ matrix.platform.args }} --target ${{ matrix.platform.target }}
|
|
|
|
# borrowed from uv
|
|
# https://raw.githubusercontent.com/astral-sh/uv/refs/heads/main/.github/workflows/ci.yml
|
|
cargo-test-windows:
|
|
if: github.event.pull_request.draft == false
|
|
runs-on:
|
|
labels: "blacksmith-4vcpu-windows-2025"
|
|
name: "cargo test | windows"
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- uses: dtolnay/rust-toolchain@1.88.0
|
|
with:
|
|
components: rustfmt, clippy
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: ${{ env.UV_WORKSPACE }}
|
|
cache-all-crates: "true"
|
|
|
|
- name: "Install Rust toolchain"
|
|
working-directory: ${{ env.UV_WORKSPACE }}
|
|
run: rustup show
|
|
|
|
- name: "Cargo test"
|
|
working-directory: ${{ env.UV_WORKSPACE }}
|
|
run: |
|
|
cargo test --workspace --tests
|