From 3058db1c6e297e41ed49d44403d09441503ec97f Mon Sep 17 00:00:00 2001 From: John Ericson Date: Fri, 10 Feb 2023 17:39:53 +0000 Subject: [PATCH] Split CI jobs Intended benefits - More parallelism - Failures are clearer at a glance --- .github/workflows/rust.yml | 66 ++++++++++++++++++++++++++++++++++---- 1 file changed, 60 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 41906d66..8ca7f67f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -14,7 +14,7 @@ env: CARGO_TERM_COLOR: always jobs: - clippy_fmt_test: + clippy: runs-on: ubuntu-latest strategy: @@ -26,29 +26,83 @@ jobs: uses: fiam/arm-none-eabi-gcc@v1.0.3 with: release: '9-2019-q4' - - name: Install clang - run: sudo apt-get update && sudo apt install -y clang - name: Install toolchains uses: actions-rs/toolchain@v1 with: toolchain: nightly - default: true - components: rust-src, rustfmt, clippy + override: true + components: rust-src, clippy - uses: actions/checkout@v2 - name: Cargo clippy uses: actions-rs/cargo@v1 with: command: clippy - args: -Z build-std=core --target ./${{ matrix.target }}.json -- -D warnings + args: --target ./${{ matrix.target }}.json + fmt: + runs-on: ubuntu-latest + steps: + - name: Install toolchains + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + components: rust-src, rustfmt + - uses: actions/checkout@v2 - name: Cargo fmt uses: actions-rs/cargo@v1 with: command: fmt args: --all -- --check + + build: + runs-on: ubuntu-latest + strategy: + matrix: + target: ["nanos", "nanox", "nanosplus"] + + steps: + - name: arm-none-eabi-gcc + uses: fiam/arm-none-eabi-gcc@v1.0.3 + with: + release: '9-2019-q4' + - name: Install clang + run: sudo apt-get update && sudo apt install -y clang + - name: Install toolchains + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + components: rust-src + - uses: actions/checkout@v2 + - name: Cargo build + uses: actions-rs/cargo@v1 + with: + command: build + args: --target ./${{ matrix.target }}.json + + test: + runs-on: ubuntu-latest + strategy: + matrix: + target: ["nanos", "nanox", "nanosplus"] + + steps: + - name: arm-none-eabi-gcc + uses: fiam/arm-none-eabi-gcc@v1.0.3 + with: + release: '9-2019-q4' + - name: Install clang + run: sudo apt-get update && sudo apt install -y clang + - uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + components: rust-src - name: Install dependencies run: | sudo apt-get update && sudo apt-get install -y qemu-user-static pip install speculos --extra-index-url https://test.pypi.org/simple/ + - uses: actions/checkout@v2 - name: Unit tests uses: actions-rs/cargo@v1 with: