Skip to content

Commit

Permalink
add travis docker cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Andru Cherny committed Jun 7, 2021
1 parent 4b109ac commit 018f515
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
6 changes: 0 additions & 6 deletions .make/static-analysis.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ coding-standards: ## run check and validate code standards tests
coding-standards-fixer: ## run code standards fixer
docker-compose run --rm --no-deps php sh -lc './vendor/bin/ecs check src tests --fix'

tests-unit: ## Run unit-tests suite
docker-compose run --rm --no-deps php sh -lc 'vendor/bin/phpunit --configuration /app/phpunit.xml.dist'

tests-integration: ## Run integration-tests suite
docker-compose run --rm --no-deps php sh -lc 'vendor/bin/phpunit --configuration /app/phpunit.func.xml'

.PHONY: infection
infection: ## executes mutation framework infection
docker-compose run --rm --no-deps php-fpm sh -lc './vendor/bin/infection --min-msi=70 --min-covered-msi=80 --threads=$(JOBS) --coverage=var/report'
Expand Down
21 changes: 13 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
dist: xenial
sudo: true
#cache:
# - directories:
# - /var/lib/docker
#env:
# global:
# - DOCKER_SERVER_HOST=docker.local
# - DOCKER_PROJECT_PATH=components/base
# - TEST_CONFIG="phpunit.xml.dist"

cache:
directories:
- docker_images

before_install:
- docker load -i docker_images/images.tar || true

before_cache:
- docker save -o docker_images/images.tar $(docker images -a -q)

install:
- export DOCKER_UID=`id -u`
- export DOCKER_GID=`id -g`
- export DOCKER_IMAGE_VERSION=`echo $TRAVIS_BRANCH | tr "[:upper:]" "[:lower:]" | sed "s/[^a-zA-Z0-9-]/-/g" | sed "s/-$//g" | tr -d '\n' | tr -d '\r'`
- make build
- make composer-install

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: "3.7"
services:
php:
container_name: ${ADGBASE_COMPOSE_PROJECT_NAME}_php
user: 1000:1000
user: ${DOCKER_UID:-1000}:${DOCKER_GID:-1000}
build:
context: .docker/php7.2-dev
volumes:
Expand Down

0 comments on commit 018f515

Please sign in to comment.