Rework CI flow

This commit is contained in:
Victor Berger 2021-07-30 18:08:42 +02:00 committed by Victor Berger
parent 217b63f106
commit 963f742e74
3 changed files with 199 additions and 62 deletions

View File

@ -7,12 +7,114 @@ on:
pull_request: pull_request:
jobs: jobs:
smithay-ci: format:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
components: rustfmt
default: true
- name: Cargo cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-rust_stable-${{ hashFiles('**/Cargo.toml') }}
- name: Format
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy-check:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
components: clippy
default: true
- name: Cargo cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-rust_stable-${{ hashFiles('**/Cargo.toml') }}
- name: Build cache
uses: actions/cache@v2
with:
path: target
key: ${{ runner.os }}-build-rust_stable-check-${{ hashFiles('**/Cargo.toml') }}
- name: System dependencies
run: sudo apt-get update; sudo apt-get install libudev-dev libgbm-dev libxkbcommon-dev libegl1-mesa-dev libwayland-dev libinput-dev libsystemd-dev libdbus-1-dev
- name: Clippy Smithay
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --features "test_all_features" -- -D warnings
- name: Clippy Anvil
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --manifest-path "./anvil/Cargo.toml" --features "test_all_features" -- -D warnings
check-minimal:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
profile: minimal
default: true
- name: Cargo cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-rust_nightly-${{ hashFiles('**/Cargo.toml') }}
- name: System dependencies
run: sudo apt-get update; sudo apt-get install libudev-dev libgbm-dev libxkbcommon-dev libegl1-mesa-dev libwayland-dev libinput-dev libsystemd-dev libdbus-1-dev
- name: Downgrade to minimal dependencies
uses: actions-rs/cargo@v1
with:
command: update
args: -Z minimal-versions
- name: Update exceptions
uses: actions-rs/cargo@v1
with:
command: update
args: -p libdbus-sys -p calloop:0.6.1
- name: Check
uses: actions-rs/cargo@v1
with:
command: check
args: --features "test_all_features"
smithay-tests:
needs:
- format
- clippy-check
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
rust:
- stable
features: features:
- '' - ''
- backend_winit - backend_winit
@ -28,7 +130,7 @@ jobs:
- wayland_frontend - wayland_frontend
- xwayland - xwayland
- default - default
- all - test_all_features
env: env:
RUSTFLAGS: "-D warnings" RUSTFLAGS: "-D warnings"
@ -40,20 +142,30 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Cargo cache - name: Cargo cache
uses: actions/cache@v1 uses: actions/cache@v2
with: with:
path: ~/.cargo path: |
key: cargo-${{ matrix.rust }} ~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-rust_stable-${{ hashFiles('**/Cargo.toml') }}
- name: Rust toolchain - name: Rust toolchain
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
toolchain: ${{ matrix.rust }} toolchain: stable
override: true override: true
default: true
profile: minimal
- name: System dependencies - name: System dependencies
run: sudo apt-get update; sudo apt-get install libudev-dev libgbm-dev libxkbcommon-dev libegl1-mesa-dev libwayland-dev libinput-dev libsystemd-dev libdbus-1-dev run: sudo apt-get update; sudo apt-get install libudev-dev libgbm-dev libxkbcommon-dev libegl1-mesa-dev libwayland-dev libinput-dev libsystemd-dev libdbus-1-dev
- name: Build cache
uses: actions/cache@v2
with:
path: target
key: ${{ runner.os }}-build-rust_stable-smithay-feature_${{ matrix.features }}-${{ hashFiles('**/Cargo.toml') }}
- name: Build and install Libseat - name: Build and install Libseat
if: matrix.features == 'backend_session_libseat' if: matrix.features == 'backend_session_libseat'
run: | run: |
@ -66,25 +178,21 @@ jobs:
sudo meson install -C build sudo meson install -C build
- name: Test features - name: Test features
if: matrix.features != 'all'
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
env:
RUST_BACKTRACE: full
with: with:
command: test command: test
args: --no-default-features --features "${{ matrix.features }}" args: --no-default-features --features "${{ matrix.features }}"
- name: Test all
if: matrix.features == 'all'
uses: actions-rs/cargo@v1
with:
command: test
args: --features "test_all_features"
anvil-ci: anvil-tests:
needs:
- format
- clippy-check
- smithay-tests
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
rust:
- stable
features: features:
- '' - ''
- egl - egl
@ -92,7 +200,7 @@ jobs:
- udev - udev
- logind - logind
- default - default
- all - test_all_features
env: env:
RUSTFLAGS: "-D warnings" RUSTFLAGS: "-D warnings"
@ -104,54 +212,83 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Cargo cache - name: Cargo cache
uses: actions/cache@v1 uses: actions/cache@v2
with: with:
path: ~/.cargo path: |
key: cargo-${{ matrix.rust }} ~/.cargo/registry
~/.cargo/git
- name: Rust toolchain key: ${{ runner.os }}-cargo-rust_stable-${{ hashFiles('**/Cargo.toml') }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- name: System dependencies
run: sudo apt-get update; sudo apt-get install libudev-dev libgbm-dev libxkbcommon-dev libegl1-mesa-dev libwayland-dev libinput-dev libsystemd-dev libdbus-1-dev
- name: Test features
if: matrix.features != 'all'
working-directory: ./anvil
run: cargo test --no-default-features --features "${{ matrix.features }}"
- name: Test all
if: matrix.features == 'all'
working-directory: ./anvil
run: cargo test --features "test_all_features"
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Rust toolchain - name: Rust toolchain
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
toolchain: stable toolchain: stable
override: true override: true
components: rustfmt, clippy default: true
profile: minimal
- name: System dependencies - name: System dependencies
run: sudo apt-get update; sudo apt-get install libudev-dev libgbm-dev libxkbcommon-dev libegl1-mesa-dev libwayland-dev libinput-dev libsystemd-dev libdbus-1-dev run: sudo apt-get update; sudo apt-get install libudev-dev libgbm-dev libxkbcommon-dev libegl1-mesa-dev libwayland-dev libinput-dev libsystemd-dev libdbus-1-dev
- name: Cargo fmt - name: Build cache
run: cargo fmt --all -- --check uses: actions/cache@v2
with:
- name: Clippy Smithay path: target
run: cargo clippy --features "test_all_features" -- -D warnings key: ${{ runner.os }}-build-rust_stable-anvil-feature_${{ matrix.features }}-${{ hashFiles('**/Cargo.toml') }}
- name: Clippy Anvil - name: Test features
working-directory: ./anvil uses: actions-rs/cargo@v1
run: cargo clippy --features "test_all_features" -- -D warnings env:
RUST_BACKTRACE: full
with:
command: test
args: --manifest-path "./anvil/Cargo.toml" --no-default-features --features "${{ matrix.features }}"
anvil-wlcs:
needs:
- format
- clippy-check
- smithay-tests
- anvil-tests
env:
RUSTFLAGS: "-D warnings"
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Cargo cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-rust_stable-${{ hashFiles('**/Cargo.toml') }}
- name: Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
default: true
profile: minimal
- name: System dependencies
run: sudo apt-get update; sudo apt-get install libudev-dev libgbm-dev libxkbcommon-dev libegl1-mesa-dev libwayland-dev libinput-dev libsystemd-dev libdbus-1-dev
- name: Build cache
uses: actions/cache@v2
with:
path: target
key: ${{ runner.os }}-build-rust_stable-wlcs-${{ hashFiles('**/Cargo.toml') }}
- name: Build WLCS plugin
uses: actions-rs/cargo@v1
env:
RUST_BACKTRACE: full
with:
command: build
args: --manifest-path "./wlcs_anvil/Cargo.toml"

View File

@ -37,7 +37,7 @@ nix = "0.22"
slog = "2" slog = "2"
slog-stdlog = { version = "4", optional = true } slog-stdlog = { version = "4", optional = true }
tempfile = { version = "3.0", optional = true } tempfile = { version = "3.0", optional = true }
thiserror = "1" thiserror = "1.0.2"
udev = { version = "0.6", optional = true } udev = { version = "0.6", optional = true }
wayland-commons = { version = "0.29.0", optional = true } wayland-commons = { version = "0.29.0", optional = true }
wayland-egl = { version = "0.29.0", optional = true } wayland-egl = { version = "0.29.0", optional = true }
@ -46,7 +46,7 @@ wayland-server = { version = "0.29.0", optional = true }
wayland-sys = { version = "0.29.0", optional = true } wayland-sys = { version = "0.29.0", optional = true }
winit = { version = "0.25.0", optional = true } winit = { version = "0.25.0", optional = true }
xkbcommon = "0.4.0" xkbcommon = "0.4.0"
scan_fmt = { version = "0.2", default-features = false } scan_fmt = { version = "0.2.3", default-features = false }
[dev-dependencies] [dev-dependencies]
slog-term = "2.3" slog-term = "2.3"

View File

@ -98,7 +98,7 @@ impl Frame for DummyFrame {
&mut self, &mut self,
_texture: &Self::TextureId, _texture: &Self::TextureId,
_matrix: cgmath::Matrix3<f32>, _matrix: cgmath::Matrix3<f32>,
tex_coords: [Vector2<f32>; 4], _tex_coords: [Vector2<f32>; 4],
_alpha: f32, _alpha: f32,
) -> Result<(), Self::Error> { ) -> Result<(), Self::Error> {
Ok(()) Ok(())