-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates Makefile to be used with Github actions.
Updates Makefile targets to allow using the github reusable actions.
- Loading branch information
Showing
2 changed files
with
15 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
/target | ||
policy.wasm | ||
annotated-policy.wasm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,29 @@ | ||
.PHONY: build | ||
build: | ||
SOURCE_FILES := $(shell test -e src/ && find src -type f) | ||
|
||
policy.wasm: $(SOURCE_FILES) Cargo.* | ||
cargo build --target=wasm32-unknown-unknown --release | ||
mv target/wasm32-unknown-unknown/release/*.wasm policy.wasm | ||
|
||
annotated-policy.wasm: policy.wasm metadata.yml | ||
kwctl annotate -m metadata.yml -o annotated-policy.wasm policy.wasm | ||
|
||
.PHONY: fmt | ||
fmt: | ||
cargo fmt --all -- | ||
cargo fmt --all -- --check | ||
|
||
.PHONY: lint | ||
lint: | ||
cargo clippy -- -D warnings | ||
|
||
.PHONY: e2e-tests | ||
e2e-tests: annotated-policy.wasm | ||
@echo "Dummy target to allow using the reusable github actions to build, test and release policies" | ||
|
||
.PHONY: test | ||
test: fmt lint | ||
cargo test | ||
|
||
.PHONY: clean | ||
clean: | ||
cargo clean | ||
|
||
.PHONY: e2e-tests | ||
e2e-tests: | ||
@echo "Dummy target to allow using the reusable github actions to build, test and release policies" | ||
rm -f policy.wasm annotated-policy.wasm |