Skip to content

Commit

Permalink
Updates Makefile to be used with Github actions.
Browse files Browse the repository at this point in the history
Updates Makefile targets to allow using the github reusable actions.
  • Loading branch information
jvanz committed Jan 27, 2022
1 parent 98854d3 commit d44f37a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/target
policy.wasm
annotated-policy.wasm
20 changes: 13 additions & 7 deletions Makefile
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

0 comments on commit d44f37a

Please sign in to comment.