Skip to content

Commit 414f789

Browse files
author
Bo Maryniuk
committed
Add workflows
1 parent 0bdae6b commit 414f789

5 files changed

Lines changed: 106 additions & 1 deletion

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Insanity Check
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
jobs:
8+
clippy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Install Rust
15+
uses: dtolnay/rust-toolchain@stable
16+
with:
17+
components: clippy
18+
19+
- name: Cache Rust build state
20+
uses: Swatinem/rust-cache@v2
21+
22+
- name: Run clippy through Makefile
23+
run: make check
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Integration Tests
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
jobs:
8+
integration:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Install Rust
15+
uses: dtolnay/rust-toolchain@stable
16+
with:
17+
components: clippy
18+
19+
- name: Install cargo-nextest
20+
uses: taiki-e/install-action@nextest
21+
22+
- name: Cache Rust build state
23+
uses: Swatinem/rust-cache@v2
24+
25+
- name: Run integration tests
26+
run: make test-integration

.github/workflows/it-is-alive.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: It is alive!
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Install Rust
15+
uses: dtolnay/rust-toolchain@stable
16+
17+
- name: Cache Rust build state
18+
uses: Swatinem/rust-cache@v2
19+
20+
- name: Build release binaries
21+
run: make

.github/workflows/unit-tests.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Unit Tests
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
jobs:
8+
unit:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Install Rust
15+
uses: dtolnay/rust-toolchain@stable
16+
with:
17+
components: clippy
18+
19+
- name: Install cargo-nextest
20+
uses: taiki-e/install-action@nextest
21+
22+
- name: Cache Rust build state
23+
uses: Swatinem/rust-cache@v2
24+
25+
- name: Run unit tests
26+
run: make test-unit

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: build dev devel check fix test test-all test-integration setup clean stats arm-devel arm x86-devel x86 setup-arm setup-x86 demo man
1+
.PHONY: build dev devel check fix test test-unit test-all test-integration setup clean stats arm-devel arm x86-devel x86 setup-arm setup-x86 demo man
22

33
DEFAULT_TARGET := build
44
ARM_TARGET ?= aarch64-unknown-linux-musl
@@ -27,6 +27,15 @@ test: setup
2727
cargo test $(CORE_WORKSPACE); \
2828
fi
2929

30+
test-unit: setup
31+
@if command -v cargo-nextest >/dev/null 2>&1; then \
32+
cargo nextest run -p logjet --lib -p logjetd --bins; \
33+
else \
34+
echo "cargo-nextest not available, falling back to cargo test unit-only targets"; \
35+
cargo test -p logjet --lib; \
36+
cargo test -p logjetd --bin logjetd; \
37+
fi
38+
3039
test-integration: setup
3140
@if command -v cargo-nextest >/dev/null 2>&1; then \
3241
cargo nextest run -p logjetd --test bridge_flows; \

0 commit comments

Comments
 (0)