From d5fca4bec724bd5210c8e097a84c28864b4888d5 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Thu, 8 Dec 2022 22:28:13 +0100 Subject: [PATCH 1/2] GH Actions: minor simplification [1] ... of the bash `date` command in the earlier pulled cache busting. --- .github/workflows/basics.yml | 4 ++-- .github/workflows/quicktest.yml | 6 +++--- .github/workflows/test.yml | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/basics.yml b/.github/workflows/basics.yml index c3fbed4a..9392d9a8 100644 --- a/.github/workflows/basics.yml +++ b/.github/workflows/basics.yml @@ -56,8 +56,8 @@ jobs: - name: Install Composer dependencies uses: "ramsey/composer-install@v2" with: - # Bust the cache at least once a month - output format: YYYY-MM-DD. - custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F") + # Bust the cache at least once a month - output format: YYYY-MM. + custom-cache-suffix: $(date -u "+%Y-%m") - name: 'Validate XML against schema and check code style' run: ./bin/xml-lint diff --git a/.github/workflows/quicktest.yml b/.github/workflows/quicktest.yml index c86e9d1a..bab7311f 100644 --- a/.github/workflows/quicktest.yml +++ b/.github/workflows/quicktest.yml @@ -77,8 +77,8 @@ jobs: if: ${{ startsWith( matrix.php, '8' ) == false && matrix.php != 'latest' }} uses: "ramsey/composer-install@v2" with: - # Bust the cache at least once a month - output format: YYYY-MM-DD. - custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F") + # Bust the cache at least once a month - output format: YYYY-MM. + custom-cache-suffix: $(date -u "+%Y-%m") # PHPUnit 7.x does not allow for installation on PHP 8, so ignore platform # requirements to get PHPUnit 7.x to install on nightly. @@ -87,7 +87,7 @@ jobs: uses: "ramsey/composer-install@v2" with: composer-options: --ignore-platform-reqs - custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F") + custom-cache-suffix: $(date -u "+%Y-%m") - name: Display PHPCS installed standards run: ./vendor/bin/phpcs -i diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 844e15dd..6274cb91 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,8 +47,8 @@ jobs: - name: Install Composer dependencies uses: "ramsey/composer-install@v2" with: - # Bust the cache at least once a month - output format: YYYY-MM-DD. - custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F") + # Bust the cache at least once a month - output format: YYYY-MM. + custom-cache-suffix: $(date -u "+%Y-%m") - name: Lint against parse errors run: ./bin/php-lint --checkstyle | cs2pr @@ -124,8 +124,8 @@ jobs: if: ${{ startsWith( matrix.php, '8' ) == false }} uses: "ramsey/composer-install@v2" with: - # Bust the cache at least once a month - output format: YYYY-MM-DD. - custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F") + # Bust the cache at least once a month - output format: YYYY-MM. + custom-cache-suffix: $(date -u "+%Y-%m") # PHPUnit 7.x does not allow for installation on PHP 8, so ignore platform # requirements to get PHPUnit 7.x to install on nightly. @@ -134,7 +134,7 @@ jobs: uses: "ramsey/composer-install@v2" with: composer-options: --ignore-platform-reqs - custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F") + custom-cache-suffix: $(date -u "+%Y-%m") - name: Run the unit tests run: ./bin/unit-tests From 23786c8ac449b75489e8d681753a42ebd12f7626 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Tue, 22 Aug 2023 09:28:20 +0200 Subject: [PATCH 2/2] GH Actions: minor simplification [2] Removes the `experimental` key from the matrix as we can just use a plain comparison in the `continue-on-error` key. --- .github/workflows/test.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6274cb91..c0f698fd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -70,22 +70,19 @@ jobs: # - The `wpcs_version` key is added to allow additional test builds when multiple WPCS versions # would be supported. As, at this time, only the latest stable release of WPCS is supported, # no additional versions are included in the array. - # - experimental: Whether the build is "allowed to fail". matrix: php: ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2'] phpcs_version: ['3.7.1', 'dev-master'] wpcs_version: ['2.3.*'] - experimental: [false] include: - php: '8.3' phpcs_version: 'dev-master' wpcs_version: '2.3.*' - experimental: true name: "Test: PHP ${{ matrix.php }} - PHPCS ${{ matrix.phpcs_version }} - WPCS ${{ matrix.wpcs_version }}" - continue-on-error: ${{ matrix.experimental }} + continue-on-error: ${{ matrix.php == '8.3' }} steps: - name: Checkout code