-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (44 loc) · 1.3 KB
/
Makefile
File metadata and controls
57 lines (44 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
BINDIR ?= $(HOME)/bin
OPA_BASE_CAPS_VERSION ?= v1.13.1
.PHONY: all
all: fmt lint test build
.PHONY: fmt
fmt:
swift format format --parallel --recursive -i .
.PHONY: lint
lint:
swift format lint --strict --parallel --recursive .
.PHONY: test
test:
mkdir -p .build/test-results
swift test --xunit-output .build/test-results/junit.xml
.PHONY: test-compliance
test-compliance:
$(MAKE) -C ComplianceSuite test-compliance
.PHONY: perf
perf:
cd Benchmarks && swift package benchmark
.PHONY: build
build:
swift build
.PHONY: build-release
build-release:
swift build -c release
.PHONY: ensure-bindir
ensure-bindir:
ifeq ($(shell test -d "$(BINDIR)"; echo $$?),1)
$(error BINDIR "$(BINDIR)" does not exist.)
endif
.PHONY: install-release
install-release: build-release ensure-bindir
install $(shell swift build --show-bin-path -c release)/swift-opa-cli $(BINDIR)/
.PHONY: generate
generate:
curl -o opa-capabilities.json https://raw.githubusercontent.com/open-policy-agent/opa/refs/tags/$(OPA_BASE_CAPS_VERSION)/capabilities.json
swift run swift-opa-cli capabilities opa-capabilities.json > capabilities.json
.PHONY: clean
clean:
rm -rf .build
.PHONY: generate-compliance-tests
generate-compliance-tests:
cd tools/generate-compliance-tests && go run main.go ../../ComplianceSuite/Tests/RegoComplianceTests/TestData/v1