| 1 |
name: Test |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: [ master ] |
| 6 |
pull_request: |
| 7 |
branches: [ master ] |
| 8 |
|
| 9 |
jobs: |
| 10 |
rustfmt: |
| 11 |
runs-on: ubuntu-22.04 |
| 12 |
steps: |
| 13 |
- uses: actions-rust-lang/setup-rust-toolchain@v1 |
| 14 |
with: |
| 15 |
toolchain: stable |
| 16 |
components: rustfmt |
| 17 |
- uses: actions/checkout@v4 |
| 18 |
- name: Check formatting |
| 19 |
run: cargo fmt --all -- --check |
| 20 |
|
| 21 |
clippy: |
| 22 |
needs: rustfmt |
| 23 |
runs-on: ${{ matrix.os }} |
| 24 |
strategy: |
| 25 |
matrix: |
| 26 |
os: [macos-latest, windows-latest, ubuntu-latest] |
| 27 |
# Latest stable and MSRV. We only run checks with all features enabled |
| 28 |
# for the MSRV build to keep CI fast, since other configurations should also work. |
| 29 |
rust_version: [stable, "1.71.0"] |
| 30 |
steps: |
| 31 |
- uses: actions-rust-lang/setup-rust-toolchain@v1 |
| 32 |
with: |
| 33 |
toolchain: ${{ matrix.rust_version }} |
| 34 |
components: clippy |
| 35 |
- uses: actions/checkout@v4 |
| 36 |
|
| 37 |
- name: Run `cargo clippy` with no features |
| 38 |
if: ${{ matrix.rust_version == 'stable' }} |
| 39 |
run: cargo clippy --verbose --no-default-features -- -D warnings -D clippy::dbg_macro |
| 40 |
|
| 41 |
- name: Run `cargo clippy` with `image-data` feature |
| 42 |
if: ${{ matrix.rust_version == 'stable' }} |
| 43 |
run: cargo clippy --verbose --no-default-features --features image-data -- -D warnings -D clippy::dbg_macro |
| 44 |
|
| 45 |
- name: Run `cargo clippy` with `wayland-data-control` feature |
| 46 |
if: ${{ matrix.rust_version == 'stable' }} |
| 47 |
run: cargo clippy --verbose --no-default-features --features wayland-data-control -- -D warnings -D clippy::dbg_macro |
| 48 |
|
| 49 |
- name: Run `cargo clippy` with all features |
| 50 |
run: cargo clippy --verbose --all-features -- -D warnings -D clippy::dbg_macro |
| 51 |
|
| 52 |
- name: Run `cargo clippy` with dependency version checks |
| 53 |
if: ${{ matrix.rust_version == 'stable' }} |
| 54 |
run: | |
| 55 |
cargo update -p windows-sys |
| 56 |
cargo clippy --verbose --all-features -- -D warnings -D clippy::dbg_macro |
| 57 |
|
| 58 |
test: |
| 59 |
needs: clippy |
| 60 |
runs-on: ${{ matrix.os }} |
| 61 |
strategy: |
| 62 |
matrix: |
| 63 |
# No Linux test for now as it just fails due to not having a desktop environment. |
| 64 |
os: [macos-latest, windows-latest] |
| 65 |
steps: |
| 66 |
- uses: actions-rust-lang/setup-rust-toolchain@v1 |
| 67 |
with: |
| 68 |
toolchain: stable |
| 69 |
- name: Checkout |
| 70 |
uses: actions/checkout@v4 |
| 71 |
- name: Run tests with no features |
| 72 |
run: cargo test --no-default-features |
| 73 |
- name: Run tests with `image-data` feature |
| 74 |
run: cargo test --no-default-features --features image-data |
| 75 |
- name: Run tests with `wayland-data-control` feature |
| 76 |
run: cargo test --no-default-features --features wayland-data-control |
| 77 |
- name: Run tests with all features |
| 78 |
run: cargo test --all-features |
| 79 |
|
| 80 |
miri: |
| 81 |
needs: clippy |
| 82 |
env: |
| 83 |
MIRIFLAGS: -Zmiri-symbolic-alignment-check |
| 84 |
runs-on: ${{ matrix.os }} |
| 85 |
strategy: |
| 86 |
matrix: |
| 87 |
# Currently, only Windows has soundness tests. |
| 88 |
os: [windows-latest] |
| 89 |
steps: |
| 90 |
- uses: actions-rust-lang/setup-rust-toolchain@v1 |
| 91 |
with: |
| 92 |
toolchain: nightly-2023-10-08 |
| 93 |
components: miri |
| 94 |
|
| 95 |
- name: Checkout |
| 96 |
uses: actions/checkout@v4 |
| 97 |
|
| 98 |
- name: Check soundness |
| 99 |
run: cargo miri test windows --features image-data |
| 100 |
|
| 101 |
semver: |
| 102 |
runs-on: ubuntu-latest |
| 103 |
steps: |
| 104 |
- uses: actions/checkout@v4 |
| 105 |
- name: Check semver |
| 106 |
uses: obi1kenobi/cargo-semver-checks-action@v2 |