Skip to content

Commit

Permalink
ci: Run prettier and shfmt/shellcheck and reviewdog
Browse files Browse the repository at this point in the history
  • Loading branch information
hunger committed Sep 28, 2023
1 parent da600bf commit c5f3ed5
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 12 deletions.
50 changes: 39 additions & 11 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
jobs:
cargo_fmt:
runs-on: ubuntu-latest

env:
RUSTFLAGS: "-D warnings"
steps:
Expand All @@ -27,26 +28,33 @@ jobs:
- name: cargo version
run: cargo +nightly --version
- name: Run cargo fmt
run: cargo +nightly fmt
run: cargo +nightly fmt --check

cargo_check:
runs-on: ubuntu-latest
strategy:
matrix:
rust_version: [stable, nightly]
os: [ubuntu-latest]

runs-on: ${{matrix.os}}

env:
RUSTFLAGS: "-D warnings"
steps:
- uses: actions/checkout@v3
- name: Install rust (nightly)
- name: Install rust (${{matrix.rust_version}})
uses: ./.github/actions/setup-rust
with:
toolchain: nightly
toolchain: ${{matrix.rust_version}}
key: cargo_check
- name: cargo version
run: cargo +nightly --version
run: cargo +${{matrix.rust_version}} --version
- name: Run cargo check
run: cargo +nightly check
run: cargo +${{matrix.rust_version}} check

cargo_clippy:
runs-on: ubuntu-latest

env:
RUSTFLAGS: "-D warnings"
steps:
Expand All @@ -63,23 +71,43 @@ jobs:
run: cargo +nightly clippy

cargo_test:
runs-on: ubuntu-latest
strategy:
matrix:
rust_version: [stable, nightly]
os: [ubuntu-latest]

runs-on: ${{matrix.os}}

env:
RUSTFLAGS: "-D warnings"
steps:
- uses: actions/checkout@v3
- name: Install rust (nightly)
- name: Install rust (${{matrix.rust_version}})
uses: ./.github/actions/setup-rust
with:
toolchain: nightly
toolchain: ${{matrix.rust_version}}
key: cargo_test
- name: cargo version
run: cargo +nightly --version
run: cargo +${{matrix.rust_version}} --version
- name: Run cargo test
run: cargo +nightly test
run: cargo +${{matrix.rust_version}} test

spellcheck: # run the action
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: streetsidesoftware/cspell-action@v3

prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: creyD/[email protected]
with:
prettier_options: --check --ignore-unknown .

sh-checker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: luizm/action-sh-checker@master
2 changes: 1 addition & 1 deletion crates/cli/initialize_files/arch_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ shift
## Arch:

pch="hook_write_pacman_conf"
"${cleanroom}" dump-command "${pch}" > "commands/${pch}.dump"
"${cleanroom}" dump-command "${pch}" >"commands/${pch}.dump"
mv "commands/${pch}.dump" "commands/${pch}.toml"

## Set up Git:
Expand Down

0 comments on commit c5f3ed5

Please sign in to comment.