Skip to content

Commit 1b859ff

Browse files
committed
ci
1 parent 4cdec2d commit 1b859ff

File tree

7 files changed

+151
-20
lines changed

7 files changed

+151
-20
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Cache Rust dependencies
2+
description: Cache Rust dependencies to speed up builds
3+
runs:
4+
using: composite
5+
steps:
6+
- uses: actions/cache@v4
7+
name: Cache Cargo registry
8+
id: cache-cargo-registry
9+
with:
10+
key: cargo-registry-${{ runner.os }}-${{ runner.arch }}
11+
path: |
12+
~/.cargo/registry/index/
13+
~/.cargo/registry/cache/
14+
~/.cargo/git/db/
15+
- uses: actions/cache@v4
16+
name: Cache Cargo target
17+
id: cache-cargo-target
18+
with:
19+
key: cargo-target-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('Cargo.lock') }}
20+
restore-keys: |
21+
cargo-target-${{ runner.os }}-${{ runner.arch }}-
22+
path: |
23+
target/**
24+
- name: Set cache hit output
25+
shell: bash
26+
run: |
27+
echo "target-cache-hit=${{ steps.cache-cargo-target.outputs.cache-hit }}" >> $GITHUB_OUTPUT
28+
echo "registry-cache-hit=${{ steps.cache-cargo-registry.outputs.cache-hit }}" >> $GITHUB_OUTPUT

.github/workflows/build.yaml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Check, test, clippy
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17+
CARGO_INCREMENTAL: 0
18+
CARGO_TERM_COLOR: always
19+
20+
jobs:
21+
check:
22+
runs-on: ${{ matrix.os }}
23+
strategy:
24+
matrix:
25+
os: [ubuntu-latest, macos-latest]
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: ./.github/actions/rust-cache
29+
- run: cargo check --all-targets
30+
test:
31+
runs-on: ${{ matrix.os }}
32+
strategy:
33+
matrix:
34+
os: [ubuntu-latest, macos-latest]
35+
steps:
36+
- uses: actions/checkout@v4
37+
- uses: ./.github/actions/rust-cache
38+
- name: Install cargo-binstall
39+
uses: cargo-bins/cargo-binstall@main
40+
- name: Install cargo-nextest
41+
run: cargo binstall --no-confirm cargo-nextest
42+
- run: cargo nextest run --profile ci --cargo-profile ci
43+
clippy:
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v4
47+
- uses: ./.github/actions/rust-cache
48+
- run: cargo clippy --all-targets -- -D warnings
49+
fmt:
50+
runs-on: ubuntu-latest
51+
steps:
52+
- uses: actions/checkout@v4
53+
- uses: ./.github/actions/rust-cache
54+
- run: cargo fmt --check
55+
deny:
56+
runs-on: ubuntu-latest
57+
steps:
58+
- uses: actions/checkout@v4
59+
- name: Install cargo-binstall
60+
uses: cargo-bins/cargo-binstall@main
61+
- name: Install cargo-deny
62+
run: cargo binstall --no-confirm cargo-deny
63+
- run: cargo deny check
64+
audit:
65+
runs-on: ubuntu-latest
66+
steps:
67+
- uses: actions/checkout@v4
68+
- name: Install cargo-binstall
69+
uses: cargo-bins/cargo-binstall@main
70+
- name: Install cargo-audit
71+
run: cargo binstall --no-confirm cargo-audit
72+
- run: cargo audit

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
target

Cargo.toml

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[package]
2-
authors = ["Brenden Matthews <brenden@ellipsislabs.xyz>"]
3-
categories = ["development-tools", "development-tools::cargo-plugins"]
2+
authors = ["Brenden Matthews <brenden@ellipsislabs.xyz>"]
3+
categories = ["development-tools", "development-tools::cargo-plugins"]
44
description = "🎡 Detect workspace dependency cycles in Rust monorepos"
5-
edition = "2021"
6-
keywords = ["cargo", "workspace", "dependencies", "cycles", "monorepo"]
7-
license = "MIT OR Apache-2.0"
8-
name = "cargo-ferris-wheel"
9-
readme = "README.md"
10-
repository = "https://github.com/ellipsis-dev/atlas"
11-
version = "1.0.0"
5+
edition = "2021"
6+
keywords = ["cargo", "workspace", "dependencies", "cycles", "monorepo"]
7+
license = "MIT OR Apache-2.0"
8+
name = "cargo-ferris-wheel"
9+
readme = "README.md"
10+
repository = "https://github.com/ellipsis-dev/atlas"
11+
version = "1.0.0"
1212

1313
[lib]
1414
name = "ferris_wheel"
@@ -20,12 +20,12 @@ path = "src/main.rs"
2020

2121
[dependencies]
2222
# CLI and UI
23-
clap = { version = "4.5", features = ["derive", "cargo", "env"] }
24-
console = { version = "0.16" }
23+
clap = { version = "4.5", features = ["derive", "cargo", "env"] }
24+
console = { version = "0.16" }
2525
indicatif = { version = "0.17", features = ["rayon"] }
2626

2727
# Error handling
28-
miette = { version = "7.6", features = ["fancy"] }
28+
miette = { version = "7.6", features = ["fancy"] }
2929
thiserror = { version = "2.0" }
3030

3131
# Graph algorithms and visualization
@@ -35,24 +35,30 @@ petgraph = { version = "0.8" }
3535
rayon = { version = "1.10" }
3636

3737
# Data structures and utilities
38-
paste = { version = "1.0" }
39-
serde = { version = "1.0", features = ["derive"] }
38+
paste = { version = "1.0" }
39+
serde = { version = "1.0", features = ["derive"] }
4040
serde_json = { version = "1.0" }
41-
toml = { version = "0.8" }
41+
toml = { version = "0.8" }
4242

4343
# File system
44-
glob = { version = "0.3" }
44+
glob = { version = "0.3" }
4545
walkdir = { version = "2.5" }
4646

4747
[features]
4848
default = []
4949

5050
[dev-dependencies]
51-
assert_cmd = { version = "2.0" }
52-
predicates = { version = "3.1" }
51+
assert_cmd = { version = "2.0" }
52+
predicates = { version = "3.1" }
5353
pretty_assertions = { version = "1.4" }
54-
tempfile = { version = "3.20" }
54+
tempfile = { version = "3.20" }
5555

5656
[profile.release]
5757
codegen-units = 1
58-
lto = true
58+
lto = true
59+
60+
[profile.ci]
61+
# Optimize for size to keep caches small
62+
opt-level = "s"
63+
codegen-units = 1
64+
lto = true

deny.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[licenses]
2+
allow = [
3+
"Apache-2.0",
4+
"Apache-2.0 WITH LLVM-exception",
5+
"MIT",
6+
"BSD-2-Clause",
7+
"ISC",
8+
"Unicode-3.0",
9+
"Zlib",
10+
]

rust-toolchain.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[toolchain]
2+
channel = "stable"

rustfmt.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
enum_discrim_align_threshold = 60
2+
format_code_in_doc_comments = true
3+
format_macro_matchers = true
4+
format_strings = true
5+
group_imports = "StdExternalCrate"
6+
imports_granularity = "Module"
7+
normalize_comments = true
8+
reorder_impl_items = true
9+
unstable_features = true
10+
use_field_init_shorthand = true
11+
style_edition = "2024"
12+
wrap_comments = true

0 commit comments

Comments
 (0)