From 3a3d19dd32d420f7a8be4e7a94215fedc6d6edb7 Mon Sep 17 00:00:00 2001 From: Jake Jackson Date: Fri, 17 Nov 2023 10:00:31 +1100 Subject: [PATCH 1/3] Update GitHub Actions versions --- .github/workflows/coding-standards.yml | 21 ++++++++------------- .github/workflows/deployment.yml | 4 ++-- .github/workflows/javascript-tests.yml | 19 +++++++------------ .github/workflows/phpunit.tests.yml | 19 +++++++------------ 4 files changed, 24 insertions(+), 39 deletions(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index 6e2eaa639..b764c75cc 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -67,26 +67,21 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup Node JS - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version-file: '.nvmrc' - name: Cache node modules - id: cache-nodemodules - uses: actions/cache@v2 - env: - cache-name: cache-node-modules + uses: actions/cache@v3 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) with: - # caching node_modules - path: node_modules - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- + ${{ runner.os }}-yarn- - name: Log debug information run: | diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 2c4ffb39c..0211fc791 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -25,7 +25,7 @@ jobs: uses: dawidd6/action-get-tag@v1 - name: Setup Node JS - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version-file: '.nvmrc' diff --git a/.github/workflows/javascript-tests.yml b/.github/workflows/javascript-tests.yml index 2243b2bb1..28977ca35 100644 --- a/.github/workflows/javascript-tests.yml +++ b/.github/workflows/javascript-tests.yml @@ -25,26 +25,21 @@ jobs: access_token: ${{ github.token }} - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup Node JS - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version-file: '.nvmrc' - name: Cache node modules - id: cache-nodemodules - uses: actions/cache@v2 - env: - cache-name: cache-node-modules + uses: actions/cache@v3 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) with: - # caching node_modules - path: node_modules - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- + ${{ runner.os }}-yarn- - name: Log debug information run: | diff --git a/.github/workflows/phpunit.tests.yml b/.github/workflows/phpunit.tests.yml index a876ba5e7..29f62cbfe 100644 --- a/.github/workflows/phpunit.tests.yml +++ b/.github/workflows/phpunit.tests.yml @@ -69,7 +69,7 @@ jobs: echo "PHP_FPM_GID=$(id -g)" >> $GITHUB_ENV - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 # Docs: https://github.com/shivammathur/setup-php - name: Setup PHP @@ -80,23 +80,18 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Setup Node JS - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version-file: '.nvmrc' - name: Cache node modules - id: cache-nodemodules - uses: actions/cache@v2 - env: - cache-name: cache-node-modules + uses: actions/cache@v3 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) with: - # caching node_modules - path: node_modules - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- - ${{ runner.os }}- + ${{ runner.os }}-yarn- - name: Log debug information run: | From c45416e281960930c42383cd972aa3e34e915411 Mon Sep 17 00:00:00 2001 From: Jake Jackson Date: Fri, 17 Nov 2023 10:07:54 +1100 Subject: [PATCH 2/3] Add missing cache directory path --- .github/workflows/coding-standards.yml | 4 ++++ .github/workflows/javascript-tests.yml | 4 ++++ .github/workflows/phpunit.tests.yml | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index b764c75cc..ee9c05312 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -74,6 +74,10 @@ jobs: with: node-version-file: '.nvmrc' + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT + - name: Cache node modules uses: actions/cache@v3 id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) diff --git a/.github/workflows/javascript-tests.yml b/.github/workflows/javascript-tests.yml index 28977ca35..1e80390be 100644 --- a/.github/workflows/javascript-tests.yml +++ b/.github/workflows/javascript-tests.yml @@ -32,6 +32,10 @@ jobs: with: node-version-file: '.nvmrc' + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT + - name: Cache node modules uses: actions/cache@v3 id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) diff --git a/.github/workflows/phpunit.tests.yml b/.github/workflows/phpunit.tests.yml index 29f62cbfe..b478aadfb 100644 --- a/.github/workflows/phpunit.tests.yml +++ b/.github/workflows/phpunit.tests.yml @@ -84,6 +84,10 @@ jobs: with: node-version-file: '.nvmrc' + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT + - name: Cache node modules uses: actions/cache@v3 id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) From 3a07d5c2f292bcca6cc25d79081588a84e635dac Mon Sep 17 00:00:00 2001 From: Jake Jackson Date: Fri, 17 Nov 2023 10:20:20 +1100 Subject: [PATCH 3/3] Upgrade cancel action --- .github/workflows/end-to-end-tests.yml | 2 +- .github/workflows/javascript-tests.yml | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/end-to-end-tests.yml b/.github/workflows/end-to-end-tests.yml index d090aa808..e8e727f1c 100644 --- a/.github/workflows/end-to-end-tests.yml +++ b/.github/workflows/end-to-end-tests.yml @@ -36,7 +36,7 @@ jobs: steps: - name: Cancel previous runs of this workflow (pull requests only) if: ${{ github.event_name == 'pull_request' }} - uses: styfle/cancel-workflow-action@0.11.0 + uses: styfle/cancel-workflow-action@0.12.0 - name: Configure environment variables run: | diff --git a/.github/workflows/javascript-tests.yml b/.github/workflows/javascript-tests.yml index 1e80390be..4e288ae37 100644 --- a/.github/workflows/javascript-tests.yml +++ b/.github/workflows/javascript-tests.yml @@ -18,12 +18,6 @@ jobs: name: JavaScript Test runs-on: ubuntu-latest steps: - - name: Cancel previous runs of this workflow (pull requests only) - if: ${{ github.event_name == 'pull_request' }} - uses: styfle/cancel-workflow-action@0.5.0 - with: - access_token: ${{ github.token }} - - name: Checkout repository uses: actions/checkout@v3