Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
273 commits
Select commit Hold shift + click to select a range
d86ce9d
On Wayland, fix `Window::is_decorated` with CSD
citorva Jul 18, 2023
0efcfaf
Add `platform::startup_notify` for Wayland/X11
kchibisov Jul 20, 2023
afebe2e
On Windows, add `drag_resize_window` method support (#2966)
citorva Jul 21, 2023
62b4ba8
Replace libc with rustix in some modules
notgull Jul 22, 2023
0ba4283
Correctly detect that we don't support Emscripten (#2971)
daxpedda Jul 22, 2023
164dce2
Add EventLoopExtPumpEvents and EventLoopExtRunOnDemand
rib Apr 11, 2023
7a954c7
Android: Implement EventLoopExtPumpEvents and EventLoopExtRunOnDemand
rib Jun 18, 2023
fae4cbd
Windows: Implement EventLoopExtPumpEvents and EventLoopExtRunOnDemand
rib Jun 18, 2023
6bb62d0
MacOS: Implement EventLoopExtPumpEvents and EventLoopExtRunOnDemand
rib Jun 18, 2023
a02c680
Linux: Implement EventLoopExtPumpEvents and EventLoopExtRunOnDemand
rib Jun 18, 2023
93f5f1a
Remove EventLoopExtRunReturn
rib Jun 18, 2023
e28974b
Re-work event loop run() API so it can return a Result
rib Apr 11, 2023
f8ffa31
Add examples/window_pump_events
rib Jun 18, 2023
f1a64b3
Add examples/window_ondemand
rib Jun 18, 2023
a2e1a0a
Update CHANGELOG.md
rib Jun 22, 2023
7d93c34
Linux: Sync with server/compositor before exiting run_ondemand
rib Jul 4, 2023
07652c7
window_ondemand: wait for Destroyed event before exiting app
rib Jul 4, 2023
973e6ad
MacOS: implement pump_events_with_timeout internally
rib Jul 23, 2023
456c735
Windows: implement pump_events_with_timeout internally
rib Jul 23, 2023
3f44eb1
Add timeout argument to pump_events
rib Jul 23, 2023
7de2bc7
iOS: Always set timer when polling to avoid slow waking (#2979)
mockersf Jul 28, 2023
3bf0fa9
Rename `LoopDestroyed` to `LoopExiting`
rib Jul 28, 2023
3925281
Remove RedrawEventsCleared + MainEventsCleared, and added AboutToWait
rib Jul 28, 2023
645b1ff
Update `objc2` version (#2936)
madsmtm Jul 28, 2023
f69616a
On Windows, add option to customize window class name (#2978)
geraudloup Jul 29, 2023
d21395b
On Windows, keep window maximized when setting size bounds (#2899)
hunger Jul 29, 2023
281077a
Remove `lifetime` from the `Event`
kchibisov Jul 30, 2023
5b90a4e
On X11, remove the now-unrefrenced events.rs source file
MarijnS95 Jul 31, 2023
d7827b3
Update icrate to v0.0.4 (#2992)
madsmtm Aug 2, 2023
7e9dc14
Export smol_str and impl Ord for Key
dhardy Aug 3, 2023
cff9b01
Add `Window::on_present_notify` to ack about drawing
kchibisov Jun 22, 2023
8ce58c7
On Wayland, use frame callbacks to throttle RedrawRequested
kchibisov Jun 22, 2023
794d0c1
On Web, use `requestAnimationFrame` for `RedrawRequested`
daxpedda Jun 23, 2023
61b921c
Increase test coverage for generic modules
notgull Aug 5, 2023
c268922
Remove functionality already exposed through `raw-window-handle`
madsmtm Aug 5, 2023
0287020
On Wayland, reduce amount of spurious wakeups
kchibisov Aug 5, 2023
03bf83f
Remove 'static requirement on `run`
kchibisov Aug 5, 2023
2791cbd
Make with_x11_visual take ID instead of a pointer
notgull Aug 5, 2023
4ab36f3
Propagate error from `EventLoop` creation
kchibisov Aug 6, 2023
ef5b71d
Revert "Propagate error from `EventLoop` creation" (#3010)
kchibisov Aug 6, 2023
5d9ce7f
On X11, set visual_id in raw-window-handle
kchibisov Aug 6, 2023
42ecef7
Fix event loop not waking up due to repeat source
kchibisov Aug 7, 2023
7451c4b
Android: Support unicode character mapping + dead keys
rib Aug 7, 2023
511bf53
iOS: Use NSOperatingSystemVersion from icrate (#3019)
fornwall Aug 9, 2023
c40af00
Add a way to embed the X11 window into another
notgull Aug 11, 2023
e3fbfd6
Fix touch force for Apple Pencil
lucasmerlin Aug 12, 2023
08ad3f1
Propagate error from `EventLoop` creation
kchibisov Aug 13, 2023
ba2bfd0
Reexport raw-window-handle in window module
kchibisov Aug 14, 2023
65c2482
Pin android-activity git dependency
kchibisov Aug 14, 2023
4e6ce00
Improve macOS/iOS/Web thread safety
madsmtm Aug 14, 2023
07dd45f
Bump MSRV to 1.65
kchibisov Aug 16, 2023
80d1e49
Use beta versions of android crates
kchibisov Aug 16, 2023
00b5de0
Winit version 0.29.0-beta.1
kchibisov Aug 14, 2023
7f1aaa6
Winit version 0.29.1-beta
kchibisov Aug 16, 2023
5144337
Implement `PartialOrd`/`Ord` for `KeyCode`/`NativeKeyCode`
StarStarJ Jul 1, 2023
647c320
Fix recent CI failures (#3041)
madsmtm Aug 24, 2023
a8a0462
Use `frame` instead of `visibleRect` (#3043)
madsmtm Aug 24, 2023
a24d092
Use `setTimeout()` trick instead of `Window.requestIdleCallback()` (#…
daxpedda Aug 25, 2023
f160a60
On Web, never return a `MonitorHandle` (#3051)
daxpedda Aug 26, 2023
a1a6f7b
Move `Event::RedrawRequested` to `WindowEvent` (#3049)
daxpedda Aug 27, 2023
05130cb
Improve CI caching, and give each job names
madsmtm Aug 27, 2023
865afd2
Make iOS fully thread safe (#3045)
madsmtm Aug 27, 2023
246d53d
Lock the cargo-apk deps on CI
kchibisov Aug 27, 2023
2d9b852
Fix macOS deminiaturize (#3054)
madsmtm Aug 27, 2023
2428224
Enable event propagation (#3062)
daxpedda Aug 28, 2023
4b30f9c
Web: Fullscreen Overhaul (#3063)
daxpedda Aug 29, 2023
25b629f
Implement X11 extensions using x11rb instead of Xlib
notgull Aug 29, 2023
ee4ec43
Fix missing quote (#3068)
madsmtm Aug 30, 2023
b278aa8
Ensure that winit initializes NSApplication (#3069)
madsmtm Aug 30, 2023
4681133
Make EventLoopWindowTarget independent of the user type on Orbital (#…
madsmtm Aug 30, 2023
c59d6bc
On Wayland, fix TouchPhase::Canceled sent for Move
kchibisov Aug 31, 2023
8455f34
Slightly reduce number of `cfg`s (#3071)
madsmtm Sep 1, 2023
cd5c1fb
Mark `startup_notify` unsafe functions as safe
kchibisov Sep 1, 2023
84d9bfd
Remove `T` from `EventLoopTargetWindow` (#3081)
daxpedda Sep 3, 2023
42243ce
Allow the user to force X11 under Wayland
notgull Sep 3, 2023
48647b5
Move `ControlFlow` to `EventLoopWindowTarget`
daxpedda Sep 7, 2023
28552c9
Revert select_xkb_events to its previous impl
notgull Sep 7, 2023
779212d
Correct set_exit() -> exit() in the changelog (#3088)
fornwall Sep 7, 2023
dda8053
Add `Window.requestIdleCallback()` support (#3084)
daxpedda Sep 7, 2023
ef9ed71
Add an MSRV policy to the README (#3046)
notgull Sep 8, 2023
c744b9a
Rename `PollType` to `PollStrategy` (#3089)
daxpedda Sep 8, 2023
56427e4
Ignore foreign-types* duplicate deps on macOS
daxpedda Sep 16, 2023
8d9fd3d
Install `cargo-apk` with the stable toolchain
daxpedda Sep 16, 2023
27cd207
Correct Wayland section in dpi docs
kchibisov Sep 16, 2023
e038597
Implement `PartialOrd` and `Ord` for `MouseButton`
StarStarJ Sep 17, 2023
367a2ae
On X11, fix WaitUntil and Poll behavior
Riateche Sep 20, 2023
c5cef46
Remove old docs about EventLoop::run
kchibisov Sep 22, 2023
220a2d3
Make `ControlFlow::Wait` the default (#3106)
daxpedda Sep 22, 2023
709929f
Pass force on touch events on android
lucasmerlin Sep 22, 2023
1f101b2
Remove `DeviceEvent::Text` event
kchibisov Sep 23, 2023
43d6eac
Fix transparent windows on X11
macmv Sep 25, 2023
ec83de3
Bump version on master (#3119)
madsmtm Sep 27, 2023
a52a6d4
Windows: Add #[deny(unsafe_op_in_unsafe_fn)] (#3070)
madsmtm Sep 29, 2023
d936321
X11: Add `#[deny(unsafe_op_in_unsafe_fn)]` (#3121)
madsmtm Sep 30, 2023
3af2562
Link to areweguiyet.com and arewegameyet.rs for extra deps
madsmtm Oct 3, 2023
4385c17
Make DeviceId contain device id's on Android
fornwall Oct 3, 2023
75ae402
Rename run_ondemand to run_on_demand
epimeletes Oct 3, 2023
3923c59
Update Clippy to v1.73 (#3135)
daxpedda Oct 7, 2023
570f310
Web: remove unnecessary usage of `once_cell::unsync::Lazy` (#3134)
daxpedda Oct 8, 2023
b41f01c
Add `Window::set_blur`
dsseng Oct 8, 2023
8339ddf
Web: fix `ControlFlow::WaitUntil` to never wake up **before** the giv…
daxpedda Oct 9, 2023
4a381fb
Remove obsolete docs about wayland CSD env variable
kchibisov Oct 10, 2023
112dcc8
On Wayland, fix MonitorHandle position
EvinceMoi Oct 10, 2023
0f9b958
Fix reset to `Poll` after the event loop starts
daxpedda Oct 10, 2023
976023b
Add `Window::show_window_menu`
YouKnow-sys Oct 10, 2023
5788319
Add Occluded and MemoryWarning events for iOS/Android
mockersf Oct 12, 2023
8d5d612
Fix CHANGELOG entry for Event::MemoryWarning
kchibisov Oct 12, 2023
f2d277e
feat: Implement set_cursor_hittest for X11
lunixbochs Oct 14, 2023
349a3e7
Update to new raw-window-handle strategy
notgull Oct 15, 2023
1fded24
Fix ndk deps versions
kchibisov Oct 15, 2023
b1bd0f7
Update SCTK to 0.18.0
kchibisov Oct 15, 2023
ea8604e
Fix potentially unaligned references in X11 device
notgull Oct 15, 2023
75b463a
Implement `AsFd`/`AsRawFd` for `EventLoop<T>`
kchibisov Oct 15, 2023
f3fb27c
Add a note on `Window::request_redraw` on Windows
kchibisov Oct 15, 2023
70e6ddd
Web Async Rework (#3082)
daxpedda Oct 16, 2023
f2edd23
Upgrade to `ndk 0.8`, `ndk-sys 0.5` + `android-activity 0.5` releases
MarijnS95 Oct 17, 2023
e6d2fd7
Remove resolved deny.toml entries
kchibisov Oct 17, 2023
d06deee
Make `WindowBuilder` `Send + Sync`
kchibisov Oct 17, 2023
99f86d7
On macOS, fix globe key triggering assertion
kchibisov Oct 17, 2023
df2f5ad
On Windows, fix `CursorEntered`/`CursorLeft` not sent during mouse grab
YouKnow-sys Oct 17, 2023
08b0464
Fix examples not render on Wayland
kchibisov Oct 17, 2023
18b8569
Ensure that DISPLAY vars are non-empty before using
kchibisov Oct 19, 2023
6b44521
Revise Key and KeyCode enums
dhardy Oct 19, 2023
f58fb69
Remove garbage from README
kchibisov Oct 19, 2023
cdee616
On macOS, fix tabGroup misuse
kchibisov Oct 20, 2023
20384d2
On iOS, add configuration for status bar style
arendjr Oct 20, 2023
f6cc6c1
On Windows, fix invalid hmonitor panic
xiaopengli89 Oct 20, 2023
0bc8f5e
Implement `Ord`/`PartialOrd` for `ModifiersState`
dhardy Oct 20, 2023
74fcf7f
On Windows, fix `RedrawRequested` delivery
kchibisov Oct 20, 2023
0656c54
On Windows, fix IME APIs MT-safety
kchibisov Oct 20, 2023
40ba9a7
feat(windows): Fix inconsistency in mouse button device events, add h…
valaphee Oct 20, 2023
7de33bc
Fix rwhd_05 doc links
dhardy Oct 21, 2023
08edda1
On X11, fix cursor_hittest not reloaded on Resize
kchibisov Oct 21, 2023
d82886b
Winit version 0.29.2
kchibisov Oct 17, 2023
7a87290
On Windows, fix deadlock during `Cursor{Enter,Leave}`
kchibisov Oct 22, 2023
ec41ddd
Fix unused import warnings on nightly
kchibisov Oct 25, 2023
0ee2698
On Winows, Fix deedlock with `WM_MOUSEMOVE`
kchibisov Oct 25, 2023
33a2e4c
On macOS, fix deadlock during nested event loops (e.g. rfd)
jpnurmi Oct 25, 2023
a5bb6d6
On wasm, provide intradoc-link for `spawn()` function in `EventLoop` …
MarijnS95 Oct 25, 2023
70a77b8
On Wayland, fix `RedrawRequsted` loop
kchibisov Oct 25, 2023
8e9a3d2
On Wayland, improve initial user size handling
kchibisov Oct 26, 2023
821fc63
On Windows, add support for Window::set_transparent
kchibisov Oct 27, 2023
5dea2a4
On macOS, add support for `Window::set_blur`
kchibisov Oct 28, 2023
7f851fe
Clarify `scale_factor` docs
kchibisov Oct 28, 2023
5252197
Winit version 0.29.3
kchibisov Oct 28, 2023
fc9c78c
On Windows, fix MT safety when starting drag
Jasper-Bekkers Oct 31, 2023
7a3b486
Fix crash when minimizing example on Windows
rhysd Oct 31, 2023
8b5aa33
Fix typo in pre_present_notify docs
DevJac Nov 1, 2023
7103514
Disable `default-features` for the `ndk` crate
MarijnS95 Nov 4, 2023
ecbe04c
On X11, try alternative cursor icon names as well
kchibisov Nov 4, 2023
f709ac6
On macOS, send a Resized event after ScaleFactorChanged
nixpulvis Nov 6, 2023
dec45ce
On Windows, fix `set_control_flow` from `AboutToWait
ogoffart Nov 8, 2023
a973096
On Wayland, fix wl_surface being dropped first
kchibisov Nov 11, 2023
f968e64
On macOS, fix assertion when pressing `Fn` key
kchibisov Nov 17, 2023
06cec06
Fix crash when running iPad build on macOS
arendjr Nov 22, 2023
7aa202b
Make Android docs build on docs.rs (#3236)
madsmtm Nov 23, 2023
7449534
Fix infinite recursion in `BadIcon` reporting (#3237)
kchibisov Nov 23, 2023
266219f
On X11, reload DPI on PropertyChange
notgull Nov 24, 2023
43f29f0
Winit version 0.29.4
kchibisov Nov 24, 2023
8119c72
On macOS, remove spurious error logging when handling `Fn`
emilk Nov 28, 2023
0738528
Remove unused .gitmodules
madsmtm Nov 28, 2023
e71f765
bugfix(x11): Properly interpret float data in drag ops
notgull Nov 28, 2023
a82327c
bugfix(x11): Use the right atom type in focus_window()
notgull Nov 29, 2023
1681410
fix refresh_rate_millihertz on macOS (#3254)
xiaopengli89 Dec 1, 2023
966c033
Changes and improvements to the documentation (#3253)
Blatko1 Dec 3, 2023
d621ab5
On Windows, avoid panic in `video_modes()`
fornwall Dec 6, 2023
5011a67
m: Update to x11rb 0.13.0
psychon Dec 9, 2023
8c4a6dd
On Wayland, make `wl_subcompositor` protocol optional
MarijnS95 Dec 14, 2023
3dc5c42
Fix typo in `get_xft_dpi`
hecrj Dec 15, 2023
40cee23
Update `sctk-adwaita` to 0.8
Friz64 Dec 16, 2023
44052a0
On Windows, fix `set_fullscreen` early return for `Fullscreen::Border…
amrbashir Dec 16, 2023
a5b89bf
On Wayland, fix resize being sent on focus change
kchibisov Dec 20, 2023
e00204e
On windows, remove empty file
kchibisov Dec 20, 2023
cafcaa2
On Wayland, ensure initial resize delivery
kchibisov Dec 21, 2023
6fbdbce
On Windows, fix IME area not working
wjian23 Dec 21, 2023
380dc4c
Winit version 0.29.5
kchibisov Dec 21, 2023
5289b4f
On Web, fix context menu not being disabled
daxpedda Dec 21, 2023
e395961
On Windows, refactor dynamic function definitions and raw input keybo…
msiglreith Dec 22, 2023
9b03bb7
Fix some doc nits (#3274)
daxpedda Dec 22, 2023
a32e232
On Windows, remove internal WindowWrapper (#3294)
msiglreith Dec 23, 2023
2d1607b
bugfix(rwh): Bump rwh_05 min version to 0.5.2
alexheretic Dec 24, 2023
5ca810b
On Wayland, fix WindowEvent::Destroyed delivery
kchibisov Dec 22, 2023
11d1b7a
Fix run_on_demand exiting on consequent call
kchibisov Dec 22, 2023
87fc198
On X11, simplify available_monitors() impl
psychon Dec 24, 2023
572d61f
Winit version 0.29.6
kchibisov Dec 24, 2023
b343f45
bugfix: Reload Xft database on DPI change
notgull Dec 26, 2023
23b3c12
bugfix: Change value sent to X server during minimize
notgull Dec 27, 2023
9135eb4
Winit version 0.29.7
kchibisov Dec 27, 2023
5b4f97e
On X11, query for higher Xrandr version
notgull Dec 29, 2023
63d52aa
On Wayland, fix `Window::request_inner_size` during resize
kchibisov Dec 29, 2023
2e61011
On X11, update keymap on XkbMapNotify
kchibisov Dec 29, 2023
3f82a6a
On X11, fix `ModifiersChanged` from xdotool
kchibisov Dec 30, 2023
2998bbf
On X11, cache the XRandR extension version
notgull Dec 30, 2023
2bf12c7
On X11, fix IME input lagging behind
kchibisov Dec 31, 2023
6eb79f0
Winit version 0.29.8
kchibisov Dec 31, 2023
017ff26
On X11 and Wayland, fix numpad up being ArrowLeft
kchibisov Jan 2, 2024
cf0a533
Issue resize due to scale change on Wayland
kchibisov Jan 3, 2024
fdedda3
On X11, fix error propagation in EventLoop::new
kchibisov Jan 5, 2024
324dd5f
On macOS, reported shifted key with shift+Ctrl/Cmd
emilk Jan 5, 2024
da82971
Winit version 0.29.9
kchibisov Jan 5, 2024
87f44ec
Web: account for canvas being focused already (#3369)
daxpedda Jan 6, 2024
978ec7d
Web: increase cursor position accuracy (#3380)
daxpedda Jan 10, 2024
c4bfbbe
ci: Fix dead code error on nightly
daxpedda Jan 14, 2024
dbeeaef
Winit version 0.29.10
daxpedda Jan 14, 2024
a90cd1c
Web: support Firefox `privacy.resistFingerprinting` (#3371)
daxpedda Jan 6, 2024
0270516
On macOS, fix incorrect IME cursor rect origin
uiryuu Jan 20, 2024
45b5f3b
On Windows, set fullscreen/maximized creating window
kazatsuyu Jan 19, 2024
be63581
Fix Android examples link in README (#3420)
madsmtm Jan 24, 2024
85052c0
Send the event before waking up the message pump. (#3418)
dtzxporter Jan 24, 2024
0dc376a
Improve error when X11/Wayland is not present
dhardy Jan 25, 2024
221b2e7
bugfix: Fix swapped instance and general class names on X11
ulrikdem Jan 28, 2024
57cb312
On Wayland, disable Occluded handling
kchibisov Jan 30, 2024
3035546
On X11, reload DPI on _XSETTINGS_SETTINGS
notgull Jan 30, 2024
c9030f0
On Wayland, send `Focused(false)` once seats left
kchibisov Jan 30, 2024
3de0820
On Wayland, fix min/max inner size setting
kchibisov Jan 31, 2024
bd2d276
On Windows, apply `ScaleFactorChanged` new size if different than OS
amrbashir Feb 6, 2024
ba6254b
Account for WAYLAND_SOCKET when detecting Wayland
kchibisov Feb 7, 2024
bc5b6ff
Fix compatibility with platforms without AtomicU64
kchibisov Feb 7, 2024
a6b2564
On Orbital, implement `KeyEventExtModifiersSupplement`
jackpot51 Feb 8, 2024
ad892c6
On Orbital, map keys to `NamedKey` when possible
jackpot51 Feb 9, 2024
ed600e4
On X11, don't require XSETTINGS
kchibisov Feb 9, 2024
0135fe5
On X11, store window target on EventProcessor
kchibisov Feb 9, 2024
bcd2fba
On X11, extract event handlers
kchibisov Feb 9, 2024
961b675
On Orbital, implement various Window methods
jackpot51 Feb 11, 2024
00fe656
On X11, don't require XIM to be present
kchibisov Feb 13, 2024
54ad02e
On Wayland, update title from AboutToWait
kchibisov Feb 13, 2024
9c033ce
Pin `ahash` in CI (#3498)
madsmtm Feb 16, 2024
cb855b8
On X11, use events modifiers to detect state
kchibisov Feb 17, 2024
3e42fa3
On Windows, fix nightly warnings
kchibisov Feb 13, 2024
96d29ab
Fix warnings with latest nightly
kchibisov Feb 19, 2024
64084c5
On Wayland, send DeviceEvent::Motion
JustLinuxUser Feb 20, 2024
8ce5f6e
Pin bumpalo to 3.14.0 on CI
kchibisov Feb 21, 2024
016fd47
On X11, force resend modifiers when focus changes
kchibisov Feb 22, 2024
454dc56
Update documentation regarding `set_cursor_position` (#3521)
Friz64 Feb 24, 2024
d2acea9
Fix nightly CI
daxpedda Feb 26, 2024
2e63493
On X11, replay modifiers consumed by XIM
kchibisov Feb 26, 2024
8b6c8ef
Winit version 0.29.11
kchibisov Feb 13, 2024
2dae807
On X11, filter out tiny device mouse events
notgull Mar 1, 2024
58c89c1
On X11, fix use after free during xinput2 processing
kchibisov Mar 1, 2024
1c5fcf3
Winit version 0.29.12
kchibisov Mar 1, 2024
8d66df7
Web: fix crash with `ControlFlow::Wait|WaitUntil`
daxpedda Mar 2, 2024
b1dad45
Winit version 0.29.13
daxpedda Mar 2, 2024
7601a15
bugfix(x11): fix incorrect delta filtering
notgull Mar 2, 2024
70fc8f6
chore(wayland): don't reapply same cursor grab
kchibisov Mar 5, 2024
090800e
Bump `x11-dl` to v2.19.1
daxpedda Mar 5, 2024
ba4660d
fix(xkb): text not being None when composing
kchibisov Mar 5, 2024
aaaf089
Winit version 0.29.14
kchibisov Mar 5, 2024
10a492b
bugfix(x11): crash when querying xsettings prop fails
kchibisov Mar 7, 2024
8f08fba
Winit version 0.29.15
kchibisov Mar 13, 2024
0c4d92c
add remote notification registration app delegates
extrawurst Apr 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
214 changes: 125 additions & 89 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,146 +6,182 @@ on:
branches: [master]

jobs:
Check_Formatting:
fmt:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: hecrj/setup-rust-action@v1
- uses: dtolnay/rust-toolchain@stable
with:
rust-version: stable
components: rustfmt
- name: Check Formatting
run: cargo +stable fmt --all -- --check

cargo-deny:
name: cargo-deny

# TODO: remove this matrix when https://github.com/EmbarkStudios/cargo-deny/issues/324 is resolved
strategy:
fail-fast: false
matrix:
platform:
- aarch64-apple-ios
- aarch64-linux-android
- i686-pc-windows-gnu
- i686-pc-windows-msvc
- i686-unknown-linux-gnu
- wasm32-unknown-unknown
- x86_64-apple-darwin
- x86_64-apple-ios
- x86_64-pc-windows-gnu
- x86_64-pc-windows-msvc
- x86_64-unknown-linux-gnu
- x86_64-unknown-redox

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check
log-level: error
arguments: --all-features --target ${{ matrix.platform }}
run: cargo fmt -- --check

tests:
name: Tests
name: Test ${{ matrix.toolchain }} ${{ matrix.platform.name }}
runs-on: ${{ matrix.platform.os }}

strategy:
fail-fast: false
matrix:
rust_version: ['1.64.0', stable, nightly]
toolchain: [stable, nightly, '1.65.0']
platform:
# Note: Make sure that we test all the `docs.rs` targets defined in Cargo.toml!
- { target: x86_64-pc-windows-msvc, os: windows-latest, }
- { target: i686-pc-windows-msvc, os: windows-latest, }
- { target: x86_64-pc-windows-gnu, os: windows-latest, host: -x86_64-pc-windows-gnu }
- { target: i686-pc-windows-gnu, os: windows-latest, host: -i686-pc-windows-gnu }
- { target: i686-unknown-linux-gnu, os: ubuntu-latest, }
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest, }
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest, options: --no-default-features, features: x11 }
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest, options: --no-default-features, features: "wayland,wayland-dlopen" }
- { target: aarch64-linux-android, os: ubuntu-latest, options: -p winit, cmd: 'apk --', features: "android-native-activity" }
- { target: x86_64-unknown-redox, os: ubuntu-latest, }
- { target: x86_64-apple-darwin, os: macos-latest, }
- { target: x86_64-apple-ios, os: macos-latest, }
- { target: aarch64-apple-ios, os: macos-latest, }
# We're using Windows rather than Ubuntu to run the wasm tests because caching cargo-web
# doesn't currently work on Linux.
- { target: wasm32-unknown-unknown, os: windows-latest, }
- { name: 'Windows 64bit MSVC', target: x86_64-pc-windows-msvc, os: windows-latest, }
- { name: 'Windows 32bit MSVC', target: i686-pc-windows-msvc, os: windows-latest, }
- { name: 'Windows 64bit GNU', target: x86_64-pc-windows-gnu, os: windows-latest, host: -x86_64-pc-windows-gnu }
- { name: 'Windows 32bit GNU', target: i686-pc-windows-gnu, os: windows-latest, host: -i686-pc-windows-gnu }
- { name: 'Linux 32bit', target: i686-unknown-linux-gnu, os: ubuntu-latest, }
- { name: 'Linux 64bit', target: x86_64-unknown-linux-gnu, os: ubuntu-latest, }
- { name: 'X11', target: x86_64-unknown-linux-gnu, os: ubuntu-latest, options: '--no-default-features --features=x11' }
- { name: 'Wayland', target: x86_64-unknown-linux-gnu, os: ubuntu-latest, options: '--no-default-features --features=wayland,wayland-dlopen' }
- { name: 'Android', target: aarch64-linux-android, os: ubuntu-latest, options: '--package=winit --features=android-native-activity', cmd: 'apk --' }
- { name: 'Redox OS', target: x86_64-unknown-redox, os: ubuntu-latest, }
- { name: 'macOS', target: x86_64-apple-darwin, os: macos-latest, }
- { name: 'iOS x86_64', target: x86_64-apple-ios, os: macos-latest, }
- { name: 'iOS Aarch64', target: aarch64-apple-ios, os: macos-latest, }
- { name: 'web', target: wasm32-unknown-unknown, os: ubuntu-latest, }
exclude:
# Android is tested on stable-3
- toolchain: '1.65.0'
platform: { name: 'Android', target: aarch64-linux-android, os: ubuntu-latest, options: '--package=winit --features=android-native-activity', cmd: 'apk --' }
include:
- toolchain: '1.69.0'
platform: { name: 'Android', target: aarch64-linux-android, os: ubuntu-latest, options: '--package=winit --features=android-native-activity', cmd: 'apk --' }

env:
# Set more verbose terminal output
CARGO_TERM_VERBOSE: true
RUST_BACKTRACE: 1
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 --deny warnings"
OPTIONS: ${{ matrix.platform.options }}
FEATURES: ${{ format(',{0}', matrix.platform.features ) }}

# Faster compilation and error on warnings
RUSTFLAGS: '--codegen=debuginfo=0 --deny=warnings'
RUSTDOCFLAGS: '--deny=warnings'

OPTIONS: --target=${{ matrix.platform.target }} ${{ matrix.platform.options }}
CMD: ${{ matrix.platform.cmd }}
RUSTDOCFLAGS: -Dwarnings

runs-on: ${{ matrix.platform.os }}
steps:
- uses: actions/checkout@v3
# Used to cache cargo-web
- name: Cache cargo folder
uses: actions/cache@v1
with:
path: ~/.cargo
key: ${{ matrix.platform.target }}-cargo-${{ matrix.rust_version }}

- uses: hecrj/setup-rust-action@v1
- name: Restore cache of cargo folder
# We use `restore` and later `save`, so that we can create the key after
# the cache has been downloaded.
#
# This could be avoided if we added Cargo.lock to the repository.
uses: actions/cache/restore@v3
with:
rust-version: ${{ matrix.rust_version }}${{ matrix.platform.host }}
targets: ${{ matrix.platform.target }}
components: clippy
# https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: cargo-${{ matrix.toolchain }}-${{ matrix.platform.name }}-never-intended-to-be-found
restore-keys: cargo-${{ matrix.toolchain }}-${{ matrix.platform.name }}

- name: Generate lockfile
# Also updates the crates.io index
run: cargo generate-lockfile && cargo update -p ahash --precise 0.8.7 && cargo update -p bumpalo --precise 3.14.0

- name: Install GCC Multilib
if: (matrix.platform.os == 'ubuntu-latest') && contains(matrix.platform.target, 'i686')
run: sudo apt-get update && sudo apt-get install gcc-multilib
- name: Install cargo-apk

- name: Cache cargo-apk
if: contains(matrix.platform.target, 'android')
run: cargo install cargo-apk
id: cargo-apk-cache
uses: actions/cache@v3
with:
path: ~/.cargo/bin/cargo-apk
# Change this key if we update the required cargo-apk version
key: cargo-apk-v0-9-7

- uses: dtolnay/rust-toolchain@master
if: contains(matrix.platform.target, 'android') && (steps.cargo-apk-cache.outputs.cache-hit != 'true')
with:
toolchain: stable

- name: Install cargo-apk
if: contains(matrix.platform.target, 'android') && (steps.cargo-apk-cache.outputs.cache-hit != 'true')
run: cargo install cargo-apk --version=^0.9.7 --locked

- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}${{ matrix.platform.host }}
targets: ${{ matrix.platform.target }}
components: clippy

- name: Check documentation
shell: bash
run: cargo doc --no-deps --target ${{ matrix.platform.target }} $OPTIONS --features $FEATURES --document-private-items
run: cargo doc --no-deps $OPTIONS --document-private-items

- name: Build crate
shell: bash
run: cargo $CMD build --verbose --target ${{ matrix.platform.target }} $OPTIONS --features $FEATURES
run: cargo $CMD build $OPTIONS

- name: Build tests
shell: bash
if: >
!contains(matrix.platform.target, 'redox') &&
matrix.rust_version != '1.64.0'
run: cargo $CMD test --no-run --verbose --target ${{ matrix.platform.target }} $OPTIONS --features $FEATURES
matrix.toolchain != '1.65.0'
run: cargo $CMD test --no-run $OPTIONS

- name: Run tests
shell: bash
if: >
!contains(matrix.platform.target, 'android') &&
!contains(matrix.platform.target, 'ios') &&
!contains(matrix.platform.target, 'wasm32') &&
!contains(matrix.platform.target, 'redox') &&
matrix.rust_version != '1.64.0'
run: cargo $CMD test --verbose --target ${{ matrix.platform.target }} $OPTIONS --features $FEATURES
matrix.toolchain != '1.65.0'
run: cargo $CMD test $OPTIONS

- name: Lint with clippy
shell: bash
if: (matrix.rust_version == 'stable') && !contains(matrix.platform.options, '--no-default-features')
run: cargo clippy --all-targets --target ${{ matrix.platform.target }} $OPTIONS --features $FEATURES -- -Dwarnings
if: (matrix.toolchain == 'stable') && !contains(matrix.platform.options, '--no-default-features')
run: cargo clippy --all-targets $OPTIONS -- -Dwarnings

- name: Build tests with serde enabled
shell: bash
if: >
!contains(matrix.platform.target, 'redox') &&
matrix.rust_version != '1.64.0'
run: cargo $CMD test --no-run --verbose --target ${{ matrix.platform.target }} $OPTIONS --features serde,$FEATURES
matrix.toolchain != '1.65.0'
run: cargo $CMD test --no-run $OPTIONS --features serde

- name: Run tests with serde enabled
shell: bash
if: >
!contains(matrix.platform.target, 'android') &&
!contains(matrix.platform.target, 'ios') &&
!contains(matrix.platform.target, 'wasm32') &&
!contains(matrix.platform.target, 'redox') &&
matrix.rust_version != '1.64.0'
run: cargo $CMD test --verbose --target ${{ matrix.platform.target }} $OPTIONS --features serde,$FEATURES
matrix.toolchain != '1.65.0'
run: cargo $CMD test $OPTIONS --features serde

# See restore step above
- name: Save cache of cargo folder
uses: actions/cache/save@v3
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: cargo-${{ matrix.toolchain }}-${{ matrix.platform.name }}-${{ hashFiles('Cargo.lock') }}

cargo-deny:
name: Run cargo-deny on ${{ matrix.platform.name }}
runs-on: ubuntu-latest

# TODO: remove this matrix when https://github.com/EmbarkStudios/cargo-deny/issues/324 is resolved
strategy:
fail-fast: false
matrix:
platform:
- { name: 'Android', target: aarch64-linux-android }
- { name: 'iOS', target: aarch64-apple-ios }
- { name: 'Linux', target: x86_64-unknown-linux-gnu }
- { name: 'macOS', target: x86_64-apple-darwin }
- { name: 'Redox OS', target: x86_64-unknown-redox }
- { name: 'web', target: wasm32-unknown-unknown }
- { name: 'Windows', target: x86_64-pc-windows-gnu }

steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check
log-level: error
arguments: --all-features --target ${{ matrix.platform.target }}
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

Loading