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

View File

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

View File

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

View File

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