Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI improvements #26

Merged
merged 6 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 62 additions & 21 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,53 @@ on:
types: [opened, synchronize, reopened, ready_for_review]
branches: [ master ]

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always

jobs:
ci:
formatting:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt

- name: Check formatting
run: cargo fmt --all -- --check

build-nostd:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false

needs:
- formatting

steps:
- uses: actions/checkout@v3

- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
targets: thumbv7em-none-eabihf

- name: Build no_std
run: cargo build --target thumbv7em-none-eabihf -Z avoid-dev-deps

tests:
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false

needs:
- formatting

strategy:
matrix:
rust:
Expand All @@ -24,31 +63,33 @@ jobs:
- 1.61.0 # MSRV

steps:
- name: install_dependencies
run: |
sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu `lsb_release -sc` main universe restricted multiverse"
sudo apt-get update -y -qq
sudo apt-get install libsdl2-dev

- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@master
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: rustfmt, clippy

- name: Check formatting
run: cargo fmt --all -- --check
- name: Check
run: cargo c

- name: Build
run: cargo build --verbose

- name: Build examples
run: cargo build --examples --verbose
- name: Check examples
run: cargo c --examples

- name: Run tests
run: cargo test --lib

docs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable

- name: Check doc links
run: |
cargo test --verbose --release
cargo test --verbose --release --all-features
cargo doc --color=never &> ./out
cat ./out
! grep "^warning:" ./out
6 changes: 2 additions & 4 deletions src/layout/linear/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,8 @@
//!
//! [`View`]: crate::View
//! [`ViewGroup`]: crate::view_group::ViewGroup
//! [`LinearLayout`]: crate::layout::linear::LinearLayout
//! [`LinearLayout::arrange`]: crate::layout::linear::LinearLayout::arrange
//! [secondary alignment]: crate::layout::linear::LinearLayout::with_alignment
//! [element spacing]: crate::layout::linear::LinearLayout::with_spacing
//! [secondary alignment]: LinearLayout::with_alignment
//! [element spacing]: LinearLayout::with_spacing
//! [`Tight`]: crate::layout::linear::spacing::Tight
//! [`FixedMargin(0)`]: crate::layout::linear::spacing::FixedMargin
//! [`FixedMargin(margin)`]: crate::layout::linear::spacing::FixedMargin
Expand Down
1 change: 1 addition & 0 deletions src/layout/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
//! For a more (but not really) complex example, you may check the source of [`LinearLayout`].
//!
//! [`View`]: crate::View
//! [`ViewGroup`]: crate::view_group::ViewGroup
//! [`LinearLayout`]: crate::layout::linear::LinearLayout

pub mod linear;