Skip to content

Commit

Permalink
Composer: avoid writing a lock file (#1708)
Browse files Browse the repository at this point in the history
* Composer: avoid writing a lock file

* Allow creation of lock file in automated tests
  • Loading branch information
fredden committed Apr 24, 2024
1 parent 40ae925 commit f60f463
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/quicktest.yml
Expand Up @@ -63,6 +63,10 @@ jobs:
if: ${{ matrix.phpcs_version != 'lowest' }}
run: composer require squizlabs/php_codesniffer:"${{ matrix.phpcs_version }}" --no-update --no-scripts --no-interaction

- name: Enable creation of `composer.lock` file
if: ${{ matrix.phpcs_version == 'lowest' }}
run: composer config --unset lock

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
- name: Install Composer dependencies
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/test.yml
Expand Up @@ -145,6 +145,10 @@ jobs:
if: ${{ matrix.phpcs_version != 'lowest' }}
run: composer require squizlabs/php_codesniffer:"${{ matrix.phpcs_version }}" --no-update --no-scripts --no-interaction

- name: Enable creation of `composer.lock` file
if: ${{ matrix.phpcs_version == 'lowest' }}
run: composer config --unset lock

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
- name: Install Composer dependencies - normal
Expand Down Expand Up @@ -245,6 +249,10 @@ jobs:
if: ${{ matrix.phpcs_version != 'lowest' }}
run: composer require squizlabs/php_codesniffer:"${{ matrix.phpcs_version }}" --no-update --no-scripts --no-interaction

- name: Enable creation of `composer.lock` file
if: ${{ matrix.phpcs_version == 'lowest' }}
run: composer config --unset lock

- name: Install Composer dependencies
uses: "ramsey/composer-install@v3"
with:
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Expand Up @@ -48,7 +48,8 @@
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"lock": false
},
"extra": {
"branch-alias": {
Expand Down

0 comments on commit f60f463

Please sign in to comment.