Skip to content

Commit

Permalink
ci: fix just invocations
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed May 1, 2024
1 parent a8591b2 commit 446e799
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -44,4 +44,4 @@ jobs:
run: just downgrade-msrv

- name: Test
run: just test
run: just test-no-coverage
7 changes: 4 additions & 3 deletions .github/workflows/coverage.yml
Expand Up @@ -16,18 +16,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
with:
components: llvm-tools-preview

- name: Install cargo-llvm-cov
- name: Install just & cargo-llvm-cov
uses: taiki-e/install-action@v2.29.7
with:
tool: cargo-llvm-cov
tool: just,cargo-llvm-cov

- name: Generate code coverage
run: cargo llvm-cov --workspace --all-features --codecov --output-path codecov.json
run: just test-coverage-codecov

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4.1.0
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/lint.yml
Expand Up @@ -21,18 +21,19 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1.8.0
with:
components: clippy

- name: Install cargo-hack
- name: Install just & cargo-hack
uses: taiki-e/install-action@v2.29.7
with:
tool: cargo-hack
tool: just,cargo-hack

- name: Clippy
run: |
run: just clippy
cargo clippy --workspace --no-default-features
cargo clippy --workspace --no-default-features --all-features
cargo hack --feature-powerset --depth=3 clippy --workspace
Expand Down
27 changes: 5 additions & 22 deletions flake.lock

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

5 changes: 2 additions & 3 deletions flake.nix
@@ -1,7 +1,6 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
};

outputs = inputs@{ flake-parts, ... }:
Expand All @@ -13,7 +12,7 @@
devShells.default = pkgs.mkShell {
packages = [
config.formatter
inputs'.nixpkgs-unstable.legacyPackages.nodePackages.prettier
pkgs.nodePackages.prettier
pkgs.taplo
pkgs.just
] ++ lib.optional pkgs.stdenv.isDarwin [
Expand Down
17 changes: 12 additions & 5 deletions justfile
@@ -1,9 +1,10 @@
_list:
@just --list

# Lint workspace with Clippy
clippy:
cargo clippy --workspace --no-default-features
cargo clippy --workspace --all-features
cargo clippy --workspace --no-default-features --all-features
cargo hack --feature-powerset --depth=3 clippy --workspace

# Downgrade dev-dependencies necessary to run MSRV checks/tests.
Expand Down Expand Up @@ -31,27 +32,33 @@ test toolchain="": (test-no-coverage toolchain)
@just test-coverage-codecov {{ toolchain }}
@just test-coverage-lcov {{ toolchain }}

# Test workspace and generate Codecov coverage file
test-coverage-codecov toolchain="":
cargo {{ toolchain }} llvm-cov --workspace --all-features --codecov --output-path codecov.json

# Test workspace and generate LCOV coverage file
test-coverage-lcov toolchain="":
cargo {{ toolchain }} llvm-cov --workspace --all-features --lcov --output-path lcov.info

# Document workspace
doc:
RUSTDOCFLAGS="--cfg=docsrs" cargo +nightly doc --no-deps --workspace --all-features

# Document workspace and watch for changes
doc-watch:
RUSTDOCFLAGS="--cfg=docsrs" cargo +nightly doc --no-deps --workspace --all-features --open
cargo watch -- RUSTDOCFLAGS="--cfg=docsrs" cargo +nightly doc --no-deps --workspace --all-features

# Check project
check:
just --unstable --fmt --check
npx -y prettier --check '**/*.md'
taplo lint
prettier --check $(fd --hidden --extension=md --extension=yml)
taplo lint $(fd --hidden --extension=toml)
cargo +nightly fmt -- --check

# Format project
fmt:
just --unstable --fmt
npx -y prettier --write '**/*.md'
taplo format
prettier --write $(fd --hidden --extension=md --extension=yml)
taplo format $(fd --hidden --extension=toml)
cargo +nightly fmt

0 comments on commit 446e799

Please sign in to comment.