74 lines
1.9 KiB
YAML
74 lines
1.9 KiB
YAML
|
name: CI
|
||
|
|
||
|
on:
|
||
|
push:
|
||
|
paths-ignore:
|
||
|
- '**.md'
|
||
|
- '**.png'
|
||
|
pull_request:
|
||
|
paths-ignore:
|
||
|
- '**.md'
|
||
|
- '**.png'
|
||
|
|
||
|
env:
|
||
|
RUST_TOOLCHAIN: nightly
|
||
|
TOOLCHAIN_PROFILE: minimal
|
||
|
|
||
|
jobs:
|
||
|
lints:
|
||
|
name: Run cargo fmt and cargo clippy
|
||
|
runs-on: ubuntu-latest
|
||
|
steps:
|
||
|
- name: Checkout sources
|
||
|
uses: actions/checkout@v2
|
||
|
- name: Install toolchain
|
||
|
uses: actions-rs/toolchain@v1
|
||
|
with:
|
||
|
profile: ${{ env.TOOLCHAIN_PROFILE }}
|
||
|
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
||
|
override: true
|
||
|
components: rustfmt, clippy
|
||
|
- name: Cache
|
||
|
uses: Swatinem/rust-cache@v1
|
||
|
- name: Run cargo fmt
|
||
|
uses: actions-rs/cargo@v1
|
||
|
with:
|
||
|
command: fmt
|
||
|
args: --all -- --check
|
||
|
- name: Run cargo check with no default features
|
||
|
uses: actions-rs/cargo@v1
|
||
|
with:
|
||
|
command: check
|
||
|
args: --no-default-features
|
||
|
- name: Run cargo check with all features
|
||
|
uses: actions-rs/cargo@v1
|
||
|
with:
|
||
|
command: check
|
||
|
args: --all-features
|
||
|
- name: Run cargo clippy
|
||
|
uses: actions-rs/cargo@v1
|
||
|
with:
|
||
|
command: clippy
|
||
|
args: -- -D warnings
|
||
|
test:
|
||
|
name: Run cargo test
|
||
|
runs-on: ubuntu-latest
|
||
|
steps:
|
||
|
- name: Checkout sources
|
||
|
uses: actions/checkout@v2
|
||
|
- name: Install toolchain
|
||
|
uses: actions-rs/toolchain@v1
|
||
|
with:
|
||
|
profile: ${{ env.TOOLCHAIN_PROFILE }}
|
||
|
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
||
|
override: true
|
||
|
- name: Cache
|
||
|
uses: Swatinem/rust-cache@v1
|
||
|
- name: Run cargo test --no-run
|
||
|
uses: actions-rs/cargo@v1
|
||
|
with:
|
||
|
command: test
|
||
|
args: --all-features --no-run
|
||
|
- name: Run cargo test
|
||
|
run: sudo bash -c "ulimit -Sl 512 && ulimit -Hl 512 && sudo -u runner RUSTUP_TOOLCHAIN=nightly /home/runner/.cargo/bin/cargo test --all-features"
|