From cd881d335cc475cc46edf7d65a324607915f3da7 Mon Sep 17 00:00:00 2001 From: Dan Wallis Date: Sun, 21 Apr 2024 19:24:34 +0100 Subject: [PATCH] Composer: avoid writing a lock file (#307) * Composer: avoid writing a lock file * Allow use of Composer lock file in some tests --- .github/workflows/quicktest.yml | 4 ++++ .github/workflows/test.yml | 8 ++++++++ composer.json | 3 ++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/quicktest.yml b/.github/workflows/quicktest.yml index 76000742..11d15306 100644 --- a/.github/workflows/quicktest.yml +++ b/.github/workflows/quicktest.yml @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 45f68d44..c8d0ba01 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 @@ -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 diff --git a/composer.json b/composer.json index 92122571..28617b0d 100644 --- a/composer.json +++ b/composer.json @@ -64,6 +64,7 @@ "config": { "allow-plugins": { "dealerdirect/phpcodesniffer-composer-installer": true - } + }, + "lock": false } }