Skip to content

Commit

Permalink
Also run linting across PHP versions
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcmoulton committed Dec 12, 2024
1 parent bb64d7b commit 506f81b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,14 @@ jobs:
- name: Run tests
run: make PHP_VERSION=${{ matrix.php_version }} test-ci

linting:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php_version: ["7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3"]
steps:
- uses: actions/checkout@v4
- name: Run linting
run: make PHP_VERSION=${{ matrix.php_version }} lint-ci

4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,9 @@ 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-ci: build
docker run --rm $(PROJECT_NAME):$(PHP_VERSION) bash -c 'vendor/bin/phpcs --standard=phpcs.xml.dist --warning-severity=0 -p bin src tests'
docker run --rm $(PROJECT_NAME):$(PHP_VERSION) bash -c 'find src tests -name '*.php' | xargs -L1 php -l'

test-ci: build
docker run --rm $(PROJECT_NAME):$(PHP_VERSION) bash -c 'vendor/bin/phpunit'

0 comments on commit 506f81b

Please sign in to comment.