Skip to content

Commit

Permalink
Make sure to test using the vendor folder in the image.
Browse files Browse the repository at this point in the history
This stops scenarios when running `make test-all` where the vendor folder gets reused
  • Loading branch information
scottaubrey committed Nov 8, 2024
1 parent 8c3ca7d commit c6cde5a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
PROJECT_NAME = api-sdk-php
.PHONY: build test clean test
build:
$(if $(PHP_VERSION),,$(error PHP_VERSION make variable needs to be set))
docker buildx build --build-arg=PHP_VERSION=$(PHP_VERSION) -t php-composer:$(PHP_VERSION) .
docker buildx build --build-arg=PHP_VERSION=$(PHP_VERSION) -t $(PROJECT_NAME):$(PHP_VERSION) .

lint: build
docker run --rm -v ./:/code -v/code/vendor php-composer:$(PHP_VERSION) bash -c 'vendor/bin/phpcs --standard=phpcs.xml.dist --warning-severity=0 -p src/ scripts/ test/ spec/'
docker run --rm $(PROJECT_NAME):$(PHP_VERSION) bash -c 'vendor/bin/phpcs --standard=phpcs.xml.dist --warning-severity=0 -p src/ scripts/ test/ spec/'

test: build lint
docker run --rm -v ./:/code -v/code/vendor php-composer:$(PHP_VERSION) bash -c './project_tests.sh'
docker run --rm $(PROJECT_NAME):$(PHP_VERSION) bash -c './project_tests.sh'

test-7.1:
@$(MAKE) PHP_VERSION=7.1 test
Expand Down

0 comments on commit c6cde5a

Please sign in to comment.