From 6021aa2df8cbcf74910ea4b19ad24036f529710f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Sat, 28 Jan 2023 14:02:54 +0100 Subject: [PATCH] CI: Check and tests for all crates --- .github/workflows/build.yml | 176 +++++++++++++++++++++++++++++++++++- 1 file changed, 172 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9f7d221975..2e3f2b7614 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ env: jobs: # Run cargo fmt --check, includes macros/ style: - name: cargo fmt + name: cargo fmt rtic runs-on: ubuntu-22.04 steps: - name: Checkout @@ -77,7 +77,7 @@ jobs: # Compilation check check: - name: check + name: check rtic runs-on: ubuntu-22.04 strategy: matrix: @@ -112,9 +112,120 @@ jobs: working-directory: ./rtic run: cargo check --target=${{ matrix.target }} + # Compilation check + checkchannel: + name: check rtic-channel + runs-on: ubuntu-22.04 + strategy: + matrix: + target: + - thumbv7m-none-eabi + - thumbv6m-none-eabi + - x86_64-unknown-linux-gnu + toolchain: + - nightly + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install Rust ${{ matrix.toolchain }} + working-directory: ./rtic-channel + run: | + rustup set profile minimal + rustup override set ${{ matrix.toolchain }} + + - name: Configure Rust target (${{ matrix.target }}) + working-directory: ./rtic-channel + run: rustup target add ${{ matrix.target }} + + - name: Fail on warnings + working-directory: ./rtic-channel + 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 + working-directory: ./rtic-channel + run: cargo check --target=${{ matrix.target }} + + # Compilation check + checkmonotonics: + name: check rtic-monotonics + runs-on: ubuntu-22.04 + strategy: + matrix: + target: + - thumbv7m-none-eabi + - thumbv6m-none-eabi + - x86_64-unknown-linux-gnu + toolchain: + - nightly + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install Rust ${{ matrix.toolchain }} + working-directory: ./rtic-monotonics + run: | + rustup set profile minimal + rustup override set ${{ matrix.toolchain }} + + - name: Configure Rust target (${{ matrix.target }}) + working-directory: ./rtic-monotonics + run: rustup target add ${{ matrix.target }} + + - name: Fail on warnings + working-directory: ./rtic-monotonics + 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 + working-directory: ./rtic-monotonics + run: cargo check --target=${{ matrix.target }} + + # Compilation check + checktime: + name: check rtic-time + runs-on: ubuntu-22.04 + strategy: + matrix: + target: + - thumbv7m-none-eabi + - thumbv6m-none-eabi + - x86_64-unknown-linux-gnu + toolchain: + - nightly + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install Rust ${{ matrix.toolchain }} + working-directory: ./rtic-time + run: | + rustup set profile minimal + rustup override set ${{ matrix.toolchain }} + + - name: Configure Rust target (${{ matrix.target }}) + working-directory: ./rtic-time + run: rustup target add ${{ matrix.target }} + + - name: Fail on warnings + working-directory: ./rtic-time + 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 + working-directory: ./rtic-time + run: cargo check --target=${{ matrix.target }} + # Clippy clippy: - name: Cargo clippy + name: Cargo clippy rtic runs-on: ubuntu-22.04 steps: - name: Checkout @@ -337,7 +448,7 @@ jobs: # Run test suite tests: - name: tests + name: tests rtic runs-on: ubuntu-22.04 steps: - name: Checkout @@ -354,6 +465,63 @@ jobs: working-directory: ./rtic run: cargo test --test tests + # Run test suite + testschannel: + name: tests rtic-channel + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Cache Dependencies + uses: Swatinem/rust-cache@v2 + + - name: Fail on warnings + working-directory: ./rtic-channel + run: sed -i 's,//deny_warnings_placeholder_for_ci,#![deny(warnings)],' src/lib.rs + + - name: Run cargo test + working-directory: ./rtic-channel + run: cargo test --test tests + + # Run test suite + testsmonotonics: + name: tests rtic-monotonics + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Cache Dependencies + uses: Swatinem/rust-cache@v2 + + - name: Fail on warnings + working-directory: ./rtic-monotonics + run: sed -i 's,//deny_warnings_placeholder_for_ci,#![deny(warnings)],' src/lib.rs + + - name: Run cargo test + working-directory: ./rtic-monotonics + run: cargo test --test tests + + # Run test suite + teststime: + name: tests rtic-time + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Cache Dependencies + uses: Swatinem/rust-cache@v2 + + - name: Fail on warnings + working-directory: ./rtic-time + run: sed -i 's,//deny_warnings_placeholder_for_ci,#![deny(warnings)],' src/lib.rs + + - name: Run cargo test + working-directory: ./rtic-time + run: cargo test --test tests + # # Build documentation, check links # docs: # name: docs