From 157967694859b8ee159e99b4ab618104e72708cc Mon Sep 17 00:00:00 2001 From: cduvray Date: Thu, 23 Feb 2023 07:37:35 +0100 Subject: [PATCH] build: ci --- .github/workflows/ci.yml | 71 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 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..35ba411 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,71 @@ +name: ci +on: + pull_request: + +jobs: + style: + name: Format + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: rustfmt + + - name: Check format + uses: actions-rs/cargo@v1 + with: + command: fmt + args: -- --check + + clippy: + name: Clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: clippy + - uses: actions-rs/cargo@v1 + with: + command: clippy + args: --all-targets --all-features -- -D warnings + + tests: + name: Tests + runs-on: ${{ matrix.os }} + strategy: + matrix: + build: [pinned, stable, nightly] + include: + - build: pinned + os: ubuntu-20.04 + rust: 1.65.0 + - build: stable + os: ubuntu-20.04 + rust: stable + - build: nightly + os: ubuntu-20.04 + rust: nightly + steps: + - uses: actions/checkout@v3 + - name: Install Rust + uses: hecrj/setup-rust-action@v1 + with: + rust-version: ${{ matrix.rust }} + + - name: Build System Info + run: rustc --version + + - name: Run tests default features + run: cargo test + + - name: Run tests no features + run: cargo test --no-default-features