mirror of
https://github.com/storytold/craft-libs.git
synced 2026-10-31 15:49:54 +00:00
68 lines
2.1 KiB
YAML
68 lines
2.1 KiB
YAML
name: Keymap
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths: ["crates/keymap/**", "Cargo.toml", "Cargo.lock", ".github/workflows/keymap.yml"]
|
|
pull_request:
|
|
paths: ["crates/keymap/**", "Cargo.toml", "Cargo.lock", ".github/workflows/keymap.yml"]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: keymap-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
linux:
|
|
timeout-minutes: 15
|
|
name: Keymap (Linux)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: rustfmt, clippy
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
key: craft-keymap-linux
|
|
- run: cargo fmt -p craft-keymap --check
|
|
- run: cargo clippy -p craft-keymap --all-targets --no-default-features --locked -- -D warnings
|
|
- run: cargo clippy -p craft-keymap --all-targets --features ui --locked -- -D warnings
|
|
# Doctests run once, in the `ui` step. `snapshot` (dialog screenshots) needs a GPU and is
|
|
# left out; `ui` covers `egui`.
|
|
- name: Test core
|
|
run: cargo test -p craft-keymap --no-default-features --lib --tests --locked
|
|
- name: Test egui dispatch and the shortcuts dialog
|
|
run: cargo test -p craft-keymap --features ui --locked
|
|
native:
|
|
timeout-minutes: 15
|
|
name: Keymap (${{ matrix.os }})
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [macos-latest, windows-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
key: craft-keymap-${{ matrix.os }}
|
|
- run: cargo test -p craft-keymap --features ui --locked
|
|
wasm:
|
|
timeout-minutes: 10
|
|
name: Keymap WASM
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: wasm32-unknown-unknown
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
key: craft-keymap-wasm
|
|
- run: cargo check -p craft-keymap --features ui --locked --target wasm32-unknown-unknown
|