Skip to content
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
14 changes: 11 additions & 3 deletions .github/workflows/cargo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
timeout-minutes: 12
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
permissions:
checks: write
Expand All @@ -28,28 +28,36 @@ jobs:
continue-on-error: false
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
if: runner.os != 'Windows'
- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Run cargo fmt
run: cargo fmt --check
- name: Run tests
- name: Run tests with coverage (Unix)
if: runner.os != 'Windows'
run: cargo llvm-cov --all-features --workspace --codecov --output-path codecov.json nextest
- name: Run tests (Windows)
if: runner.os == 'Windows'
run: cargo nextest run --all-features --workspace
- name: Show coverage report
if: runner.os != 'Windows'
run: cargo llvm-cov report
- name: Check link
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-targets --all-features -- -D warnings
- name: Upload coverage to Codecov
if: runner.os != 'Windows'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
files: codecov.json
fail_ci_if_error: true
- name: Run cargo check
run: cargo check
- name: Validate cargo-dist config
- name: Validate cargo-dist config (Unix only)
if: runner.os != 'Windows'
run: |
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.30.2/cargo-dist-installer.sh | sh
dist plan
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@ anstream = ">=0.6.0"
anstyle = ">=1.0.0"
clap = { version = ">=4.5.5", features = ["cargo", "derive"] }
ctrlc = ">=3.4.4"
daemonize = ">=0.5.0"
env_logger = ">=0.11.3"
glob = ">=0.3.1"
log = ">=0.4.22"
nix = { version = ">=0.29.0", features = ["signal", "fs"] }
notify = ">=6.1.1"
notify-debouncer-mini = ">=0.4.1"
rand = ">=0.8.5"
Expand All @@ -32,6 +30,18 @@ toml = ">=0.8.14"
toml-span = ">=0.3.0, <0.5"
validator = { version = ">=0.18.1", features = ["derive"] }

[target.'cfg(unix)'.dependencies]
nix = { version = ">=0.29.0", features = ["signal", "fs"] }

[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.59", features = [
"Win32_Foundation",
"Win32_System_Threading",
"Win32_Security",
"Win32_Storage_FileSystem",
"Win32_System_IO",
] }

[dev-dependencies]
assert_cmd = ">=2.0.14"
assert_fs = ">=1.1.1"
Expand Down
48 changes: 45 additions & 3 deletions pls.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,64 @@ requires = ["command.cargo.cover"]

[command.cargo.clippy]
subcommand = "clippy"
args = "--all-targets --all-features -- -D warnings"
all_features = true
all_targets = true
args = "-- -D warnings"
description = "Run clippy with all warnings as errors"

[command.cargo.clippy-linux]
extends = "clippy"
target = "x86_64-unknown-linux-gnu"
description = "Run clippy for linux"

[command.cargo.clippy-windows]
extends = "clippy"
target = "x86_64-pc-windows-msvc"
description = "Run clippy for windows"

[command.cargo.clippy-darwin]
extends = "clippy"
target = "x86_64-apple-darwin"
description = "Run clippy for macOS"

[group.clippy-all]
description = "Run clippy for all platforms"
requires = ["clippy-windows", "clippy-linux", "clippy-darwin"]

[command.cargo.clippy-fix]
subcommand = "clippy"
args = "--all-targets --all-features --fix -- -D warnings"
all_features = true
all_targets = true
args = "--fix -- -D warnings"
description = "Run clippy in fix mode"

[command.cargo.check]
subcommand = "check"
description = "Run cargo check"

[command.cargo.check-linux]
extends = "check"
target = "x86_64-unknown-linux-gnu"
description = "Run cargo check for linux"

[command.cargo.check-windows]
extends = "check"
target = "x86_64-pc-windows-msvc"
description = "Run cargo check for windows"

[command.cargo.check-darwin]
extends = "check"
target = "x86_64-apple-darwin"
description = "Run cargo check for macOS"

[group.check-all]
description = "Run cargo check for all platforms"
requires = ["check-windows", "check-linux", "check-darwin"]

[command.exec.ci]
command = "echo 'CI checks complete'"
description = "Run all CI checks before pushing"
requires = ["command.cargo.fmt", "command.cargo.test", "command.cargo.clippy", "command.cargo.check"]
requires = ["command.cargo.fmt", "command.cargo.test", "clippy-all", "check-all"]

[artifact.cargo.build]
subcommand = "build"
Expand Down
Loading
Loading