diff --git a/Dockerfile b/Dockerfile index 7b9755d..c423429 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,10 @@ FROM alpine:edge as builder -RUN apk add -u make crystal shards tzdata libc-dev yaml-dev +# Install crystal and dev libs +RUN apk add -u \ + crystal \ + shards \ + make \ + tzdata \ + libc-dev \ + yaml-dev diff --git a/Makefile b/Makefile index 798f1a3..6218542 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,4 @@ +PATH := tools:$(PATH) APP_NAME := expansion ENTRY_POINT = ./src/$(APP_NAME).cr @@ -12,17 +13,20 @@ install: build-docker .PHONY: build build: mkdir -p build - ./crystal build $(ENTRY_POINT) --release --no-debug --static -o build/$(APP_NAME) + crystal build $(ENTRY_POINT) --release --no-debug --static -o build/$(APP_NAME) .PHONY: format format: - ./crystal tool format ./src ./spec + crystal tool format ./src ./spec .PHONY: run run: format - ./crystal run $(ENTRY_POINT) + crystal run $(ENTRY_POINT) .PHONY: spec spec: format - ./crystal spec --warnings all --error-on-warnings --error-trace + crystal spec --warnings all --error-on-warnings --error-trace +.PHONY: ameba +ameba: + ameba src/ || true diff --git a/spec-with-coverage b/spec-with-coverage deleted file mode 100755 index 2c6d350..0000000 --- a/spec-with-coverage +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -set -eux - -TEST_FILE=./spec_cov_entry.cr -TEST_BIN=./spec_cov_bin - -mkdir -p ./tmp - -echo "require \"./spec/**\"" > "${TEST_FILE}" - -./crystal build "${TEST_FILE}" --static --debug -o "${TEST_BIN}" - -docker run -it --security-opt seccomp=unconfined \ - -u "$(id -u):$(id -g)" \ - -v "$PWD:/app" \ - -w "/app" \ - kcov/kcov \ - kcov --clean --include-path=/app/src /app/coverage "${TEST_BIN}" diff --git a/ameba b/tools/ameba similarity index 100% rename from ameba rename to tools/ameba diff --git a/crystal b/tools/crystal similarity index 100% rename from crystal rename to tools/crystal diff --git a/shards b/tools/shards similarity index 100% rename from shards rename to tools/shards