-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (35 loc) · 1.26 KB
/
Makefile
File metadata and controls
47 lines (35 loc) · 1.26 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
VERSION ?= local
COMMIT ?= $(shell git rev-parse --short HEAD)
BUILDTIME := $(shell date -u '+%Y-%m-%dT%H:%M:%SZ')
GOLDFLAGS += -X main.Version=$(VERSION)
GOLDFLAGS += -X main.Buildtime=$(BUILDTIME)
GOLDFLAGS += -X main.Commit=$(COMMIT)
GOFLAGS = -ldflags "$(GOLDFLAGS)"
BINARY_NAME ?= shimmy
CONTAINER_ENGINE ?= docker
.PHONY: all build test test-unit test-sandbox lcov install generate-mocks update-schema
all: build
build:
go build -o ./bin/$(BINARY_NAME) -trimpath -buildvcs=false $(GOFLAGS) .
test: test-unit
test-unit:
go test -covermode=count -coverprofile=coverage.out ./...
# Run sandbox integration tests inside a privileged container.
# Supports Docker (default) and Podman: CONTAINER_ENGINE=podman make test-sandbox
# On Linux with nsjail installed locally, use:
# go test -v -run 'TestSandboxedWorker' ./internal/execution/worker/...
test-sandbox:
$(CONTAINER_ENGINE) build --target test-sandbox -t shimmy-test-sandbox .
$(CONTAINER_ENGINE) run --rm --privileged \
-v $(shell pwd):/workspace \
-w /workspace \
shimmy-test-sandbox \
go test -v -run 'TestSandboxedWorker' ./internal/execution/worker/...
lcov:
gcov2lcov -infile=coverage.out -outfile=lcov.info
install:
go install
generate-mocks:
mockery
update-schema:
scripts/update-schema.sh