Skip to content

Commit

Permalink
Restructure workflows to match formatters
Browse files Browse the repository at this point in the history
  • Loading branch information
chipbuster committed Jan 14, 2022
1 parent b7e66a8 commit 8b53a35
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 76 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/docs-workflow.yml

This file was deleted.

78 changes: 78 additions & 0 deletions .github/workflows/formatter-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Documentation Workflow
on: [push, pull_request]
push:
paths:
- "docs/**"
- "**.md"
- "**.toml"
pull_request:
paths:
- "docs/**"
- "**.md"
- "**.toml"

jobs:
# Run the dprint code formatter for documentation
dprint:
name: Dprint [Docs Formatter]
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v2.4.0
- name: Docs | Format
uses: dprint/check@v2.0

# Run the `rustfmt` code formatter
rustfmt:
name: Rustfmt [Source Formatter]
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v2.4.0

- name: Setup | Rust
uses: actions-rs/toolchain@v1.0.7
with:
toolchain: stable
override: true
profile: minimal
components: rustfmt

- name: Setup | libdbus (ubuntu)
run: sudo apt-get install libdbus-1-dev

- name: Build | Format
run: cargo fmt --all -- --check

# Run the `clippy` linting tool
clippy:
name: Clippy [Linter]
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Setup | Checkout
uses: actions/checkout@v2.4.0

- name: Setup | Cache
uses: Swatinem/rust-cache@v1

- name: Setup | libdbus (ubuntu)
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install libdbus-1-dev

- name: Setup | Rust
uses: actions-rs/toolchain@v1.0.7
with:
toolchain: stable
override: true
profile: minimal
components: clippy

- name: Build | Lint
uses: actions-rs/cargo@v1.0.3
with:
command: clippy
args: --workspace --locked --all-targets --all-features -- -D clippy::all

56 changes: 1 addition & 55 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,61 +10,7 @@ on:
- "**.md"

jobs:
# Run the `rustfmt` code formatter
rustfmt:
name: Rustfmt [Formatter]
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v2.4.0

- name: Setup | Rust
uses: actions-rs/toolchain@v1.0.7
with:
toolchain: stable
override: true
profile: minimal
components: rustfmt

- name: Setup | libdbus (ubuntu)
run: sudo apt-get install libdbus-1-dev

- name: Build | Format
run: cargo fmt --all -- --check

# Run the `clippy` linting tool
clippy:
name: Clippy [Linter]
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Setup | Checkout
uses: actions/checkout@v2.4.0

- name: Setup | Cache
uses: Swatinem/rust-cache@v1

- name: Setup | libdbus (ubuntu)
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install libdbus-1-dev

- name: Setup | Rust
uses: actions-rs/toolchain@v1.0.7
with:
toolchain: stable
override: true
profile: minimal
components: clippy

- name: Build | Lint
uses: actions-rs/cargo@v1.0.3
with:
command: clippy
args: --workspace --locked --all-targets --all-features -- -D clippy::all

# Ensure that the project could be successfully compiled
# Ensure that the project can be successfully compiled
cargo_check:
name: Compile
runs-on: ubuntu-latest
Expand Down

0 comments on commit 8b53a35

Please sign in to comment.