mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-18 00:12:57 +00:00
Workspace, build tooling and CI: the cl command, profiles, one feature set, workflows
This commit is contained in:
@@ -39,6 +39,11 @@ jobs:
|
||||
targets: wasm32-unknown-unknown
|
||||
- run: cargo fmt --check
|
||||
- run: cargo clippy -p craft-ai-core --all-targets --locked -- -D warnings
|
||||
- name: Docs (links and missing docs)
|
||||
if: runner.os == 'Linux'
|
||||
run: cargo doc -p craft-ai-core --no-deps --locked
|
||||
env:
|
||||
RUSTDOCFLAGS: -D warnings
|
||||
- run: cargo test -p craft-ai-core --locked
|
||||
# The model promises to compile for the web.
|
||||
- run: cargo check -p craft-ai-core --target wasm32-unknown-unknown --locked
|
||||
|
||||
@@ -41,6 +41,11 @@ jobs:
|
||||
run: sudo apt-get update && sudo apt-get install -y acl
|
||||
- run: cargo fmt --check
|
||||
- run: cargo clippy -p craft-atomic -p craft-settings --all-targets --locked -- -D warnings
|
||||
- name: Docs (links and missing docs)
|
||||
if: runner.os == 'Linux'
|
||||
run: cargo doc -p craft-atomic -p craft-settings --no-deps --locked
|
||||
env:
|
||||
RUSTDOCFLAGS: -D warnings
|
||||
- run: cargo test -p craft-atomic -p craft-settings --locked -- --nocapture
|
||||
- name: Check inherited Linux ACLs
|
||||
if: runner.os == 'Linux'
|
||||
|
||||
@@ -45,6 +45,11 @@ jobs:
|
||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
||||
- run: cargo fmt -p craft-crw --check
|
||||
- run: cargo clippy -p craft-crw --all-targets --locked -- -D warnings
|
||||
- name: Docs (links and missing docs)
|
||||
if: runner.os == 'Linux'
|
||||
run: cargo doc -p craft-crw --no-deps --locked
|
||||
env:
|
||||
RUSTDOCFLAGS: -D warnings
|
||||
- run: cargo test -p craft-crw --locked
|
||||
|
||||
wasm:
|
||||
@@ -95,7 +100,7 @@ jobs:
|
||||
key: crw-samples-${{ hashFiles('crates/crw/tests/samples.json') }}
|
||||
- name: Fetch the pinned CC0 sample files (raw.pixls.us)
|
||||
run: python scripts/fetch-crw-samples.py "$RUNNER_TEMP/crw-samples"
|
||||
- run: cargo test -p craft-crw --release --locked --test samples -- --nocapture
|
||||
- run: cargo test -p craft-crw --release --locked --lib -- integration::samples --nocapture
|
||||
env:
|
||||
CRAFT_CRW_SAMPLES: ${{ runner.temp }}/crw-samples
|
||||
CRAFT_CRW_REQUIRE_SAMPLES: "1"
|
||||
|
||||
@@ -39,4 +39,8 @@ jobs:
|
||||
targets: aarch64-apple-darwin
|
||||
- run: cargo clippy -p craft-dialogs --all-targets --locked -- -D warnings
|
||||
- run: cargo clippy -p craft-dialogs --target aarch64-apple-darwin --locked -- -D warnings
|
||||
- name: Docs (links and missing docs)
|
||||
run: cargo doc -p craft-dialogs --no-deps --locked
|
||||
env:
|
||||
RUSTDOCFLAGS: -D warnings
|
||||
- run: cargo test -p craft-dialogs --locked
|
||||
|
||||
@@ -42,6 +42,11 @@ jobs:
|
||||
- run: cargo fmt --check
|
||||
- run: cargo clippy -p craft-doc --all-targets --locked -- -D warnings
|
||||
- run: cargo clippy -p craft-doc --all-targets --all-features --locked -- -D warnings
|
||||
- name: Docs (links and missing docs)
|
||||
if: runner.os == 'Linux'
|
||||
run: cargo doc -p craft-doc --all-features --no-deps --locked
|
||||
env:
|
||||
RUSTDOCFLAGS: -D warnings
|
||||
- run: cargo test -p craft-doc --locked -- --nocapture
|
||||
- run: cargo test -p craft-doc --all-features --locked -- --nocapture
|
||||
- run: cargo check -p craft-doc --all-features --locked --target wasm32-unknown-unknown
|
||||
|
||||
@@ -38,4 +38,9 @@ jobs:
|
||||
components: rustfmt, clippy
|
||||
- run: cargo fmt --check
|
||||
- run: cargo clippy -p craft-docpath --all-targets --locked -- -D warnings
|
||||
- name: Docs (links and missing docs)
|
||||
if: runner.os == 'Linux'
|
||||
run: cargo doc -p craft-docpath --no-deps --locked
|
||||
env:
|
||||
RUSTDOCFLAGS: -D warnings
|
||||
- run: cargo test -p craft-docpath --locked -- --nocapture
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
name: Docs
|
||||
|
||||
# Builds the documentation of every workspace crate with warnings as errors, so a public item
|
||||
# without a doc comment or a broken doc link fails, including crates no other workflow covers.
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [main]
|
||||
paths: ['crates/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/docs.yml']
|
||||
pull_request:
|
||||
paths: ['crates/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/docs.yml']
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
docs:
|
||||
timeout-minutes: 30
|
||||
name: Workspace docs
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
# The token isn't needed after checkout; cargo runs build scripts and proc macros from
|
||||
# dependencies, so don't leave it in .git/config for that third-party code to read.
|
||||
persist-credentials: false
|
||||
- uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
|
||||
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
|
||||
- name: Docs (links and missing docs)
|
||||
run: cargo doc --workspace --no-deps --locked
|
||||
env:
|
||||
RUSTDOCFLAGS: -D warnings
|
||||
@@ -41,5 +41,10 @@ jobs:
|
||||
targets: wasm32-unknown-unknown
|
||||
- run: cargo fmt --check
|
||||
- run: cargo clippy -p craft-ecproj-format --all-targets --locked -- -D warnings
|
||||
- name: Docs (links and missing docs)
|
||||
if: runner.os == 'Linux'
|
||||
run: cargo doc -p craft-ecproj-format --no-deps --locked
|
||||
env:
|
||||
RUSTDOCFLAGS: -D warnings
|
||||
- run: cargo test -p craft-ecproj-format --locked -- --nocapture
|
||||
- run: cargo check -p craft-ecproj-format --locked --target wasm32-unknown-unknown
|
||||
|
||||
@@ -39,6 +39,11 @@ jobs:
|
||||
targets: wasm32-unknown-unknown
|
||||
- run: cargo fmt --check
|
||||
- run: cargo clippy -p craft-font-store --all-targets --locked -- -D warnings
|
||||
- name: Docs (links and missing docs)
|
||||
if: runner.os == 'Linux'
|
||||
run: cargo doc -p craft-font-store --no-deps --locked
|
||||
env:
|
||||
RUSTDOCFLAGS: -D warnings
|
||||
- run: cargo test -p craft-font-store --locked
|
||||
- run: cargo clippy -p craft-font-catalog --all-targets --locked -- -D warnings
|
||||
- run: cargo test -p craft-font-catalog --locked
|
||||
|
||||
@@ -38,4 +38,9 @@ jobs:
|
||||
components: rustfmt, clippy
|
||||
- run: cargo fmt --check
|
||||
- run: cargo clippy -p craft-i18n --all-targets --features collate --locked -- -D warnings
|
||||
- name: Docs (links and missing docs)
|
||||
if: runner.os == 'Linux'
|
||||
run: cargo doc -p craft-i18n --no-deps --locked
|
||||
env:
|
||||
RUSTDOCFLAGS: -D warnings
|
||||
- run: cargo test -p craft-i18n --features collate --locked -- --nocapture
|
||||
|
||||
@@ -42,5 +42,9 @@ jobs:
|
||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
||||
- run: cargo fmt -p craft-jpeg --check
|
||||
- run: cargo clippy -p craft-jpeg --all-targets --locked -- -D warnings
|
||||
- name: Docs (links and missing docs)
|
||||
run: cargo doc -p craft-jpeg --no-deps --locked
|
||||
env:
|
||||
RUSTDOCFLAGS: -D warnings
|
||||
- run: cargo test -p craft-jpeg --locked
|
||||
- run: cargo check -p craft-jpeg --locked --target wasm32-unknown-unknown
|
||||
|
||||
@@ -3,9 +3,9 @@ name: Keymap
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths: ["crates/keymap/**", "crates/settings/**", "crates/ui/**", "crates/i18n/**", "Cargo.toml", "Cargo.lock", ".github/workflows/keymap.yml"]
|
||||
paths: ["crates/keymap/**", "crates/settings/**", "crates/ui/**", "crates/ui-contract/**", "crates/ui-widgets/**", "crates/ui-panels/**", "crates/ui-canvas/**", "crates/ui-patterns/**", "crates/ui-shell/**", "crates/i18n/**", "Cargo.toml", "Cargo.lock", ".github/workflows/keymap.yml"]
|
||||
pull_request:
|
||||
paths: ["crates/keymap/**", "crates/settings/**", "crates/ui/**", "crates/i18n/**", "Cargo.toml", "Cargo.lock", ".github/workflows/keymap.yml"]
|
||||
paths: ["crates/keymap/**", "crates/settings/**", "crates/ui/**", "crates/ui-contract/**", "crates/ui-widgets/**", "crates/ui-panels/**", "crates/ui-canvas/**", "crates/ui-patterns/**", "crates/ui-shell/**", "crates/i18n/**", "Cargo.toml", "Cargo.lock", ".github/workflows/keymap.yml"]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
@@ -50,9 +50,13 @@ jobs:
|
||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
||||
- run: cargo fmt -p craft-keymap --check
|
||||
- run: cargo clippy -p craft-keymap --all-targets --no-default-features --locked -- -D warnings
|
||||
# `snapshot` covers `ui` and `egui` and compiles the dialog screenshots, which need a GPU
|
||||
# `screen-testing` covers `ui` and compiles the dialog screenshots, which need a GPU
|
||||
# to run, so the test steps leave them out.
|
||||
- run: cargo clippy -p craft-keymap --all-targets --features snapshot --locked -- -D warnings
|
||||
- run: cargo clippy -p craft-keymap --all-targets --features screen-testing --locked -- -D warnings
|
||||
- name: Docs (links and missing docs)
|
||||
run: cargo doc -p craft-keymap --no-deps --locked
|
||||
env:
|
||||
RUSTDOCFLAGS: -D warnings
|
||||
# Doctests run once, in the `ui` step.
|
||||
- name: Test core
|
||||
run: cargo test -p craft-keymap --no-default-features --lib --tests --locked
|
||||
|
||||
@@ -49,6 +49,10 @@ jobs:
|
||||
- run: cargo clippy -p craft-media --all-targets --locked --all-features -- -D warnings
|
||||
- run: cargo clippy -p craft-media-testkit --all-targets --locked -- -D warnings
|
||||
- run: cargo clippy -p craft-media --all-targets --locked --no-default-features --features serde -- -D warnings
|
||||
- name: Docs (links and missing docs)
|
||||
run: cargo doc -p craft-media -p craft-media-testkit --all-features --no-deps --locked
|
||||
env:
|
||||
RUSTDOCFLAGS: -D warnings
|
||||
- run: cargo check -p craft-media --all-features --locked --target wasm32-unknown-unknown
|
||||
test:
|
||||
timeout-minutes: 15
|
||||
|
||||
@@ -41,5 +41,10 @@ jobs:
|
||||
targets: wasm32-unknown-unknown
|
||||
- run: cargo fmt --check
|
||||
- run: cargo clippy -p craft-pcraft-format --all-targets --locked -- -D warnings
|
||||
- name: Docs (links and missing docs)
|
||||
if: runner.os == 'Linux'
|
||||
run: cargo doc -p craft-pcraft-format --no-deps --locked
|
||||
env:
|
||||
RUSTDOCFLAGS: -D warnings
|
||||
- run: cargo test -p craft-pcraft-format --locked -- --nocapture
|
||||
- run: cargo check -p craft-pcraft-format --locked --target wasm32-unknown-unknown
|
||||
|
||||
@@ -54,6 +54,11 @@ jobs:
|
||||
echo "CRAFT_PDF_TEST_FONT_DIR=$RUNNER_TEMP/craft-pdf-test-fonts" >> "$GITHUB_ENV"
|
||||
- run: cargo fmt --check
|
||||
- run: cargo clippy -p craft-pdf --all-targets --all-features --locked -- -D warnings
|
||||
- name: Docs (links and missing docs)
|
||||
if: runner.os == 'Linux'
|
||||
run: cargo doc -p craft-pdf --all-features --no-deps --locked
|
||||
env:
|
||||
RUSTDOCFLAGS: -D warnings
|
||||
- run: cargo test -p craft-pdf --all-features --locked
|
||||
- run: cargo test --manifest-path crates/pdf/read-only-contract/Cargo.toml --locked
|
||||
backends:
|
||||
|
||||
@@ -34,6 +34,11 @@ jobs:
|
||||
components: rustfmt, clippy
|
||||
- run: cargo fmt --check
|
||||
- run: cargo clippy -p craft-print --all-targets -- -D warnings
|
||||
- name: Docs (links and missing docs)
|
||||
if: runner.os == 'Linux'
|
||||
run: cargo doc -p craft-print --no-deps --locked
|
||||
env:
|
||||
RUSTDOCFLAGS: -D warnings
|
||||
- name: Prepare the Windows test driver
|
||||
if: runner.os == 'Windows'
|
||||
shell: powershell
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
name: Suite themes
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [main]
|
||||
paths: ['crates/theme/**', 'crates/theme-store/**', 'crates/atomic/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/theme.yml']
|
||||
pull_request:
|
||||
paths: ['crates/theme/**', 'crates/theme-store/**', 'crates/atomic/**', 'Cargo.toml', 'Cargo.lock', '.github/workflows/theme.yml']
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
theme:
|
||||
timeout-minutes: 15
|
||||
name: Theme lint, tests, WASM
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
# The token isn't needed after checkout; cargo runs build scripts and proc macros from
|
||||
# dependencies, so don't leave it in .git/config for that third-party code to read.
|
||||
persist-credentials: false
|
||||
- uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
|
||||
with:
|
||||
components: rustfmt, clippy
|
||||
targets: wasm32-unknown-unknown
|
||||
- run: cargo fmt -p craft-theme --check
|
||||
- run: cargo clippy -p craft-theme --all-targets --all-features --locked -- -D warnings
|
||||
- run: cargo clippy -p craft-theme --all-targets --locked -- -D warnings
|
||||
- run: cargo test -p craft-theme --all-features --locked
|
||||
- run: cargo check -p craft-theme --all-features --locked --target wasm32-unknown-unknown
|
||||
- run: cargo check -p craft-ui --lib --locked
|
||||
- run: cargo fmt -p craft-theme-store --check
|
||||
- run: cargo clippy -p craft-theme-store --all-targets --all-features --locked -- -D warnings
|
||||
- name: Docs (links and missing docs)
|
||||
run: cargo doc -p craft-theme -p craft-theme-store --all-features --no-deps --locked
|
||||
env:
|
||||
RUSTDOCFLAGS: -D warnings
|
||||
- run: cargo test -p craft-theme-store --all-features --locked
|
||||
- run: cargo check -p craft-theme-store --all-features --locked --target wasm32-unknown-unknown
|
||||
@@ -3,9 +3,9 @@ name: Shared UI
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths: ["crates/ui/**", "crates/i18n/**", "Cargo.toml", "Cargo.lock", ".github/workflows/ui.yml"]
|
||||
paths: ["crates/ui/**", "crates/ui-contract/**", "crates/ui-widgets/**", "crates/ui-panels/**", "crates/ui-canvas/**", "crates/ui-patterns/**", "crates/ui-shell/**", "crates/ui-macros/**", "crates/i18n/**", "Cargo.toml", "Cargo.lock", ".github/workflows/ui.yml"]
|
||||
pull_request:
|
||||
paths: ["crates/ui/**", "crates/i18n/**", "Cargo.toml", "Cargo.lock", ".github/workflows/ui.yml"]
|
||||
paths: ["crates/ui/**", "crates/ui-contract/**", "crates/ui-widgets/**", "crates/ui-panels/**", "crates/ui-canvas/**", "crates/ui-patterns/**", "crates/ui-shell/**", "crates/ui-macros/**", "crates/i18n/**", "Cargo.toml", "Cargo.lock", ".github/workflows/ui.yml"]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
@@ -49,10 +49,15 @@ jobs:
|
||||
key: craft-ui
|
||||
save-if: ${{ github.ref == 'refs/heads/main' }}
|
||||
- run: cargo fmt --check
|
||||
- run: cargo clippy -p craft-ui --all-targets --locked -- -D warnings
|
||||
- run: cargo clippy -p craft-ui --all-targets --all-features --locked -- -D warnings
|
||||
- run: cargo test -p craft-ui --locked
|
||||
- run: cargo test -p craft-ui --all-features --locked
|
||||
- run: cargo clippy -p craft-ui -p craft-ui-contract -p craft-ui-widgets -p craft-ui-panels -p craft-ui-canvas -p craft-ui-patterns -p craft-ui-shell --all-targets --locked -- -D warnings
|
||||
- run: cargo clippy -p craft-ui -p craft-ui-contract -p craft-ui-widgets -p craft-ui-panels -p craft-ui-canvas -p craft-ui-patterns -p craft-ui-shell --all-targets --all-features --locked -- -D warnings
|
||||
- name: Docs (links and missing docs)
|
||||
if: runner.os == 'Linux'
|
||||
run: cargo doc -p craft-ui -p craft-ui-contract -p craft-ui-widgets -p craft-ui-panels -p craft-ui-canvas -p craft-ui-patterns -p craft-ui-shell --all-features --no-deps --locked
|
||||
env:
|
||||
RUSTDOCFLAGS: -D warnings
|
||||
- run: cargo test -p craft-ui -p craft-ui-contract -p craft-ui-widgets -p craft-ui-panels -p craft-ui-canvas -p craft-ui-patterns -p craft-ui-shell --locked
|
||||
- run: cargo test -p craft-ui -p craft-ui-contract -p craft-ui-widgets -p craft-ui-panels -p craft-ui-canvas -p craft-ui-patterns -p craft-ui-shell --all-features --locked
|
||||
wasm:
|
||||
timeout-minutes: 15
|
||||
name: UI WASM
|
||||
|
||||
@@ -41,8 +41,13 @@ jobs:
|
||||
toolchain: stable
|
||||
components: rustfmt, clippy
|
||||
- run: cargo fmt --check
|
||||
# Default (no egui) and the egui feature both build and lint cleanly.
|
||||
# Default (no egui) and the ui feature both build and lint cleanly.
|
||||
- run: cargo clippy -p craft-update --all-targets --locked -- -D warnings
|
||||
- run: cargo clippy -p craft-update --all-targets --locked --features egui -- -D warnings
|
||||
- run: cargo clippy -p craft-update --all-targets --locked --features ui -- -D warnings
|
||||
- name: Docs (links and missing docs)
|
||||
if: runner.os == 'Linux'
|
||||
run: cargo doc -p craft-update --no-deps --locked
|
||||
env:
|
||||
RUSTDOCFLAGS: -D warnings
|
||||
- run: cargo test -p craft-update --locked -- --nocapture
|
||||
- run: cargo test -p craft-update --locked --features egui -- --nocapture
|
||||
- run: cargo test -p craft-update --locked --features ui -- --nocapture
|
||||
|
||||
@@ -41,5 +41,10 @@ jobs:
|
||||
targets: wasm32-unknown-unknown
|
||||
- run: cargo fmt --check
|
||||
- run: cargo clippy -p craft-vectorcraft-format --all-targets --locked -- -D warnings
|
||||
- name: Docs (links and missing docs)
|
||||
if: runner.os == 'Linux'
|
||||
run: cargo doc -p craft-vectorcraft-format --no-deps --locked
|
||||
env:
|
||||
RUSTDOCFLAGS: -D warnings
|
||||
- run: cargo test -p craft-vectorcraft-format --locked -- --nocapture
|
||||
- run: cargo check -p craft-vectorcraft-format --locked --target wasm32-unknown-unknown
|
||||
|
||||
@@ -53,5 +53,9 @@ jobs:
|
||||
- run: cargo fmt --check
|
||||
- run: cargo clippy -p craft-web-api --all-targets --locked -- -D warnings
|
||||
- run: cargo clippy -p craft-web-api --all-targets --locked --target wasm32-unknown-unknown -- -D warnings
|
||||
- name: Docs (links and missing docs)
|
||||
run: cargo doc -p craft-web-api --no-deps --locked
|
||||
env:
|
||||
RUSTDOCFLAGS: -D warnings
|
||||
- run: cargo test -p craft-web-api --locked
|
||||
- run: cargo test -p craft-web-api --locked --target wasm32-unknown-unknown
|
||||
|
||||
@@ -45,6 +45,10 @@ jobs:
|
||||
- run: cargo fmt -p craft-web-host --check
|
||||
- run: cargo clippy -p craft-web-host --all-targets --locked -- -D warnings
|
||||
- run: cargo clippy -p craft-web-host --all-targets --locked --target wasm32-unknown-unknown -- -D warnings
|
||||
- name: Docs (links and missing docs)
|
||||
run: cargo doc -p craft-web-host --no-deps --locked
|
||||
env:
|
||||
RUSTDOCFLAGS: -D warnings
|
||||
- run: cargo test -p craft-web-host --locked
|
||||
- name: Read the wasm-bindgen version from Cargo.lock
|
||||
id: wasm-bindgen
|
||||
|
||||
@@ -41,8 +41,13 @@ jobs:
|
||||
toolchain: stable
|
||||
components: rustfmt, clippy
|
||||
- run: cargo fmt --check
|
||||
# Default (no egui) and the egui feature both build and lint cleanly.
|
||||
# Default (no egui) and the ui feature both build and lint cleanly.
|
||||
- run: cargo clippy -p craft-window --all-targets --locked -- -D warnings
|
||||
- run: cargo clippy -p craft-window --all-targets --locked --features egui -- -D warnings
|
||||
- run: cargo clippy -p craft-window --all-targets --locked --features ui -- -D warnings
|
||||
- name: Docs (links and missing docs)
|
||||
if: runner.os == 'Linux'
|
||||
run: cargo doc -p craft-window --no-deps --locked
|
||||
env:
|
||||
RUSTDOCFLAGS: -D warnings
|
||||
- run: cargo test -p craft-window --locked -- --nocapture
|
||||
- run: cargo test -p craft-window --locked --features egui -- --nocapture
|
||||
- run: cargo test -p craft-window --locked --features ui -- --nocapture
|
||||
|
||||
Reference in New Issue
Block a user