From dfef5ee1e548d793d1b8ece080f99587a9ab4b05 Mon Sep 17 00:00:00 2001 From: Rob Young Date: Wed, 21 Apr 2021 22:26:27 +0100 Subject: [PATCH] Update CI for nrf-rs - Test against multiple rust versions - Determine minimum supported rust version and test against that - Use cargo build --examples for examples The steps have been mostly lifted from nrf-rs/nrf52-dk. I've gone with using cargo directly rather than actions-rs/cargo as it's easier for people to copy for running locally. --- .github/scripts/build-examples.sh | 19 ------------------- .github/workflows/ci.yaml | 20 ++++++++++++++------ 2 files changed, 14 insertions(+), 25 deletions(-) delete mode 100755 .github/scripts/build-examples.sh diff --git a/.github/scripts/build-examples.sh b/.github/scripts/build-examples.sh deleted file mode 100755 index fc4bdf55..00000000 --- a/.github/scripts/build-examples.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -_status=0 - -for example in $(ls examples | sed s/\.rs$//); do - output=$(cargo build --target=thumbv6m-none-eabi --example=$example --color=always 2>&1) - result=$? - - if [[ $result == 0 ]]; then - echo "::group::✅ $example ok" - else - echo "::group::💥 $example fail" - _status=1 - fi - echo "$output" - echo "::endgroup::" -done - -exit $_status diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 46ac113f..f5700ed6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,28 +9,36 @@ jobs: build: runs-on: ubuntu-latest + strategy: + matrix: + rust: + - stable + - beta + - nightly + - 1.51.0 # Minimum supported rust version (MSRV) + steps: - uses: actions/checkout@v2 - name: Install Rust uses: actions-rs/toolchain@v1 with: - toolchain: stable profile: minimal - target: thumbv6m-none-eabi + toolchain: ${{ matrix.rust }} override: true + target: thumbv6m-none-eabi components: rustfmt, clippy - name: rustfmt run: cargo fmt -- --check - - name: clippy - run: cargo clippy --color=always -- -D warnings - - name: build run: cargo build --target=thumbv6m-none-eabi + - name: clippy + run: cargo clippy --color=always -- -D warnings + - name: build examples - run: .github/scripts/build-examples.sh + run: cargo build --examples --target=thumbv6m-none-eabi