This repository has been archived by the owner on Jul 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Earthfile
77 lines (67 loc) · 1.44 KB
/
Earthfile
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
VERSION 0.6
ARG version=8.0
ARG vendor=./vendor/bin
FROM php:$version-alpine
WORKDIR /codeception
ENV XDEBUG_MODE=coverage
deps:
RUN apk add git libzip-dev zip
RUN apk add --quiet --no-progress --no-cache $PHPIZE_DEPS
RUN pecl -q install xdebug
RUN docker-php-ext-enable xdebug
RUN docker-php-ext-install zip
RUN curl -sS https://getcomposer.org/installer | \
php -- --install-dir=/usr/bin --filename=composer
setup:
FROM +deps
COPY . .
RUN composer update \
--prefer-stable \
--no-progress \
--no-interaction
test:
FROM +setup
RUN $vendor/codecept run \
--no-interaction \
--coverage \
--coverage-xml \
-v
SAVE ARTIFACT tests/_output AS LOCAL ./tests/_output
mutation:
FROM +setup
RUN $vendor/infection \
--min-covered-msi=80 \
--no-progress \
--no-interaction \
--log-verbosity=all \
--threads=$(nproc)
SAVE ARTIFACT tests/_output/infection AS LOCAL ./tests/_output/infection
phpmd:
FROM +setup
RUN $vendor/phpmd \
src,tests \
ansi \
codesize,unusedcode,naming,design,controversial
phpcs:
FROM +setup
RUN $vendor/phpcs \
-p \
--colors \
src tests
phpcbf:
FROM +setup
RUN $vendor/phpcbf \
-p \
src tests \
2>&1 || true
SAVE ARTIFACT src AS LOCAL ./src
SAVE ARTIFACT tests AS LOCAL ./tests
phpstan:
FROM +setup
RUN $vendor/phpstan analyse src
all:
BUILD +phpstan
BUILD +phpcs
BUILD +phpmd
BUILD +test
BUILD +mutation