aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/ci.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/ci.yml')
-rw-r--r--.github/workflows/ci.yml73
1 files changed, 73 insertions, 0 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..08eae51
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,73 @@
+name: CI
+
+on:
+ pull_request:
+ branches:
+ - master
+ push:
+ branches:
+ - master
+
+env:
+ RUSTFLAGS: -Dwarnings
+ RUST_BACKTRACE: 1
+
+jobs:
+ test:
+ strategy:
+ matrix:
+ rust:
+ - stable
+ - nightly
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install Rust
+ run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
+ - name: Install cargo-hack
+ run: cargo install cargo-hack
+ - run: cargo hack build --feature-powerset --optional-deps --no-dev-deps
+ - run: cargo test --all-features
+
+ minrust:
+ strategy:
+ matrix:
+ rust:
+ # This is the minimum supported Rust version of this crate.
+ - 1.27.0
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install Rust
+ run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
+ - run: cargo build
+
+ no-std:
+ strategy:
+ matrix:
+ rust:
+ # This is the minimum supported Rust version for "no_std"
+ - 1.36.0
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install Rust
+ run: rustup update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
+ - run: rustup target add thumbv7m-none-eabi
+ - run: cargo build --no-default-features --target thumbv7m-none-eabi
+
+ clippy:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install Rust
+ run: rustup update stable && rustup default stable
+ - run: cargo clippy --all-features
+
+ rustfmt:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - name: Install Rust
+ run: rustup update stable && rustup default stable
+ - run: cargo fmt --all -- --check