From fbafe8382f89203d21b59c577005066ac0377713 Mon Sep 17 00:00:00 2001 From: Stefan Ellmauthaler <71695780+ellmau@users.noreply.github.com> Date: Mon, 28 Feb 2022 10:03:29 +0100 Subject: [PATCH] Create pr.yml --- .github/workflows/pr.yml | 54 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..3c16b58 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,54 @@ +name: CI PR + +on: + pull_request: + branches: + - main + +env: + RUST_BACKTRACE: 1 + +jobs: + test: + name: Test Rust ${{ matrix.rust }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - { rust: stable, os: ubuntu-latest } + - { rust: stable, os: macos-latest } + - { rust: stable, os: windows-latest } + - { rust: stable-i686-msvc, os: windows-latest } + steps: + - uses: actions/checkout@v2 + - uses: hecrj/setup-rust-action@v1 + with: + rust-version: ${{ matrix.rust }} + - run: cargo test --verbose --workspace + - run: cargo test --verbose --workspace --all-features + - run: cargo test --verbose --workspace --no-default-features + + clippy: + name: Lint with clippy + runs-on: ubuntu-latest + env: + RUSTFLAGS: -Dwarnings + steps: + - uses: actions/checkout@v2 + - uses: hecrj/setup-rust-action@v1 + with: + components: clippy + - run: cargo clippy --workspace --all-targets --verbose + - run: cargo clippy --workspace --all-targets --verbose --no-default-features + - run: cargo clippy --workspace --all-targets --verbose --all-features + + rustfmt: + name: Verify code formatting + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: hecrj/setup-rust-action@v1 + with: + components: rustfmt + - run: cargo fmt --all -- --check