Skip to content

Commit 17a93a6

Browse files
committed
add justfile
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
1 parent c401582 commit 17a93a6

4 files changed

Lines changed: 36 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
- uses: actions/checkout@v4
2323
- uses: actions-rust-lang/setup-rust-toolchain@v1
2424
- uses: Swatinem/rust-cache@v2
25+
- uses: extractions/setup-just@v3
2526
- name: Enable kvm
2627
if: runner.os == 'Linux'
2728
run: |
@@ -30,14 +31,13 @@ jobs:
3031
sudo udevadm trigger --name-match=kvm
3132
- name: Install cargo-hyperlight
3233
shell: bash
33-
run: cargo install cargo-hyperlight --path .
34+
run: just install
3435
- name: Build guest example
3536
shell: bash
36-
run: |
37-
cargo hyperlight build --manifest-path examples/guest/Cargo.toml
37+
run: just build-guest
3838
- name: Run example
3939
shell: bash
40-
run: cargo run --manifest-path examples/host/Cargo.toml -- examples/guest/target/x86_64-hyperlight-none/debug/guest
40+
run: just run-guest
4141

4242
spelling:
4343
name: Spell check with typos
@@ -63,7 +63,7 @@ jobs:
6363
run: rustup toolchain install nightly --component rustfmt # needed to run rustfmt in nightly toolchain
6464
- name: Check formatting
6565
shell: bash
66-
run: cargo +nightly fmt -- --check
66+
run: just fmt
6767
- name: Check clippy
6868
shell: bash
69-
run: cargo clippy -- -D warnings
69+
run: just clippy

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
/target
2-
/examples/*/target
2+
/examples/*/target

justfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
export CARGO_TARGET_DIR := justfile_dir() / "target"
2+
3+
install:
4+
cargo install cargo-hyperlight --path .
5+
6+
fmt:
7+
cargo +nightly fmt --all -- --check
8+
cargo +nightly fmt --all --manifest-path ./examples/host/Cargo.toml -- --check
9+
cargo +nightly fmt --all --manifest-path ./examples/guest/Cargo.toml -- --check
10+
11+
fmt-apply:
12+
cargo +nightly fmt --all
13+
cargo +nightly fmt --all --manifest-path ./examples/host/Cargo.toml
14+
cargo +nightly fmt --all --manifest-path ./examples/guest/Cargo.toml
15+
16+
clippy:
17+
cargo clippy --all -- -D warnings
18+
cargo clippy --all --manifest-path ./examples/host/Cargo.toml -- -D warnings
19+
cargo hyperlight clippy --all --manifest-path ./examples/guest/Cargo.toml -- -D warnings
20+
21+
build-guest:
22+
cargo hyperlight build --manifest-path ./examples/guest/Cargo.toml
23+
24+
run-guest: build-guest
25+
cargo run --manifest-path ./examples/host/Cargo.toml -- ./target/x86_64-hyperlight-none/debug/guest

rust-toolchain.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[toolchain]
2+
channel = "1.89.0"
3+
profile = "default"
4+
components = ["rustfmt", "clippy"]

0 commit comments

Comments
 (0)