name: Workspace on: push: branches: [main] tags: ["v*"] pull_request: workflow_dispatch: permissions: contents: read jobs: native: name: Workspace (${{ matrix.os }}) timeout-minutes: 30 strategy: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - name: Install software Vulkan renderer if: runner.os == 'Linux' run: | sudo apt-get update sudo apt-get install -y mesa-vulkan-drivers libvulkan1 echo 'WGPU_BACKEND=vulkan' >> "$GITHUB_ENV" - uses: dtolnay/rust-toolchain@stable with: components: rustfmt, clippy - uses: Swatinem/rust-cache@v2 with: key: workspace - name: Prepare the Windows test driver if: runner.os == 'Windows' shell: powershell run: | $ErrorActionPreference = 'Stop' Start-Service Spooler Add-PrinterDriver -Name 'Generic / Text Only' - run: cargo fmt --check - run: cargo clippy --workspace --all-targets --locked -- -D warnings - run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings - run: cargo test --workspace --locked env: CRAFT_PRINT_REQUIRE_QUEUE: ${{ runner.os == 'Windows' && '1' || '0' }} - run: cargo test --workspace --all-features --locked env: CRAFT_PRINT_REQUIRE_QUEUE: ${{ runner.os == 'Windows' && '1' || '0' }} msrv: name: Rust 1.95 (Linux libraries) runs-on: ubuntu-latest timeout-minutes: 15 steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@1.95.0 - uses: Swatinem/rust-cache@v2 with: key: workspace-msrv - run: cargo check --workspace --lib --all-features --locked wasm: name: UI and settings WASM runs-on: ubuntu-latest timeout-minutes: 15 steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: targets: wasm32-unknown-unknown - uses: Swatinem/rust-cache@v2 with: key: workspace-wasm - run: cargo check -p craft-ui -p craft-settings --all-features --locked --target wasm32-unknown-unknown