From 92b3e6a9b66ec2f4d092268818716b3c4811a417 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Thu, 14 Nov 2019 13:29:45 +0000 Subject: [PATCH 1/3] Actions CI workflow --- .github/workflows/ci.yml | 51 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..fa732ee --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,51 @@ +name: CI checks + +on: [push, pull_request] + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + toolchain: 1.33.0 + override: true + + # Ensure all code has been formatted with rustfmt + - run: rustup component add rustfmt + - name: Check formatting + uses: actions-rs/cargo@v1 + with: + command: fmt + args: -- --check --color always + + test: + name: Test on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macOS-latest] + + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + toolchain: 1.33.0 + override: true + - name: cargo fetch + uses: actions-rs/cargo@v1 + with: + command: fetch + - name: Build tests + uses: actions-rs/cargo@v1 + with: + command: build + args: --verbose --release --tests + - name: Run tests + uses: actions-rs/cargo@v1 + with: + command: test + args: --verbose --release From ab8293935a39e9bb557ad73ae5cf935e9fa72d32 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Thu, 14 Nov 2019 13:30:07 +0000 Subject: [PATCH 2/3] Catch documentation errors caused by code changes --- .github/workflows/ci.yml | 23 +++++++++++++++++++++++ src/lib.rs | 2 ++ 2 files changed, 25 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa732ee..271ee00 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,3 +49,26 @@ jobs: with: command: test args: --verbose --release + + doc-links: + name: Nightly lint + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + override: true + - name: cargo fetch + uses: actions-rs/cargo@v1 + with: + command: fetch + + # Ensure intra-documentation links all resolve correctly + # Requires #![deny(intra_doc_link_resolution_failure)] in crate. + - name: Check intra-doc links + uses: actions-rs/cargo@v1 + with: + command: doc + args: --document-private-items diff --git a/src/lib.rs b/src/lib.rs index 64ddf24..da1cf93 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -27,6 +27,8 @@ //! recommended to enable this if you are able to use a nightly version of the Rust compiler. #![no_std] +// Catch documentation errors caused by code changes. +#![deny(intra_doc_link_resolution_failure)] #![deny(missing_debug_implementations)] #![deny(missing_docs)] #![deny(unsafe_code)] From d8f35139c516d5111c15889359575fcc6a7279bb Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Thu, 14 Nov 2019 13:31:25 +0000 Subject: [PATCH 3/3] Check no-std compatibility --- .github/workflows/ci.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 271ee00..444846e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,6 +50,27 @@ jobs: command: test args: --verbose --release + no-std: + name: Check no-std compatibility + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: actions-rs/toolchain@v1 + with: + toolchain: 1.33.0 + override: true + - run: rustup target add thumbv6m-none-eabi + - name: cargo fetch + uses: actions-rs/cargo@v1 + with: + command: fetch + - name: Build + uses: actions-rs/cargo@v1 + with: + command: build + args: --verbose --target thumbv6m-none-eabi --no-default-features + doc-links: name: Nightly lint runs-on: ubuntu-latest