Skip to content

Commit

Permalink
Merge pull request #26 from bugadani/ci
Browse files Browse the repository at this point in the history
CI improvements
  • Loading branch information
bugadani authored Aug 23, 2023
2 parents 263afc0 + 6964885 commit a18a2c0
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 25 deletions.
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;

0 comments on commit a18a2c0

Please sign in to comment.