Skip to content

Commit

Permalink
ci: fix attestation-agent CI coverage
Browse files Browse the repository at this point in the history
This commit adds a Makefile option `lint` for attestation-agent to test
the lint of all sub projects of AA. Before this patch, some ttrpc codes
are not covered by CI.

Signed-off-by: Xynnn007 <[email protected]>
  • Loading branch information
Xynnn007 committed Oct 8, 2024
1 parent a196dd5 commit e0b5a56
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/aa_basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,10 @@ jobs:
include:
- instance: ubuntu-22.04
make_args: ""
cargo_test_opts: "--features openssl,rust-crypto,all-attesters,kbs,coco_as"
cargo_lint_opts: "--workspace"
cargo_test_opts: "--features openssl,rust-crypto,all-attesters,kbs,coco_as,ttrpc,grpc"
- instance: s390x
make_args: "ATTESTER=se-attester TEE_PLATFORM=se"
cargo_test_opts: "--no-default-features --features openssl,passport,se-attester,kbs,coco_as"
cargo_lint_opts: "--no-default-features --features openssl,se-attester,kbs,coco_as -p attestation-agent -p attester -p coco_keyprovider -p kbc -p kbs_protocol -p crypto -p resource_uri"
runs-on: ${{ matrix.instance }}
steps:
- name: Code checkout
Expand Down Expand Up @@ -109,8 +107,5 @@ jobs:
args: --all -- --check

- name: Run rust lint check
uses: actions-rs/cargo@v1
with:
command: clippy
# We are getting error in generated code due to derive_partial_eq_without_eq check, so ignore it for now
args: ${{ matrix.cargo_lint_opts }} -- -D warnings -A clippy::derive-partial-eq-without-eq
run: |
make lint
14 changes: 14 additions & 0 deletions attestation-agent/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,26 @@ else
features := $(features),rust-crypto
endif

ifeq ($(ARCH), s390x)
LINT_OPTION = lint-s390x
else
LINT_OPTION = lint-default
endif

build:
cd attestation-agent && $(RUST_FLAGS) cargo build $(release) --no-default-features --features "$(features)" $(binary) $(LIBC_FLAG)
mv $(TARGET_DIR)/$(binary_name) $(TARGET)

TARGET := $(TARGET_DIR)/$(BIN_NAME)

lint: $(LINT_OPTION)

lint-default:
cd attestation-agent && cargo clippy --features kbs,coco_as,bin,grpc,ttrpc,all-attesters

lint-s390x:
cd attestation-agent && cargo clippy --no-default-features --features openssl,kbs,coco_as,bin,grpc,ttrpc

install:
install -D -m0755 $(TARGET) $(DESTDIR)/$(BIN_NAME)

Expand Down

0 comments on commit e0b5a56

Please sign in to comment.