Skip to content

Merge pull request #399 from kas-gui/work1 #785

Merge pull request #399 from kas-gui/work1

Merge pull request #399 from kas-gui/work1 #785

Workflow file for this run

name: Tests
on:
push:
branches: [ master, '[0-9]+.[0-9]+' ]
pull_request:
branches: [ master, '[0-9]+.[0-9]+' ]
permissions:
contents: read
jobs:
nightly:
name: Nightly, format and Doc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy
- name: Install dependencies
run: sudo apt-get install -y libxkbcommon-dev libxcb-shape0-dev libxcb-xfixes0-dev
- name: Rustfmt check
run: |
cargo fmt --all -- --check
- name: Build docs
run: |
cargo doc --all --no-deps
cargo doc --all-features --all --no-deps
- name: Test kas-macros
run: |
cargo test --manifest-path crates/kas-macros/Cargo.toml
cargo test --manifest-path crates/kas-macros/Cargo.toml --all-features
- name: Test kas-core
run: |
cargo test --manifest-path crates/kas-core/Cargo.toml
cargo test --manifest-path crates/kas-core/Cargo.toml --all-features
- name: Test kas-widgets
run: |
cargo test --manifest-path crates/kas-widgets/Cargo.toml
cargo test --manifest-path crates/kas-widgets/Cargo.toml --all-features
- name: Test kas-resvg
run: |
cargo test --manifest-path crates/kas-resvg/Cargo.toml
cargo test --manifest-path crates/kas-resvg/Cargo.toml --all-features
- name: Test kas-wgpu
run: |
cargo test --manifest-path crates/kas-wgpu/Cargo.toml
cargo test --manifest-path crates/kas-wgpu/Cargo.toml --no-default-features --features raster,kas/wayland
cargo test --manifest-path crates/kas-wgpu/Cargo.toml --all-features --features kas/x11
- name: Test kas-dylib
run: |
cargo test --manifest-path crates/kas-dylib/Cargo.toml
cargo test --manifest-path crates/kas-dylib/Cargo.toml --all-features --features kas-core/x11
- name: Test kas
run: |
cargo test
cargo test --all-features
- name: Test examples/mandlebrot
run: cargo test --manifest-path examples/mandlebrot/Cargo.toml
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
toolchain: [stable]
include:
- os: ubuntu-latest
toolchain: "1.65.0"
- os: ubuntu-latest
toolchain: beta
steps:
- uses: actions/checkout@v3
- name: Install toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
components: clippy
- name: Install dependencies
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install -y libxkbcommon-dev libxcb-shape0-dev libxcb-xfixes0-dev
- name: Test kas-macros
run: cargo test --manifest-path crates/kas-macros/Cargo.toml --all-features
- name: Test kas-core
run: cargo test --manifest-path crates/kas-core/Cargo.toml --features stable
- name: Test kas-widgets
run: cargo test --manifest-path crates/kas-widgets/Cargo.toml
- name: Test kas-resvg
run: cargo test --manifest-path crates/kas-resvg/Cargo.toml --all-features
- name: Test kas-wgpu
run: cargo test --manifest-path crates/kas-wgpu/Cargo.toml --features kas/x11
- name: Test kas-dylib
run: cargo test --manifest-path crates/kas-dylib/Cargo.toml --features kas-core/x11
- name: Test kas
run: cargo test --features stable
- name: Test examples/mandlebrot
run: cargo test --manifest-path examples/mandlebrot/Cargo.toml
- name: Clippy (stable)
if: matrix.toolchain != 'beta' && matrix.toolchain != 'stable'
run: |
cargo clippy --all -- -D warnings \
-A clippy::collapsible-if \
-A clippy::collapsible_else_if \
-A clippy::module-inception \
-A clippy::too-many-arguments \
-A clippy::comparison_chain \
-A clippy::or-fun-call \
-A clippy::redundant_pattern_matching \
-A clippy::type_complexity \
-A clippy::unit_arg