Tool improvements

This commit is contained in:
Anton Vakhrushev 2019-10-14 18:11:28 +03:00
parent a7249a875a
commit b63c00cea4
6 changed files with 16 additions and 24 deletions

View File

@ -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

View File

@ -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

View File

@ -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}"

View File