Skip to content

Commit

Permalink
Add PHP 8.1/8.2 to unit testing matrix (woocommerce#8757)
Browse files Browse the repository at this point in the history
* Added PHP 8.1 to unit testing matrix

* Refactor unit testing to match Gutenberg repo 🤞

* Removed Gutenberg reference from debug information

* Updated image running phpunit binary

* Reverted image running phpunit binary

* Remove composer platform override

* Bump @wordpress/env and include phpunit

* Update phpunit and tests

* Change prefix

* Try admin context when install wc

* try wc install

* adjust phpunit config file

* Updated phpunit.xml.dist, composer.json and package.json

* Added PHP 8.1 to unit testing matrix

* Refactor unit testing to match Gutenberg repo 🤞

* Removed Gutenberg reference from debug information

* Updated image running phpunit binary

* Reverted image running phpunit binary

* Remove composer platform override

* Bump @wordpress/env and include phpunit

* Update phpunit and tests

* Change prefix

* Try admin context when install wc

* try wc install

* adjust phpunit config file

* Updated phpunit.xml.dist, composer.json and package.json

* Revert install changes

* updated npm packages

* updated composer lock

* updated check assets flow

* Updated check assets flow. Yaml file auto formatted.

* Updated check assets flow.

* Attempt at fixing E2E

* Reverted setup permissions step

* Add logging information to E2E

* Reverted E2E test flow

* test playwright perms fix

* test e2e perms fix

* test e2e perms fix

* test e2e perms fix

* test e2e perms fix

* languages update & debug

* languages update & debug

* revert

* force "@wordpress/env": "^4.9.0" on E2E

* update package lock

* update package lock

---------

Co-authored-by: Mike Jolley <[email protected]>
Co-authored-by: Niels Lange <[email protected]>
  • Loading branch information
3 people authored Apr 21, 2023
1 parent 4fce943 commit 2c45c41
Show file tree
Hide file tree
Showing 13 changed files with 755 additions and 1,113 deletions.
147 changes: 78 additions & 69 deletions .github/workflows/check-modified-assets.yml
Original file line number Diff line number Diff line change
@@ -1,82 +1,91 @@
name: Check Modified Assets

on:
pull_request:
pull_request:

jobs:
build-trunk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: trunk
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
build-trunk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: trunk

- name: Setup node version and npm cache
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-build-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Node dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci --no-optional
- name: Setup node version and npm cache
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Build Assets
run: npm run build:check-assets
- name: Install Node dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm install --no-optional --no-audit

- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: assets-list
path: ./build/assets.json
- name: Build Assets
run: npm run build:check-assets

compare-assets-with-trunk:
needs: [build-trunk]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: assets-list
path: ./build/assets.json

compare-assets-with-trunk:
needs: [ build-trunk ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-build-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Setup node version and npm cache
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Setup node version and npm cache
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Build Assets
run: npm run build:check-assets

- name: Build Assets
run: npm run build:check-assets

- name: Download assets (trunk)
uses: actions/download-artifact@v3
with:
name: assets-list
path: assets-list
- name: Compare Assets
uses: ./.github/compare-assets
id: compare-assets
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
compare: assets-list/assets.json
create-comment: false
- name: Append report
uses: ./.github/comments-aggregator
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
section-id: compare-assets-with-trunk
content: ${{steps.compare-assets.outputs.comment}}
- name: Download assets (trunk)
uses: actions/download-artifact@v3
with:
name: assets-list
path: assets-list
- name: Compare Assets
uses: ./.github/compare-assets
id: compare-assets
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
compare: assets-list/assets.json
create-comment: false
- name: Append report
uses: ./.github/comments-aggregator
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
section-id: compare-assets-with-trunk
content: ${{steps.compare-assets.outputs.comment}}
Loading

0 comments on commit 2c45c41

Please sign in to comment.