Update OSDK testing behaviors in the Makefile and the CI

This commit is contained in:
Zhang Junyang 2024-08-25 19:31:32 +08:00 committed by Tate, Hongliang Tian
parent d91573248c
commit d809a26a2f
2 changed files with 18 additions and 12 deletions

View File

@ -40,10 +40,7 @@ jobs:
# So the RUSTUP_HOME needs to be set here.
- name: Unit test
id: unit_test
run: |
cd osdk
RUSTUP_HOME=/root/.rustup cargo build
RUSTUP_HOME=/root/.rustup cargo test
run: RUSTUP_HOME=/root/.rustup make test_osdk
osdk-test-tdx:
if: github.event_name == 'schedule'
@ -74,7 +71,4 @@ jobs:
# So the RUSTUP_HOME needs to be set here.
- name: Unit test
id: unit_test
run: |
cd osdk
RUSTUP_HOME=/root/.rustup INTEL_TDX=1 cargo build
RUSTUP_HOME=/root/.rustup INTEL_TDX=1 cargo test
run: RUSTUP_HOME=/root/.rustup INTEL_TDX=1 make test_osdk

View File

@ -140,6 +140,16 @@ install_osdk:
$(CARGO_OSDK):
@make --no-print-directory install_osdk
.PHONY: check_osdk
check_osdk:
@cd osdk && cargo clippy -- -D warnings
.PHONY: test_osdk
test_osdk:
@cd osdk && \
OSDK_LOCAL_DEV=1 cargo build && \
OSDK_LOCAL_DEV=1 cargo test
.PHONY: initramfs
initramfs:
@make --no-print-directory -C test
@ -230,13 +240,15 @@ check: initramfs $(CARGO_OSDK)
done
@make --no-print-directory -C test check
.PHONY: check_osdk
check_osdk:
@cd osdk && cargo clippy -- -D warnings
.PHONY: clean
clean:
@echo "Cleaning up Asterinas workspace target files"
@cargo clean
@echo "Cleaning up OSDK workspace target files"
@cd osdk && cargo clean
@echo "Cleaning up documentation target files"
@cd docs && mdbook clean
@echo "Cleaning up test target files"
@make --no-print-directory -C test clean
@echo "Uninstalling OSDK"
@rm -f $(CARGO_OSDK)