Files
upstream-tauri/.github/workflows/test-api-e2e.yml
upstream-mirror feda81bf2f
Some checks failed
Audit / audit-js (push) Failing after 0s
bench / bench (map[os:ubuntu-latest runner:xvfb-run --auto-servernum target:x86_64-unknown-linux-gnu], nightly) (push) Failing after 0s
covector version or publish / run-integration-tests (ubuntu-latest) (push) Failing after 0s
Audit / audit-rust (push) Failing after 0s
test `@tauri-apps/cli` / test (ubuntu-latest) (push) Failing after 0s
test `tauri-cli` / test (map[os:ubuntu-latest target:x86_64-unknown-linux-gnu]) (push) Failing after 0s
test core / test (map[args:--all-features key:all], map[cargo:cargo command:test os:ubuntu-latest target:x86_64-unknown-linux-gnu toolchain:1.90]) (push) Failing after 0s
test core / test (map[args:--no-default-features key:no-default], map[cargo:cargo command:test os:ubuntu-latest target:x86_64-unknown-linux-gnu toolchain:1.90]) (push) Failing after 0s
test core / test (map[args:--no-default-features key:no-default], map[cargo:cross command:build os:ubuntu-latest target:aarch64-linux-android toolchain:1.90]) (push) Failing after 0s
deploy schema worker / deploy (push) Failing after 0s
lint rust / clippy (map[cargo:cargo include: os:ubuntu-latest target:x86_64-unknown-linux-gnu]) (push) Failing after 0s
lint rust / clippy (map[cargo:cross include:--package api os:ubuntu-latest target:aarch64-linux-android]) (push) Failing after 0s
supply chain health status / check rust dependencies with cargo vet (push) Failing after 0s
test `@tauri-apps/api` e2e (mobile) / android (push) Failing after 0s
test `@tauri-apps/api` e2e / test (map[name:Linux os:ubuntu-latest]) (push) Failing after 0s
test core / test (map[args:--all-features key:all], map[cargo:cross command:build os:ubuntu-latest target:aarch64-linux-android toolchain:1.90]) (push) Failing after 0s
Udeps / changes (push) Failing after 0s
Udeps / setup (push) Has been skipped
Udeps / udeps (push) Has been skipped
bench / bench (map[os:macos-latest runner: target:aarch64-apple-darwin], nightly) (push) Has been cancelled
bench / bench (map[os:windows-latest runner: target:x86_64-pc-windows-msvc], nightly) (push) Has been cancelled
covector version or publish / run-integration-tests (macos-latest) (push) Has been cancelled
covector version or publish / run-integration-tests (windows-latest) (push) Has been cancelled
covector version or publish / version-or-publish (push) Has been cancelled
test `@tauri-apps/cli` / test (macos-latest) (push) Has been cancelled
test `tauri-cli` / test (map[args:--no-default-features --features native-tls-vendored os:windows-latest restore-only:true target:aarch64-pc-windows-msvc]) (push) Has been cancelled
test `tauri-cli` / test (map[os:macos-latest target:x86_64-apple-darwin]) (push) Has been cancelled
test `tauri-cli` / test (map[os:windows-latest target:x86_64-pc-windows-msvc]) (push) Has been cancelled
test core / test (map[args:--all-features key:all], map[cargo:cargo command:build os:macos-latest target:aarch64-apple-ios toolchain:1.90]) (push) Has been cancelled
test core / test (map[args:--all-features key:all], map[cargo:cargo command:test os:macos-14 target:aarch64-apple-darwin toolchain:1.90]) (push) Has been cancelled
lint rust / clippy (map[cargo:cargo include: os:macos-latest target:aarch64-apple-darwin]) (push) Has been cancelled
lint rust / clippy (map[cargo:cargo include: os:windows-latest target:x86_64-pc-windows-msvc]) (push) Has been cancelled
lint rust / clippy (map[cargo:cargo include:--package api os:macos-latest target:aarch64-apple-ios]) (push) Has been cancelled
test `@tauri-apps/api` e2e (mobile) / ios (push) Has been cancelled
test `@tauri-apps/api` e2e / test (map[name:Windows os:windows-latest]) (push) Has been cancelled
test `@tauri-apps/api` e2e / test (map[name:macOS os:macos-latest]) (push) Has been cancelled
test `@tauri-apps/cli` / test (windows-latest) (push) Has been cancelled
test core / test (map[args:--all-features key:all], map[cargo:cargo command:test os:windows-latest target:x86_64-pc-windows-msvc toolchain:1.90]) (push) Has been cancelled
test core / test (map[args:--no-default-features key:no-default], map[cargo:cargo command:build os:macos-latest target:aarch64-apple-ios toolchain:1.90]) (push) Has been cancelled
test core / test (map[args:--no-default-features key:no-default], map[cargo:cargo command:test os:macos-14 target:aarch64-apple-darwin toolchain:1.90]) (push) Has been cancelled
test core / test (map[args:--no-default-features key:no-default], map[cargo:cargo command:test os:windows-latest target:x86_64-pc-windows-msvc toolchain:1.90]) (push) Has been cancelled
snapshot of https://github.com/tauri-apps/tauri.git (dev, 2026-09-23; blobs > 131072B omitted)
2026-09-23 17:00:42 +05:00

190 lines
7.7 KiB
YAML

# Copyright 2019-2024 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: test `@tauri-apps/api` e2e
on:
workflow_dispatch:
push:
branches:
- dev
pull_request:
paths:
- '.github/workflows/test-api-e2e.yml'
- 'packages/api/**'
- 'packages/api-e2e/**'
- 'examples/api/**'
env:
RUST_BACKTRACE: 1
CARGO_PROFILE_DEV_DEBUG: 0 # keeps the target folder small for better cache efficiency
# Incremental artifacts are dropped from the cache anyway and only slow the builds down.
CARGO_INCREMENTAL: 0
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
test:
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
- { name: Linux, os: ubuntu-latest }
- { name: Windows, os: windows-latest }
- { name: macOS, os: macos-latest }
env:
# macOS has no native WebDriver for WKWebView, so the app is driven through the
# CrabNebula Webdriver (tauri-plugin-automation + test-runner-backend), which
# authenticates with this key. Pull requests from forks do not get it, and the macOS
# job then has nothing to test: the steps below skip the builds there rather than
# occupy a macOS runner for them.
HAS_CN_API_KEY: ${{ secrets.TAURI_E2E_CN_API_KEY != '' }}
steps:
- uses: actions/checkout@v7
- name: install Rust 1.90
# The MSRV, as the other jobs building the CLI use. The compiler version is part of
# the rust-cache key, so a floating `stable` would also invalidate the entry below on
# every Rust release.
uses: dtolnay/rust-toolchain@1.90
- run: npm i -g --force corepack
- name: setup node
if: runner.os != 'macOS' || env.HAS_CN_API_KEY == 'true'
uses: actions/setup-node@v7
with:
node-version: 'lts/*'
cache: 'pnpm'
- name: install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
webkit2gtk-driver \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
xvfb \
fluxbox
# WebKitGTK reads the color scheme and tao the theme from the desktop portal when a
# window is created. On the runner that portal is registered with D-Bus but never
# comes up (there is no desktop session for it), so both calls only return on their
# timeouts, 25s and 5s: about 30s per app start, and every spec starts the app.
# Without a service file the name is unknown and both calls fail at once.
sudo rm -f /usr/share/dbus-1/services/org.freedesktop.portal.Desktop.service
- name: install msedgedriver (Windows)
if: runner.os == 'Windows'
# The driver has to match the WebView2 runtime, which registers its version with
# EdgeUpdate under the client id below. This is what msedgedriver-tool does, minus
# compiling the tool from source on every run (a minute).
run: |
$ProgressPreference = 'SilentlyContinue'
$client = 'Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}'
$version = @(
"HKLM:\SOFTWARE\WOW6432Node\$client",
"HKLM:\SOFTWARE\$client",
"HKCU:\SOFTWARE\WOW6432Node\$client",
"HKCU:\SOFTWARE\$client"
) | ForEach-Object { (Get-ItemProperty -Path $_ -ErrorAction SilentlyContinue).pv } | Where-Object { $_ } | Select-Object -First 1
if (-not $version) { throw 'no WebView2 runtime found in the registry' }
$dir = Join-Path $env:RUNNER_TEMP 'msedgedriver'
New-Item -ItemType Directory -Force -Path $dir | Out-Null
Invoke-WebRequest "https://msedgedriver.microsoft.com/$version/edgedriver_win64.zip" -OutFile "$dir\edgedriver.zip"
Expand-Archive "$dir\edgedriver.zip" -DestinationPath $dir -Force
Write-Host "WebView2 $version; $(& "$dir\msedgedriver.exe" --version)"
$dir >> $env:GITHUB_PATH
- uses: Swatinem/rust-cache@v2
if: runner.os != 'macOS' || env.HAS_CN_API_KEY == 'true'
with:
# The dependencies of the CLI and of the example app, both in the dev profile.
# Only `dev` writes the entry: one saved from a pull request lives on its merge
# ref, where nothing else can restore it, and every write evicts a `dev` entry
# that other runs would have hit (10 GB repository limit, LRU eviction). Pull
# requests restore the `dev` entry, so they get everything but the workspace
# crates for free.
shared-key: api-e2e
save-if: ${{ github.ref == 'refs/heads/dev' }}
# A flaky spec on `dev` must not throw the build away.
cache-on-failure: true
- name: install dependencies
if: runner.os != 'macOS' || env.HAS_CN_API_KEY == 'true'
run: pnpm i --frozen-lockfile
- name: build @tauri-apps/api
if: runner.os != 'macOS' || env.HAS_CN_API_KEY == 'true'
run: pnpm build:api
- name: build @tauri-apps/cli
if: runner.os != 'macOS' || env.HAS_CN_API_KEY == 'true'
# Debug profile: the suite builds the example app with `tauri build --debug` anyway, and
# a debug CLI reuses the cached dependencies instead of a from-scratch LTO build.
run: pnpm build:cli:debug
- name: run e2e tests (Linux)
if: runner.os == 'Linux'
timeout-minutes: 45
# A real window manager (fluxbox) is started so that window-state tests
# (minimize/maximize/fullscreen/position) behave.
env:
E2E_SPEC_RETRIES: '1'
run: |
xvfb-run --auto-servernum -- bash -c '
fluxbox >/dev/null 2>&1 &
sleep 1
pnpm test:api-e2e
'
- name: run e2e tests (Windows)
if: runner.os == 'Windows'
timeout-minutes: 45
shell: pwsh
# msedgedriver hands the app the `--remote-debugging-port` it attaches to through
# `WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS`, and WebView2 ignores that variable in an
# elevated process, which is what the runner gives us. gsudo runs the suite at medium
# integrity instead, and the workspace is opened up so the de-elevated process can use it.
# See https://github.com/tauri-apps/wry/issues/1782 and
# https://github.com/MicrosoftEdge/WebView2Feedback/issues/5645.
env:
E2E_SPEC_RETRIES: '1'
run: |
winget install gerardog.gsudo --accept-source-agreements --accept-package-agreements
icacls "$env:GITHUB_WORKSPACE" /grant "Everyone:(OI)(CI)F"
sudo --integrity Medium pnpm test:api-e2e
- name: run e2e tests (macOS)
if: runner.os == 'macOS' && env.HAS_CN_API_KEY == 'true'
timeout-minutes: 45
env:
CN_API_KEY: ${{ secrets.TAURI_E2E_CN_API_KEY }}
E2E_SPEC_RETRIES: '1'
# wdio.conf enables the CrabNebula Webdriver automatically on darwin and builds
# the `.app` bundle it needs.
run: pnpm test:api-e2e
- name: collect app crash reports (macOS)
if: runner.os == 'macOS' && failure()
run: .scripts/ci/collect-macos-crash-reports.sh "$RUNNER_TEMP/crash-reports"
- name: upload app crash reports (macOS)
if: runner.os == 'macOS' && failure()
uses: actions/upload-artifact@v7
with:
name: macos-crash-reports
path: ${{ runner.temp }}/crash-reports
if-no-files-found: ignore