deps.rs/.github/workflows/premerge.yml

46 lines
946 B
YAML
Raw Normal View History

name: Premerge
on:
pull_request:
2023-01-31 19:37:42 +00:00
types: [opened, synchronize, reopened]
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
2023-01-31 19:37:42 +00:00
- name: install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1.3.5
2023-01-31 19:37:42 +00:00
- name: check
run: cargo check
2023-01-31 19:37:42 +00:00
- name: test
run: cargo test
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
2023-01-31 19:37:42 +00:00
- name: install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1.3.5
with: { components: rustfmt, clippy }
- name: format
2023-01-31 19:37:42 +00:00
run: cargo fmt --all -- --check
- name: clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: -- -D warnings