2021-04-01 20:17:34 +00:00
|
|
|
name: Smoke test daily
|
|
|
|
on:
|
2022-04-08 00:19:25 +00:00
|
|
|
schedule:
|
|
|
|
- cron: '25 3 * * *'
|
2021-04-01 20:17:34 +00:00
|
|
|
jobs:
|
2022-04-08 00:19:25 +00:00
|
|
|
login-run:
|
|
|
|
name: Daily smoke test on trunk.
|
2022-04-27 01:28:56 +00:00
|
|
|
runs-on: ubuntu-20.04
|
2022-04-08 00:19:25 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout code.
|
2022-04-21 18:46:30 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-04-08 00:19:25 +00:00
|
|
|
with:
|
|
|
|
ref: trunk
|
2021-04-01 20:17:34 +00:00
|
|
|
|
2022-05-12 13:34:55 +00:00
|
|
|
- name: Cache modules
|
2022-05-02 23:48:20 +00:00
|
|
|
uses: actions/cache@v3
|
|
|
|
id: cache-deps
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.pnpm-store
|
|
|
|
plugins/woocommerce/packages
|
|
|
|
plugins/woocommerce/**/vendor
|
2022-05-12 13:34:55 +00:00
|
|
|
key: ${{ runner.os }}-npm-composer-smoke-version-${{ secrets.WORKFLOW_CACHE }}-${{ hashFiles('**/composer.lock', '**/pnpm-lock.yaml') }}
|
2022-05-02 23:48:20 +00:00
|
|
|
|
2022-04-27 13:40:37 +00:00
|
|
|
- name: Install PNPM
|
2022-05-02 17:08:52 +00:00
|
|
|
run: npm install -g pnpm@^6.24.2
|
2022-04-27 13:40:37 +00:00
|
|
|
|
2022-05-12 13:34:55 +00:00
|
|
|
- name: Install Jest
|
|
|
|
run: pnpm install -g jest
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: pnpm install
|
|
|
|
|
|
|
|
- name: Install Composer dependencies
|
|
|
|
if: steps.cache-deps.outputs.cache-hit != 'true'
|
|
|
|
run: pnpm nx composer-install-no-dev woocommerce
|
|
|
|
|
2022-05-02 23:48:20 +00:00
|
|
|
- name: Setup PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
php-version: '7.4'
|
|
|
|
|
2022-05-12 13:34:55 +00:00
|
|
|
- name: Run build
|
|
|
|
run: pnpm nx build woocommerce
|
2021-12-09 21:07:13 +00:00
|
|
|
|
2022-05-12 13:34:55 +00:00
|
|
|
- name: Run smoke test.
|
|
|
|
working-directory: plugins/woocommerce
|
2022-04-08 00:19:25 +00:00
|
|
|
env:
|
2022-05-12 13:34:55 +00:00
|
|
|
SMOKE_TEST_URL: ${{ secrets.RELEASE_TEST_URL }}
|
|
|
|
SMOKE_TEST_ADMIN_USER: ${{ secrets.RELEASE_TEST_ADMIN_USER }}
|
|
|
|
SMOKE_TEST_ADMIN_PASSWORD: ${{ secrets.RELEASE_TEST_ADMIN_PASSWORD }}
|
|
|
|
SMOKE_TEST_ADMIN_USER_EMAIL: ${{ secrets.RELEASE_TEST_ADMIN_USER_EMAIL }}
|
|
|
|
SMOKE_TEST_CUSTOMER_USER: ${{ secrets.RELEASE_TEST_CUSTOMER_USER }}
|
|
|
|
SMOKE_TEST_CUSTOMER_PASSWORD: ${{ secrets.RELEASE_TEST_CUSTOMER_PASSWORD }}
|
|
|
|
WC_E2E_SCREENSHOTS: 1
|
|
|
|
E2E_RETEST: 1
|
|
|
|
E2E_SLACK_TOKEN: ${{ secrets.SMOKE_TEST_SLACK_TOKEN }}
|
|
|
|
E2E_SLACK_CHANNEL: 'C02DS4NE72S'
|
|
|
|
TEST_RELEASE: 1
|
|
|
|
UPDATE_WC: 1
|
|
|
|
DEFAULT_TIMEOUT_OVERRIDE: 120000
|
|
|
|
BASE_URL: ${{ secrets.RELEASE_TEST_URL }}
|
|
|
|
USER_KEY: ${{ secrets.RELEASE_TEST_ADMIN_USER }}
|
|
|
|
USER_SECRET: ${{ secrets.RELEASE_TEST_ADMIN_PASSWORD }}
|
|
|
|
run: |
|
|
|
|
pnpm exec wc-e2e docker:up
|
|
|
|
pnpm exec wc-e2e test:e2e tests/e2e/specs/smoke-tests/update-woocommerce.js
|
|
|
|
pnpm exec wc-e2e test:e2e
|
|
|
|
pnpm exec wc-api-tests test api
|
|
|
|
|
|
|
|
build:
|
|
|
|
name: Build zip for PR
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- name: Checkout code.
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Cache modules
|
|
|
|
uses: actions/cache@v3
|
|
|
|
id: cache-deps
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.pnpm-store
|
|
|
|
key: ${{ runner.os }}-npm-smoke-version-${{ secrets.WORKFLOW_CACHE }}-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
|
|
|
|
|
|
- name: Install PNPM
|
|
|
|
run: npm install -g pnpm@^6.24.2
|
|
|
|
|
|
|
|
- name: Setup PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
php-version: '7.4'
|
|
|
|
|
|
|
|
- name: Build zip
|
|
|
|
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
|
|
|
|
retention-days: 7
|
2021-12-09 21:07:13 +00:00
|
|
|
|
2022-04-08 00:19:25 +00:00
|
|
|
test-plugins:
|
|
|
|
name: Smoke tests with ${{ matrix.plugin }} plugin installed
|
2022-04-27 01:28:56 +00:00
|
|
|
runs-on: ubuntu-20.04
|
2022-04-08 00:19:25 +00:00
|
|
|
needs: [build]
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- plugin: 'WooCommerce Payments'
|
|
|
|
repo: 'automattic/woocommerce-payments'
|
|
|
|
- plugin: 'WooCommerce PayPal Payments'
|
|
|
|
repo: 'woocommerce/woocommerce-paypal-payments'
|
|
|
|
- plugin: 'WooCommerce Shipping & Tax'
|
|
|
|
repo: 'automattic/woocommerce-services'
|
|
|
|
- plugin: 'WooCommerce Subscriptions'
|
|
|
|
repo: WC_SUBSCRIPTIONS_REPO
|
|
|
|
private: true
|
|
|
|
- plugin: 'WordPress SEO' # Yoast SEO in the UI, but the slug is wordpress-seo
|
|
|
|
repo: 'Yoast/wordpress-seo'
|
|
|
|
- plugin: 'Contact Form 7'
|
|
|
|
repo: 'takayukister/contact-form-7'
|
|
|
|
steps:
|
|
|
|
- name: Create dirs.
|
|
|
|
run: |
|
|
|
|
mkdir -p package/woocommerce
|
|
|
|
mkdir -p tmp/woocommerce
|
2021-12-09 21:07:13 +00:00
|
|
|
|
2022-04-08 00:19:25 +00:00
|
|
|
- name: Checkout code.
|
2022-04-27 13:40:37 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-04-08 00:19:25 +00:00
|
|
|
with:
|
|
|
|
path: package/woocommerce
|
2021-12-09 21:07:13 +00:00
|
|
|
|
2022-05-12 13:34:55 +00:00
|
|
|
- name: Cache modules
|
|
|
|
uses: actions/cache@v3
|
|
|
|
id: cache-deps
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.pnpm-store
|
|
|
|
key: ${{ runner.os }}-npm-smoke-version-${{ secrets.WORKFLOW_CACHE }}-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
|
|
|
|
|
|
- name: Install PNPM
|
|
|
|
run: npm install -g pnpm@^6.24.2
|
|
|
|
|
|
|
|
- name: Install dependencies
|
2022-04-08 00:19:25 +00:00
|
|
|
working-directory: package/woocommerce
|
2022-05-12 13:34:55 +00:00
|
|
|
run: pnpm install
|
2021-12-09 21:07:13 +00:00
|
|
|
|
2022-05-12 13:34:55 +00:00
|
|
|
- name: Setup PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
php-version: '7.4'
|
2021-12-09 21:07:13 +00:00
|
|
|
|
2022-05-12 13:34:55 +00:00
|
|
|
- name: Run build
|
|
|
|
working-directory: package/woocommerce
|
|
|
|
run: pnpm nx build woocommerce
|
2021-12-09 21:07:13 +00:00
|
|
|
|
2022-04-08 00:19:25 +00:00
|
|
|
- name: Download WooCommerce ZIP.
|
2022-04-21 18:46:30 +00:00
|
|
|
uses: actions/download-artifact@v3
|
2022-04-08 00:19:25 +00:00
|
|
|
with:
|
|
|
|
name: woocommerce
|
|
|
|
path: tmp
|
2021-12-09 21:07:13 +00:00
|
|
|
|
2022-04-08 00:19:25 +00:00
|
|
|
- name: Extract and replace WooCommerce zip.
|
|
|
|
working-directory: tmp
|
|
|
|
run: |
|
|
|
|
unzip woocommerce.zip -d woocommerce
|
2022-05-12 13:34:55 +00:00
|
|
|
rsync -a woocommerce/woocommerce/* ../package/woocommerce/plugins/woocommerce/
|
2021-12-09 21:07:13 +00:00
|
|
|
|
2022-05-12 13:34:55 +00:00
|
|
|
- name: Load docker images and start containers.
|
2022-04-08 00:19:25 +00:00
|
|
|
working-directory: package/woocommerce
|
2022-05-12 13:34:55 +00:00
|
|
|
run: pnpm nx docker-up woocommerce
|
2022-04-08 00:19:25 +00:00
|
|
|
|
|
|
|
- name: Run tests command.
|
|
|
|
working-directory: package/woocommerce/plugins/woocommerce
|
|
|
|
env:
|
|
|
|
WC_E2E_SCREENSHOTS: 1
|
|
|
|
E2E_SLACK_TOKEN: ${{ secrets.SMOKE_TEST_SLACK_TOKEN }}
|
|
|
|
E2E_SLACK_CHANNEL: ${{ secrets.RELEASE_TEST_SLACK_CHANNEL }}
|
|
|
|
PLUGIN_REPOSITORY: ${{ matrix.private && secrets[matrix.repo] || matrix.repo }}
|
|
|
|
PLUGIN_NAME: ${{ matrix.plugin }}
|
|
|
|
GITHUB_TOKEN: ${{ secrets.E2E_GH_TOKEN }}
|
|
|
|
run: |
|
|
|
|
pnpm exec wc-e2e test:e2e tests/e2e/specs/smoke-tests/upload-plugin.js
|
|
|
|
pnpm exec wc-e2e test:e2e
|