Skip to content

Commit

Permalink
Provide a local feedback loop to make code changes
Browse files Browse the repository at this point in the history
  • Loading branch information
LinaKind committed Nov 29, 2024
1 parent 8212c6e commit 428cce4
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 19 deletions.
45 changes: 26 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,30 +1,37 @@
PROJECT_NAME = api-sdk-php
.PHONY: build test clean test
.PHONY: build test test-ci clean

vendor:
composer install

test: vendor
./project_tests.sh

build:
$(if $(PHP_VERSION),,$(error PHP_VERSION make variable needs to be set))
docker buildx build --build-arg=PHP_VERSION=$(PHP_VERSION) -t $(PROJECT_NAME):$(PHP_VERSION) .

lint: build
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
test-ci: build lint
docker run --rm $(PROJECT_NAME):$(PHP_VERSION) bash -c './project_tests.sh'

test-7.1:
@$(MAKE) PHP_VERSION=7.1 test
test-7.2:
@$(MAKE) PHP_VERSION=7.2 test
test-7.3:
@$(MAKE) PHP_VERSION=7.3 test
test-7.4:
@$(MAKE) PHP_VERSION=7.4 test
test-8.0:
@$(MAKE) PHP_VERSION=8.0 test
test-8.1:
@$(MAKE) PHP_VERSION=8.1 test
test-8.2:
@$(MAKE) PHP_VERSION=8.2 test
test-8.3:
@$(MAKE) PHP_VERSION=8.3 test
test-ci-7.1:
@$(MAKE) PHP_VERSION=7.1 test-ci
test-ci-7.2:
@$(MAKE) PHP_VERSION=7.2 test-ci
test-ci-7.3:
@$(MAKE) PHP_VERSION=7.3 test-ci
test-ci-7.4:
@$(MAKE) PHP_VERSION=7.4 test-ci
test-ci-8.0:
@$(MAKE) PHP_VERSION=8.0 test-ci
test-ci-8.1:
@$(MAKE) PHP_VERSION=8.1 test-ci
test-ci-8.2:
@$(MAKE) PHP_VERSION=8.2 test-ci
test-ci-8.3:
@$(MAKE) PHP_VERSION=8.3 test-ci

test-all: test-7.1 test-7.2 test-7.3 test-7.4 test-8.0 test-8.1 test-8.2 test-8.3
test-ci-all: test-ci-7.1 test-ci-7.2 test-ci-7.3 test-ci-7.4 test-ci-8.0 test-ci-8.1 test-ci-8.2 test-ci-8.3
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ Dependencies
* [Composer](https://getcomposer.org/)
* PHP 7

Running tests
-------------

To run all tests locally:
```
make test
```

Installation
------------

Expand Down

0 comments on commit 428cce4

Please sign in to comment.