summaryrefslogtreecommitdiff
path: root/.github/workflows/pr_check.yml
blob: 83ff4da9b520cc481d84a42975a5966fb60ffaa5 (plain)
name: PR Check

on:
  pull_request:
    branches: [ "main" ]

env:
  CARGO_TERM_COLOR: always

jobs:
  fmt:
    name: rustfmt
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true
      - uses: actions-rs/cargo@v1
        with:
          command: fmt
          args: --all -- --check
  
  clippy:
    name: clippy
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Install Rust Toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          components: clippy
          override: true
      - name: Run rustfmt
        run: cargo fmt -- --check
      - name: Run clippy
        run: cargo clippy --all-warnings --deny warnings
  
  test:
    name: test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true