Skip to content

Commit 7f40c7b

Browse files
committed
ci: Add security_extension test job to GitHub Actions
- Add dedicated security-extension job on ubuntu-latest Runs cargo test with --features "async,sync,security_extension" covering 68 unit tests + 19 async IT + 6 sync IT - Make Makefile feature flags platform-aware The security_extension feature is Unix-only (compile_error! on other platforms), so test/check targets use --all-features on Unix and --features sync,async on Windows. Sub-crate Makefiles (compiler, ttrpc-codegen) pre-set FEATURES=--all-features since they don't have these features. Signed-off-by: Jiang Liu <gerry@linux.alibaba.com>
1 parent d9d26bf commit 7f40c7b

4 files changed

Lines changed: 25 additions & 3 deletions

File tree

.github/workflows/bvt.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ jobs:
3333
# https://github.com/actions/runner-images/issues/6668
3434
shell: bash
3535

36+
security-extension:
37+
name: Security Extension Tests
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v3
42+
- name: Run tests with security_extension
43+
run: |
44+
cargo test --features "async,sync,security_extension" --verbose
45+
3646
deny:
3747
runs-on: ubuntu-latest
3848
strategy:

Makefile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,24 @@ build: debug
1919
# Tests and linters
2020
#
2121

22+
# The `security_extension` feature is only supported on Unix platforms
23+
# (see the compile_error! in src/lib.rs), so avoid `--all-features` on
24+
# Windows. Sub-crate Makefiles (compiler, ttrpc-codegen) pre-set FEATURES
25+
# before including this file, as they don't have these features.
26+
ifeq ($(OS),Windows_NT)
27+
FEATURES ?= --features sync,async
28+
else
29+
FEATURES ?= --all-features
30+
endif
31+
2232
.PHONY: test
2333
test:
24-
cargo test --all-features --verbose
25-
34+
cargo test $(FEATURES) --verbose
35+
2636
.PHONY: check
2737
check:
2838
cargo fmt --all -- --check
29-
cargo clippy --all-targets --all-features -- -D warnings
39+
cargo clippy --all-targets $(FEATURES) -- -D warnings
3040

3141
.PHONY: check-all
3242
check-all:

compiler/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
FEATURES = --all-features
12
include ../Makefile

ttrpc-codegen/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
FEATURES = --all-features
12
include ../Makefile

0 commit comments

Comments
 (0)