diff --git a/.github/workflows/rust-clippy.yml b/.github/workflows/rust-clippy.yml new file mode 100644 index 0000000..c716ee4 --- /dev/null +++ b/.github/workflows/rust-clippy.yml @@ -0,0 +1,34 @@ +name: Rust Clippy + +on: + push: + branches: + - 'main' + - 'master' + + pull_request: + branches: + - 'main' + - 'master' + +jobs: + check: + name: Clippy check + runs-on: ubuntu-latest + + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Install minimal stable with clippy component + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + components: clippy + + - name: Annotate commit with clippy warnings + uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --all-features \ No newline at end of file diff --git a/.github/workflows/rust-fmt.yml b/.github/workflows/rust-fmt.yml new file mode 100644 index 0000000..77b1fd3 --- /dev/null +++ b/.github/workflows/rust-fmt.yml @@ -0,0 +1,34 @@ +name: Rust Fmt + +on: + push: + branches: + - 'main' + - 'master' + + pull_request: + branches: + - 'main' + - 'master' + +jobs: + check: + name: Check formatting + runs-on: ubuntu-latest + + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Install minimal stable with rustfmt component + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + components: rustfmt + + - name: Run cargo fmt + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check \ No newline at end of file diff --git a/.github/workflows/rust-tests.yml b/.github/workflows/rust-tests.yml index dce0b38..08af278 100644 --- a/.github/workflows/rust-tests.yml +++ b/.github/workflows/rust-tests.yml @@ -1,13 +1,15 @@ -name: Tests +name: Rust Tests on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] + push: + branches: + - 'main' + - 'master' -env: - CARGO_TERM_COLOR: always + pull_request: + branches: + - 'main' + - 'master' jobs: test: @@ -17,22 +19,11 @@ jobs: - name: Checkout sources uses: actions/checkout@v2 - - name: Install minimal stable with clippy and rustfmt + - name: Install minimal stable uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: stable - components: clippy, rustfmt - - - name: Run cargo fmt - uses: actions-rs/cargo@v1 - with: - command: fmt - - - name: Run cargo clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - name: Run cargo test uses: actions-rs/cargo@v1