chore: refactored code for brevity #3
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
# The name of your workflow. GitHub displays the names of your workflows on your repository's "Actions" tab | |
name: CI | |
on: [push, pull_request] | |
jobs: | |
test: | |
name: Test | |
# Containers must run in Linux based operating systems | |
runs-on: ubuntu-latest | |
steps: | |
# Downloads a copy of the code in your repository before running CI tests | |
- name: Check out repository code | |
uses: actions/checkout@v3 | |
# This GitHub Action installs a Rust toolchain using rustup. It is designed for one-line concise usage and good defaults. | |
- name: Install the Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
# This GitHub Action caches the Rust toolchain between workflow runs. It is designed for one-line concise usage and good defaults. | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run tests | |
run: cargo test | |
fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt | |
- name: Enforce formatting | |
run: cargo fmt --check | |
# `clippy` container job | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy | |
- name: Linting | |
run: cargo clippy -- -D warnings | |