name: Premerge on: pull_request: branches: [main] push: branches: [main] schedule: - cron: 0 0 1 * * jobs: build-and-test: runs-on: ubuntu-latest steps: - name: Checkout source uses: actions/checkout@v2 - name: Install Rust toolchain uses: actions-rs/toolchain@v1 with: toolchain: stable override: true - name: Build check uses: actions-rs/cargo@v1 with: command: check - name: Tests uses: actions-rs/cargo@v1 with: command: test linting: if: ${{ github.ref != 'main' }} runs-on: ubuntu-latest steps: - name: Checkout source uses: actions/checkout@v2 - name: Install Rust toolchain uses: actions-rs/toolchain@v1 with: toolchain: stable default: true components: rustfmt, clippy - name: format uses: actions-rs/cargo@v1 with: command: fmt args: --all -- --check - name: clippy uses: actions-rs/clippy-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} args: -- -D warnings