feat: add ci config, rustfmt, dependabot, etc. #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, reopened, synchronize] | |
jobs: | |
check: | |
name: Check Rust ${{matrix.toolchain}} on ${{matrix.os}} with ${{matrix.args}} | |
runs-on: ${{matrix.os}}-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: [stable, nightly] | |
os: [ubuntu] | |
args: | |
[ | |
--all-targets --no-default-features, | |
--all-targets, | |
--all-targets --all-features, | |
] | |
steps: | |
- uses: actions/checkout@main | |
- name: Install rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{matrix.toolchain}} | |
override: true | |
- name: Check | |
uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
args: ${{matrix.args}} | |
test: | |
name: Test Rust ${{matrix.toolchain}} on ${{matrix.os}} with ${{matrix.args}} | |
runs-on: ${{matrix.os}}-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: [stable, nightly] | |
os: [ubuntu] | |
steps: | |
- uses: actions/checkout@main | |
- name: Install rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{matrix.toolchain}} | |
override: true | |
- name: Test | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: ${{matrix.args}} | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@main | |
- name: Install minimal stable with clippy | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly | |
components: clippy | |
override: true | |
- name: Clippy | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: --all -- -D clippy::all -D warnings | |
rustfmt: | |
name: rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@main | |
- name: Install minimal stable with rustfmt | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
components: rustfmt | |
override: true | |
- name: rustfmt | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
no-std: | |
name: no-std | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
toolchain: [stable, nightly] | |
target: | |
- wasm32-unknown-unknown | |
steps: | |
- uses: actions/checkout@main | |
- name: Install rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{matrix.toolchain}} | |
override: true | |
- run: rustup target add wasm32-unknown-unknown | |
- name: Build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --verbose --no-default-features --target ${{ matrix.target }} |