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 f5f9e9e commit 68292a7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
11 changes: 9 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
*.wasm
target
/target
policy.wasm
annotated-policy.wasm

# Added by cargo
#
# already existing elements were commented out

#/target
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
HYPERFINE := $(shell command -v hyperfine 2> /dev/null)
SOURCE_FILES := $(shell test -e src/ && find src -type f)

.PHONY: build
build:
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: registry
registry:
Expand All @@ -20,6 +24,9 @@ fmt:
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
Expand All @@ -28,3 +35,4 @@ test: fmt lint
.PHONY: clean
clean:
cargo clean
rm -f policy.wasm annotated-policy.wasm

0 comments on commit 68292a7

Please sign in to comment.