From 4becaf6f7eb6ddfa50b8af00629b5bbbcecfffd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Wed, 23 Aug 2023 19:43:45 +0200 Subject: [PATCH 1/6] Stop previous workflow run --- .github/workflows/rust.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index ca0ddee..ac3f257 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -7,6 +7,10 @@ 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 From b64876b528e9d8f23d653b957bca81737238f72d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Wed, 23 Aug 2023 19:44:23 +0200 Subject: [PATCH 2/6] Split fmt/docs, don't install SDL --- .github/workflows/rust.yml | 79 ++++++++++++++++++++++++++++---------- 1 file changed, 58 insertions(+), 21 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index ac3f257..23e4316 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -15,10 +15,45 @@ 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 --verbose --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: @@ -28,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 --verbose - - name: Build - run: cargo build --verbose - - - name: Build examples - run: cargo build --examples --verbose + - name: Check examples + run: cargo c --examples --verbose - name: Run tests + run: cargo test --verbose --release + + 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 From a151bb7ade1664381378e4982f2400dde49476e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Wed, 23 Aug 2023 19:48:25 +0200 Subject: [PATCH 3/6] Fix broken link, simplify some others --- src/layout/linear/mod.rs | 6 ++---- src/layout/mod.rs | 1 + 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/layout/linear/mod.rs b/src/layout/linear/mod.rs index 4bea178..e3f0ab7 100644 --- a/src/layout/linear/mod.rs +++ b/src/layout/linear/mod.rs @@ -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 diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 9914dc0..f1d8f0b 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -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; From 2f3b9c31f04cd369a396afdd74658fd453fd3390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Wed, 23 Aug 2023 19:51:43 +0200 Subject: [PATCH 4/6] Don't test in release mode --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 23e4316..b4627db 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -76,7 +76,7 @@ jobs: run: cargo c --examples --verbose - name: Run tests - run: cargo test --verbose --release + run: cargo test --verbose docs: runs-on: ubuntu-latest From 05e69d45dfbbc52dce1919f5fe0e0ce49287ed2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Wed, 23 Aug 2023 19:54:14 +0200 Subject: [PATCH 5/6] Silcence verbose output --- .github/workflows/rust.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index b4627db..838c56d 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -45,7 +45,7 @@ jobs: targets: thumbv7em-none-eabihf - name: Build no_std - run: cargo build --verbose --target thumbv7em-none-eabihf -Z avoid-dev-deps + run: cargo build --target thumbv7em-none-eabihf -Z avoid-dev-deps tests: runs-on: ubuntu-latest @@ -70,13 +70,13 @@ jobs: toolchain: ${{ matrix.rust }} - name: Check - run: cargo c --verbose + run: cargo c - name: Check examples - run: cargo c --examples --verbose + run: cargo c --examples - name: Run tests - run: cargo test --verbose + run: cargo test docs: runs-on: ubuntu-latest From 6964885cf8e7d70ebeef88b88b027f2d874cfe1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Wed, 23 Aug 2023 19:57:35 +0200 Subject: [PATCH 6/6] Only test the lib --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 838c56d..c2986ee 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -76,7 +76,7 @@ jobs: run: cargo c --examples - name: Run tests - run: cargo test + run: cargo test --lib docs: runs-on: ubuntu-latest