Skip to content

Commit

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

* Allow use of Composer lock file in some tests
  • Loading branch information
fredden committed Apr 21, 2024
1 parent 6609627 commit cd881d3
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
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ jobs:
if: ${{ matrix.phpcs_version != 'lowest' }}
run: composer require squizlabs/php_codesniffer:"${{ matrix.phpcs_version }}" --no-update --no-scripts --no-interaction

- name: "Composer: use lock file when necessary"
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
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ jobs:
if: ${{ matrix.phpcs_version != 'lowest' }}
run: composer require squizlabs/php_codesniffer:"${{ matrix.phpcs_version }}" --no-update --no-scripts --no-interaction

- name: "Composer: use lock file when necessary"
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 Expand Up @@ -133,6 +137,10 @@ jobs:
if: ${{ matrix.phpcs_version != 'lowest' }}
run: composer require squizlabs/php_codesniffer:"${{ matrix.phpcs_version }}" --no-update --no-scripts --no-interaction

- name: "Composer: use lock file when necessary"
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
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"lock": false
}
}

0 comments on commit cd881d3

Please sign in to comment.