Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use just #26

Merged
merged 6 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 30 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,44 @@ env:
DEBUG_LOG: 1

jobs:
general-check:
runs-on: ubuntu-latest
check:
runs-on: ${{ matrix.os }}
name: check (${{ matrix.os }})

strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
- os: windows-latest

steps:
- uses: actions/checkout@v3

- name: Install rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2023-10-06
components: clippy, rustfmt
- uses: dtolnay/rust-toolchain@stable

- name: Rust cache
uses: Swatinem/rust-cache@v2
- uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ runner.os }}

- name: Fmt
run: cargo fmt --all -- --check
- name: Prepare
run: |
cargo --version
cargo +stable install just
cargo +stable install taplo-cli

- name: Clippy
run: cargo clippy --all-targets -- -D warnings
- name: Run check
if: matrix.os == 'ubuntu-latest'
run: |
just check

- name: Check
run: cargo check --all-targets
- name: Run check
if: matrix.os == 'windows-latest'
run: |
just check-windows

tests:
needs: general-check
needs: check
runs-on: ${{ matrix.os }}
name: tests (${{ matrix.target }})

Expand All @@ -66,15 +76,14 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Rust cache
id: cache
uses: Swatinem/rust-cache@v2
- uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ runner.os }}

- name: Install extra tool
- name: Prepare
if: matrix.cross
run: |
cargo install cross
cargo +stable install cross

- name: Test code
if: matrix.test
Expand Down
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ scafalra is a command-line interface tool for manage scaffold
Usage: scafalra [OPTIONS] [COMMAND]

Commands:
list List all scaffolds
remove Remove specified scaffolds
mv Rename a scaffold
add Add scaffolds from GitHub repository
create Copy the scaffold folder to the specified directory
token Configure or display your GitHub personal access token(classic)
help Print this message or the help of the given subcommand(s)
list List all scaffolds
remove Remove specified scaffolds
mv Rename a scaffold
add Add scaffolds from GitHub repository
create Copy the scaffold folder to the specified directory
token Configure or display your GitHub personal access token(classic)
update Update self
uninstall Uninstall self
help Print this message or the help of the given subcommand(s)

Options:
--debug Use debug output
Expand Down
24 changes: 24 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
default:
just --list --unsorted

fmt:
cargo fmt --all
taplo fmt

lint: fmt
cargo clippy --all-targets --all-features

check:
cargo fmt --all -- --check
taplo fmt --check
cargo check --all-targets --all-features
cargo clippy --all-targets --all-features -- -D warnings

check-windows:
cargo check --all-targets --all-features
cargo clippy --all-targets --all-features -- -D warnings

alias br := build-release

build-release:
cargo build --release
2 changes: 2 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[toolchain]
# 1.75.0
channel = "nightly-2023-10-06"
profile = "minimal"
components = ["rustfmt", "clippy"]