Merge pull request #33119 from woocommerce/fix/smoke-tests2

Add paths input for install build workflow
This commit is contained in:
Roy Ho 2022-05-20 06:35:11 -07:00 committed by GitHub
commit 46aa6800f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 22 deletions

View File

@ -1,21 +1,30 @@
name: Install and Build (Composite)
description: Installs and builds WooCommerce.
inputs:
working_directory:
required: false
description: The directory to target.
default: ./
runs:
using: "composite"
steps:
- name: Install PNPM
shell: bash
working-directory: ${{ inputs.working_directory }}
run: npm install -g pnpm@^6.24.2
- name: Install dependencies
shell: bash
working-directory: ${{ inputs.working_directory }}
run: pnpm install
- name: Install Composer dependencies
shell: bash
working-directory: ${{ inputs.working_directory }}
run: pnpm nx composer-install-no-dev woocommerce
- name: Run build
shell: bash
working-directory: ${{ inputs.working_directory }}
run: pnpm nx build woocommerce

View File

@ -46,7 +46,6 @@ jobs:
steps:
- name: Create directories
run: |
mkdir -p tmp/woocommerce-build
mkdir -p monorepo
- name: Checkout monorepo

View File

@ -22,9 +22,6 @@ jobs:
workflow_name: smoke-test-daily
workflow_cache: ${{ secrets.WORKFLOW_CACHE }}
- name: Install Jest
run: pnpm install -g jest
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
@ -33,6 +30,9 @@ jobs:
- name: Install and Build
uses: ./.github/actions/install-build
- name: Install Jest
run: npm install -g jest
- name: Run smoke test.
working-directory: plugins/woocommerce
env:
@ -91,16 +91,13 @@ jobs:
working-directory: plugins/woocommerce
run: bash bin/build-zip.sh
- name: Unzip the file (prevents double zip problem)
run: unzip plugins/woocommerce/woocommerce.zip -d zipfile
- name: Upload the zip file as an artifact
uses: actions/upload-artifact@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: woocommerce
path: zipfile
path: plugins/woocommerce/woocommerce.zip
retention-days: 7
test-plugins:
@ -134,7 +131,7 @@ jobs:
with:
path: package/woocommerce
- uses: ./.github/actions/cache-deps
- uses: ./package/woocommerce/.github/actions/cache-deps
with:
workflow_name: smoke-test-daily
workflow_cache: ${{ secrets.WORKFLOW_CACHE }}
@ -145,8 +142,9 @@ jobs:
php-version: '7.4'
- name: Install and Build
working-directory: package/woocommerce
uses: ./.github/actions/install-build
uses: ./package/woocommerce/.github/actions/install-build
with:
working_directory: package/woocommerce
- name: Download WooCommerce ZIP.
uses: actions/download-artifact@v3
@ -157,8 +155,8 @@ jobs:
- name: Extract and replace WooCommerce zip.
working-directory: tmp
run: |
unzip woocommerce.zip -d woocommerce
rsync -a woocommerce/woocommerce/* ../package/woocommerce/plugins/woocommerce/
unzip woocommerce.zip -d .
rsync -a woocommerce/* ../package/woocommerce/plugins/woocommerce/
- name: Load docker images and start containers.
working-directory: package/woocommerce

View File

@ -19,9 +19,6 @@ jobs:
workflow_name: smoke-test-release
workflow_cache: ${{ secrets.WORKFLOW_CACHE }}
- name: Install Jest
run: pnpm install -g jest
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
@ -30,6 +27,9 @@ jobs:
- name: Install and Build
uses: ./.github/actions/install-build
- name: Install Jest
run: npm install -g jest
- name: Run smoke test.
working-directory: plugins/woocommerce
env:
@ -70,7 +70,7 @@ jobs:
with:
path: package/woocommerce
- uses: ./.github/actions/cache-deps
- uses: ./package/woocommerce/.github/actions/cache-deps
with:
workflow_name: smoke-test-release
workflow_cache: ${{ secrets.WORKFLOW_CACHE }}
@ -93,8 +93,9 @@ jobs:
php-version: '7.4'
- name: Install and Build
working-directory: package/woocommerce
uses: ./.github/actions/install-build
uses: ./package/woocommerce/.github/actions/install-build
with:
working_directory: package/woocommerce
- name: Download WooCommerce release zip
working-directory: tmp
@ -148,7 +149,7 @@ jobs:
with:
path: package/woocommerce
- uses: ./.github/actions/cache-deps
- uses: ./package/woocommerce/.github/actions/cache-deps
with:
workflow_name: smoke-test-release
workflow_cache: ${{ secrets.WORKFLOW_CACHE }}
@ -171,8 +172,9 @@ jobs:
php-version: '7.4'
- name: Install and Build
working-directory: package/woocommerce
uses: ./.github/actions/install-build
uses: ./package/woocommerce/.github/actions/install-build
with:
working_directory: package/woocommerce
- name: Download WooCommerce release zip
working-directory: tmp