Skip to content

Commit e4d842c

Browse files
committed
justfile to ease usual commands and workflows
1 parent 50c7c2c commit e4d842c

5 files changed

Lines changed: 73 additions & 23 deletions

File tree

.github/workflows/clippy.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,13 @@ jobs:
1717
steps:
1818
- uses: actions/checkout@v6
1919

20+
- name: Install system dependencies
21+
run: |
22+
sudo apt update
23+
sudo apt install just
24+
2025
- name: Update rust
2126
run: rustup update
2227

2328
- name: Run clippy
24-
run: cargo clippy --all-targets --all-features --workspace
29+
run: just clippy

.github/workflows/doc.yml

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,24 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v6
13-
- uses: actions/setup-python@v4
14-
- name: Prepare
15-
run: pip install sphinx sphinx_rtd_theme
16-
- name: Build
17-
run: sphinx-build doc doc/_build
18-
- name: Deploy
19-
uses: JamesIves/github-pages-deploy-action@v4
20-
with:
21-
branch: gh-pages
22-
folder: doc/_build
23-
clean: true
24-
token: ${{ secrets.GITHUB_TOKEN }}
12+
- uses: actions/checkout@v6
13+
- uses: actions/setup-python@v4
14+
15+
- name: Install system dependencies
16+
run: |
17+
sudo apt update
18+
sudo apt install just
19+
20+
- name: Prepare
21+
run: pip install sphinx sphinx_rtd_theme
22+
23+
- name: Build
24+
run: just doc
25+
26+
- name: Deploy
27+
uses: JamesIves/github-pages-deploy-action@v4
28+
with:
29+
branch: gh-pages
30+
folder: doc/_build
31+
clean: true
32+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,24 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@v6
2121

22+
- name: Install system dependencies
23+
run: |
24+
sudo apt update
25+
sudo apt install just
26+
2227
- name: Update rust
2328
run: rustup update
2429

2530
- name: Build release
26-
run: cargo build --release
31+
run: just release
2732

2833
- name: Gather artifacts
2934
run: |
3035
mkdir -p artifacts/release/
3136
cp target/release/lidi-{receive,send} artifacts/release/
3237
cp target/release/lidi-{flood,oneshot}-{receive,send} artifacts/release/
3338
cp target/release/lidi-{receive,send}-{file,udp} artifacts/release/
39+
cp target/release/lidi-network-simulator artifacts/release/
3440
cp target/release/liblidi_bindings.so artifacts/release/
3541
3642
- name: Upload release artifacts

.github/workflows/tests.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,14 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v6
2020

21+
- name: Install system dependencies
22+
run: |
23+
sudo apt update
24+
sudo apt install python3-pip python3-virtualenv libfuse2t64 just
25+
2126
- name: Update rust
2227
run: rustup update
2328

24-
- name: Run cargo tests
25-
run: cargo test
26-
27-
- name: Install system dependencies
28-
run: sudo apt install python3-pip python3-virtualenv libfuse2t64
29-
3029
- name: Create virtualenv
3130
run: virtualenv venv
3231

@@ -35,7 +34,8 @@ jobs:
3534
source venv/bin/activate
3635
pip install behave fusepy psutil
3736
38-
- name: Run simple integration tests
37+
- name: Run tests
3938
run: |
4039
source venv/bin/activate
41-
behave --tags=~fail features/simple.feature
40+
just test
41+

justfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
release:
2+
cargo build --release
3+
4+
release_tcp_mmsg:
5+
cargo build --release --no-default-features --features from-tcp,to-tcp,tcp,receive-mmsg,send-mmsg,tcp
6+
7+
release_tls_native:
8+
cargo build --release --no-default-features --features from-tls,to-tls,tls,receive-native,send-native
9+
10+
clean:
11+
cargo clean
12+
13+
fmt:
14+
cargo +nightly fmt
15+
16+
check:
17+
cargo check --all-targets --all-features
18+
19+
clippy:
20+
cargo clippy --all-targets --all-features
21+
22+
bench:
23+
cargo bench --all-features
24+
25+
test:
26+
#behave features/*.feature
27+
behave --tags=~fail features/simple.feature
28+
29+
doc:
30+
sphinx-build doc doc/_build
31+

0 commit comments

Comments
 (0)