mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-12-05 06:26:30 +01:00
build(nix): build and check for macOS and Windows
A flake that builds the recorder for macOS and cross-compiles it for Windows from a Mac (xwin for the SDK, LLVM for the toolchain), with a dev shell for each, and `nix flake check` running clippy for both targets, rustfmt, taplo, cargo-deny and the tests. The sources of komorebi for Mac and komorebi for Windows are flake inputs, pinned in `flake.lock`: the recorder indexes them so that a line of komorebi's log can be traced to the statement that wrote it, and the dev shells and every derivation export where they are.
This commit is contained in:
1 parent
af3c080ace
commit
76bae0630e
7 files changed
+665
-7
No files matched your search
@@ -1,7 +1,7 @@
|
||||
export RUST_BACKTRACE := "full"
|
||||
|
||||
# everything CI checks, in order
|
||||
check: fmt-check clippy test doc deny
|
||||
# everything CI checks, in order; run it inside `nix develop` (direnv does)
|
||||
check: fmt-check clippy check-windows test doc deny
|
||||
|
||||
# nightly rustfmt, which the devShell provides, and the macros this project does not allow
|
||||
fmt-check:
|
||||
@@ -20,6 +20,9 @@ fix:
|
||||
clippy:
|
||||
cargo clippy --workspace --all-targets --locked -- -D warnings
|
||||
|
||||
# type-check every `cfg(windows)` line, tests included, from a Mac (the Windows devShell targets x86_64-pc-windows-msvc)
|
||||
check-windows:
|
||||
nix develop .#windows --command cargo clippy --workspace --all-targets --locked -- -D warnings
|
||||
|
||||
# lib, integration and doc tests; the ones that read komorebi's source need KOMOREBI_MAC_SRC, which `nix develop` sets
|
||||
test:
|
||||
@@ -28,6 +31,7 @@ test:
|
||||
# rustdoc with its warnings as errors, for both hosts: links in `cfg(windows)` docs are only checked on Windows
|
||||
doc:
|
||||
RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --locked
|
||||
nix develop .#windows --command env RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --locked
|
||||
|
||||
deny:
|
||||
cargo deny check
|
||||
@@ -48,6 +52,9 @@ run target:
|
||||
record *args:
|
||||
cargo run --bin komorebi-recorder --locked -- {{ args }}
|
||||
|
||||
# cross-compile komorebi-recorder.exe and komorebi-recorder-gui.exe into ./result-windows
|
||||
build-windows:
|
||||
nix build .#komorebi-recorder-windows --out-link result-windows
|
||||
|
||||
deps:
|
||||
cargo update
|
||||
|
||||
Reference in new issue
Block a user