name: Build
on:
pull_request:
push:
branches:
- master
- staging
- trying
- bors/staging
- bors/trying
env:
CARGO_TERM_COLOR: always
jobs:
style:
name: style
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Fail on warnings
run: sed -i 's,//deny_warnings_placeholder_for_ci,#![deny(warnings)],' src/lib.rs
- name: cargo fmt --check
run: cargo fmt --all -- --check
check:
name: check
runs-on: ubuntu-22.04
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
toolchain:
- stable
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust ${{ matrix.toolchain }}
run: |
rustup set profile minimal
rustup override set ${{ matrix.toolchain }}
- name: Configure Rust target (${{ matrix.target }})
run: rustup target add ${{ matrix.target }}
- name: Fail on warnings
run: sed -i 's,//deny_warnings_placeholder_for_ci,#![deny(warnings)],' src/lib.rs
- name: Cache Dependencies
uses: Swatinem/rust-cache@v2
- name: cargo check
run: cargo check --target=${{ matrix.target }}
clippy:
name: Cargo clippy
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Fail on warnings
run: sed -i 's,//deny_warnings_placeholder_for_ci,#![deny(warnings)],' src/lib.rs
- name: Add Rust component clippy
run: rustup component add clippy
- name: Cache Dependencies
uses: Swatinem/rust-cache@v2
- name: cargo clippy
run: cargo clippy
testexamples:
name: testexamples
runs-on: ubuntu-22.04
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
toolchain:
- stable
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust ${{ matrix.toolchain }}
run: |
rustup set profile minimal
rustup override set ${{ matrix.toolchain }}
- name: Configure Rust target (${{ matrix.target }})
run: rustup target add ${{ matrix.target }}
- name: Cache Dependencies
uses: Swatinem/rust-cache@v2
- name: Fail on warnings
run: sed -i 's,//deny_warnings_placeholder_for_ci,#![deny(warnings)],' src/lib.rs
- name: cargo test --test ui
run: cargo test --examples
testui:
name: testui
runs-on: ubuntu-22.04
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
toolchain:
- stable
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust ${{ matrix.toolchain }}
run: |
rustup set profile minimal
rustup override set ${{ matrix.toolchain }}
- name: Configure Rust target (${{ matrix.target }})
run: rustup target add ${{ matrix.target }}
- name: Cache Dependencies
uses: Swatinem/rust-cache@v2
- name: Fail on warnings
run: sed -i 's,//deny_warnings_placeholder_for_ci,#![deny(warnings)],' src/lib.rs
- name: cargo test --test ui
run: cargo test --test ui
test:
name: test
runs-on: ubuntu-22.04
strategy:
matrix:
target:
- thumbv7m-none-eabi
toolchain:
- stable
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Rust ${{ matrix.toolchain }}
run: |
rustup set profile minimal
rustup override set ${{ matrix.toolchain }}
- name: Cache Dependencies
uses: Swatinem/rust-cache@v2
- name: Fail on warnings
run: sed -i 's,//deny_warnings_placeholder_for_ci,#![deny(warnings)],' src/lib.rs
- name: cargo test --test ui
run: cargo test --lib
ci-success:
name: ci
if: github.event_name == 'push' && success()
needs:
- style
- check
- clippy
- testexamples
- test
- testui
runs-on: ubuntu-22.04
steps:
- name: Mark the job as a success
run: exit 0