Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ COPY --link --chmod=755 <<EOF /entrypoint.sh
#!/usr/bin/env sh
set -e

(test "\$GITHUB_ACTIONS" = "true" || test "\$CI" = "true") && test -f composer.json && composer install --no-scripts --no-progress --quiet
(test "\$GITHUB_ACTIONS" = "true" || test "\$CI" = "true") && (test "\$SKIP_COMPOSER_INSTALL" != "true") && test -f composer.json && composer install --no-scripts --no-progress --quiet

exec "\$@"
EOF
Expand Down
1 change: 1 addition & 0 deletions docs/cookbook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ Here you will find a list of tips & tricks that are too long to be put in the ma
- [Bitbucket Pipelines](bitbucket-pipelines.md)
- [Gitlab CI](gitlab-ci.md)
- [Starter Kits](starter-kits.md)
- [Options](options.md)
2 changes: 2 additions & 0 deletions docs/cookbook/github-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
uses: docker://jakzal/phpqa:php8.2-alpine
with:
args: php-cs-fixer --dry-run --allow-risky=yes --no-interaction --ansi fix
env:
SKIP_COMPOSER_INSTALL: true
- name: Deptrac
uses: docker://jakzal/phpqa:php8.2-alpine
with:
Expand Down
3 changes: 2 additions & 1 deletion docs/cookbook/gitlab-ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ stages:
php-cs-fixer:
stage: style
image: jakzal/phpqa:php8.2-alpine
variables:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven’t used GitLab CI for a long time but this should work: https://docs.gitlab.com/ci/variables/#define-a-cicd-variable-in-the-gitlab-ciyml-file

SKIP_COMPOSER_INSTALL: true
script:
- php-cs-fixer fix --dry-run --stop-on-violation

Expand All @@ -23,4 +25,3 @@ phpstan:
script:
- phpstan analyze
```

9 changes: 9 additions & 0 deletions docs/cookbook/options.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Options

*Contributed by [alexislefebvre](https://github.com/alexislefebvre).*

For tools that don’t require Composer dependencies, e.g. `php-cs-fixer`,
you can skip the automatic `composer install` <sup>(1)</sup>
by defining the value `SKIP_COMPOSER_INSTALL` to `true` (it’s a string).

<sup>(1)</sup> it’s configured in the [`Dockerfile`](https://github.com/jakzal/phpqa/blob/master/Dockerfile).
Loading