Repository navigation
132 lines (119 loc) · 4.4 KB
/
Copy pathlinux.yml
File metadata and controls
132 lines (119 loc) · 4.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Linux
# Builds, lints and tests the Linux backend (GTK 4) and the tooling that runs
# it (`nsh run --target linux`, `nsh package --target linux`).
on:
push:
branches: [main]
paths:
- "crates/nsh-bundler/**"
- "crates/nsh-cli/**"
- "crates/nsh-core/**"
- "crates/nsh-dev/**"
- "crates/nsh-engine/**"
- "crates/nsh-js/**"
- "crates/nsh-linux-app/**"
- "crates/nsh-linux-host/**"
- "crates/nsh-macros/**"
- "crates/nsh-package/**"
- "crates/nsh-platform-linux/**"
- "crates/nsh-testing/**"
- "crates/nsh-base/**"
- "crates/xtask/**"
- "examples/counter/**"
- "examples/gallery/**"
- "Cargo.toml"
- "Cargo.lock"
- ".cargo/**"
- "rust-toolchain.toml"
- ".github/workflows/linux.yml"
pull_request:
paths:
- "crates/nsh-bundler/**"
- "crates/nsh-cli/**"
- "crates/nsh-core/**"
- "crates/nsh-dev/**"
- "crates/nsh-engine/**"
- "crates/nsh-js/**"
- "crates/nsh-linux-app/**"
- "crates/nsh-linux-host/**"
- "crates/nsh-macros/**"
- "crates/nsh-package/**"
- "crates/nsh-platform-linux/**"
- "crates/nsh-testing/**"
- "crates/nsh-base/**"
- "crates/xtask/**"
- "examples/counter/**"
- "examples/gallery/**"
- "Cargo.toml"
- "Cargo.lock"
- ".cargo/**"
- "rust-toolchain.toml"
- ".github/workflows/linux.yml"
merge_group:
types: [checks_requested]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: linux-${{ github.ref }}
cancel-in-progress: true
env:
# CI builds each crate once: no incremental state and no debug info
# (faster builds, smaller caches; panics still name their file and line).
CARGO_INCREMENTAL: "0"
CARGO_PROFILE_DEV_DEBUG: "0"
# The toolchain file's iOS and Android targets are only the release's.
RUSTUP_TOOLCHAIN: stable
jobs:
check:
# 24.04 has GTK 4.14 and Pango 1.52+, what `nsh-platform-linux` needs.
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
# QuickJS is C (bindgen needs libclang); the backend links GTK 4 and
# Pango, and WebKitGTK 6.0 for web views (the hosts' default); Xvfb
# is the display the examples' tests open their windows on.
- name: Install clang, GTK 4 and WebKitGTK
run: sudo apt-get update && sudo apt-get install -y clang libclang-dev libgtk-4-dev libwebkitgtk-6.0-dev xvfb
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
# Dependencies only: main's runs save it, pull requests restore it.
- name: Cache Cargo
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Clippy
run: >
cargo clippy --all-targets
-p nsh-platform-linux -p nsh-linux-host -p nsh-linux-app
-p nsh-cli -p nsh-dev -p xtask
-- -D warnings
# The backend alone, without the `webview` feature the hosts turn on:
# web views as placeholders.
- name: Clippy (without WebKitGTK)
run: cargo clippy --all-targets -p nsh-platform-linux -- -D warnings
# Tests need no display: they do not start GTK.
- name: Test
run: >
cargo test -p nsh-platform-linux -p nsh-cli -p nsh-dev
&& cargo test -p nsh-platform-linux --features webview
# The examples' tests in GTK windows on a virtual display, with the
# platform's input (`nsh test --target linux`): those a real platform
# runs (real time).
- name: Run the examples' tests in GTK windows
run: |
cargo build -p nsh-cli
# A session bus of its own: without one, GTK's portal and
# accessibility lookups wait for D-Bus autolaunch on each display.
run() { dbus-run-session -- xvfb-run -a ./target/debug/nsh test "$@" --target linux; }
run examples/counter
for file in context-menu device dock form gestures hover links navigation network photos resizable shortcuts storage timers; do
run "examples/gallery/tests/$file.test.tsx"
done
run examples/gallery/tests/environment.test.tsx --filter appearance
# Apps with Rust crates, in hosts built with them: a TSX app and a
# Rust app (its root).
run examples/rust-exports
run examples/gallery-rs/App.test.tsx