Skip to content

add basic ci

add basic ci #6

Workflow file for this run

name: Continuous Integration
on:
push:
branches: [ main ]
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
format:
runs-on: ubuntu-24.04
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-24.04
strategy:
fail-fast: false
matrix:
rust: ['1.65.0', 'stable', 'beta']
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 libdisplay-info-dev
- name: Clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all --all-features --all-targets -- -D warnings
check-minimal:
env:
RUSTFLAGS: "-D warnings"
runs-on: ubuntu-24.04
steps:
- name: Checkout sources
uses: actions/checkout@v2
with:
submodules: recursive
- 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 libdisplay-info-dev
- name: Downgrade to minimal dependencies
uses: actions-rs/cargo@v1
with:
command: update
args: -Z minimal-versions
- name: Check
uses: actions-rs/cargo@v1
with:
command: check
args: --all
test:
needs:
- format
- clippy-check
strategy:
fail-fast: false
matrix:
features:
- ''
env:
RUSTFLAGS: "-D warnings"
runs-on: ubuntu-24.04
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 libdisplay-info-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: Test features
uses: actions-rs/cargo@v1
env:
RUST_BACKTRACE: full
with:
command: test
args: --no-default-features --features "${{ matrix.features }}"