2020-10-04 14:12:56 +00:00
|
|
|
name: Premerge
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
2023-01-31 19:37:42 +00:00
|
|
|
types: [opened, synchronize, reopened]
|
2020-10-04 14:12:56 +00:00
|
|
|
push:
|
|
|
|
branches: [main]
|
|
|
|
schedule:
|
|
|
|
- cron: 0 0 1 * *
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-and-test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-01-31 19:37:42 +00:00
|
|
|
- name: checkout source
|
|
|
|
uses: actions/checkout@v3
|
2020-10-04 14:12:56 +00:00
|
|
|
|
2023-01-31 19:37:42 +00:00
|
|
|
- name: install Rust
|
2023-03-01 23:54:50 +00:00
|
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1.4.3
|
2020-10-04 14:12:56 +00:00
|
|
|
|
2023-01-31 19:37:42 +00:00
|
|
|
- name: check
|
|
|
|
run: cargo check
|
2020-10-04 14:12:56 +00:00
|
|
|
|
2023-01-31 19:37:42 +00:00
|
|
|
- name: test
|
|
|
|
run: cargo test
|
2020-10-04 14:12:56 +00:00
|
|
|
|
|
|
|
linting:
|
|
|
|
if: ${{ github.ref != 'main' }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-01-31 19:37:42 +00:00
|
|
|
- name: checkout source
|
|
|
|
uses: actions/checkout@v3
|
2020-10-04 14:12:56 +00:00
|
|
|
|
2023-01-31 19:37:42 +00:00
|
|
|
- name: install Rust
|
2023-03-01 23:54:50 +00:00
|
|
|
uses: actions-rust-lang/setup-rust-toolchain@v1.4.3
|
2023-01-31 19:37:42 +00:00
|
|
|
with: { components: rustfmt, clippy }
|
2020-10-04 14:12:56 +00:00
|
|
|
|
|
|
|
- name: format
|
2023-01-31 19:37:42 +00:00
|
|
|
run: cargo fmt --all -- --check
|
2020-10-04 14:12:56 +00:00
|
|
|
|
|
|
|
- name: clippy
|
|
|
|
uses: actions-rs/clippy-check@v1
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
args: -- -D warnings
|