2020-10-04 14:12:56 +00:00
|
|
|
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:
|
2020-11-04 13:42:42 +00:00
|
|
|
toolchain: stable
|
2020-10-04 14:12:56 +00:00
|
|
|
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:
|
2020-11-04 13:42:42 +00:00
|
|
|
toolchain: stable
|
2020-10-04 14:12:56 +00:00
|
|
|
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
|