Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Comments

feat: add option to skip composer install#472

Merged
jakzal merged 1 commit intojakzal:masterfrom
alexislefebvre:feat-add-option-to-skip-composer-install
Dec 23, 2025
Merged

feat: add option to skip composer install#472
jakzal merged 1 commit intojakzal:masterfrom
alexislefebvre:feat-add-option-to-skip-composer-install

Conversation

@alexislefebvre
Copy link
Contributor

@alexislefebvre alexislefebvre commented Dec 18, 2025

I’m currently testing Gitea Actions and the fastest way I found to run php-cs-fixer is to run it without dependencies. (the syntax of Gitea Actions is based on GitHub Actions so it may look familiar)

    php-cs-fixer:
        name: 🧹 PHP-CS-Fixer
        runs-on: ubuntu-latest

        steps:
            -   name: Checkout
                uses: https://github.com/actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

            -   name: ✅ PHP-CS-Fixer
                uses: docker://jakzal/phpqa:1.116.0-php8.4-alpine
                with:
                    args: php-cs-fixer --config=./.qa/.php-cs-fixer.dist.php --dry-run --diff --no-interaction --ansi --show-progress=none fix
                env:
                    CI: false

I rely on this line to skip composer install:

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

But I don’t like having to write GITHUB_ACTIONS since it’s a Gitea Actions (it may also be a GitLab CI job), and writing CI looks weird since this is still a CI job.

So I propose to add an env var to skip it with an explicit name.


Proof that php-cs-fixer works without dependencies

$ git clone [email protected]:liip/LiipTestFixturesBundle.git
$ cd LiipTestFixturesBundle/
$ docker run --rm -it --volume .:/app --workdir /app jakzal/phpqa:1.116.2-php8.4-alpine php-cs-fixer \
--config=./.qa/.php-cs-fixer.dist.php --dry-run --diff --no-interaction --ansi --show-progress=none fix
…

PHP CS Fixer 3.92.0 (7b15cb5) Exceptional Exception by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 8.4.15
Loaded config default from "./.qa/.php-cs-fixer.dist.php".
Running analysis on 1 core sequentially.
You can enable parallel runner and speed up the analysis! Please see usage docs for more information.
Using cache file ".php-cs-fixer.cache".

Found 0 of 64 files that can be fixed in 0.002 seconds, 11.34 MB memory used

@alexislefebvre alexislefebvre force-pushed the feat-add-option-to-skip-composer-install branch from 1dac49e to 17bc459 Compare December 20, 2025 16:10
@alexislefebvre alexislefebvre force-pushed the feat-add-option-to-skip-composer-install branch from 17bc459 to 9f97b88 Compare December 23, 2025 16:43
@alexislefebvre alexislefebvre force-pushed the feat-add-option-to-skip-composer-install branch from 9f97b88 to e9f1dbd Compare December 23, 2025 16:47
@jakzal jakzal merged commit d9ae78b into jakzal:master Dec 23, 2025
9 checks passed
@jakzal
Copy link
Owner

jakzal commented Dec 23, 2025

Thank you @alexislefebvre 🍺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants