Comment all other jobs

This commit is contained in:
rodelgc 2023-05-12 12:27:18 +08:00
parent 074c8b871a
commit 93bb793178
1 changed files with 196 additions and 199 deletions

View File

@ -16,175 +16,174 @@ concurrency:
permissions: {} permissions: {}
jobs: jobs:
api-tests: # api-tests:
name: API tests on nightly build # name: API tests on nightly build
runs-on: ubuntu-20.04 # runs-on: ubuntu-20.04
permissions: # permissions:
contents: read # contents: read
env: # env:
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/test-results/allure-results # ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/test-results/allure-results
ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/test-results/allure-report # ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/api-core-tests/test-results/allure-report
BASE_URL: ${{ secrets.SMOKE_TEST_URL }} # BASE_URL: ${{ secrets.SMOKE_TEST_URL }}
ADMIN_USER: ${{ secrets.SMOKE_TEST_ADMIN_USER }} # ADMIN_USER: ${{ secrets.SMOKE_TEST_ADMIN_USER }}
ADMIN_PASSWORD: ${{ secrets.SMOKE_TEST_ADMIN_PASSWORD }} # ADMIN_PASSWORD: ${{ secrets.SMOKE_TEST_ADMIN_PASSWORD }}
ADMIN_USER_EMAIL: ${{ secrets.SMOKE_TEST_ADMIN_USER_EMAIL }} # ADMIN_USER_EMAIL: ${{ secrets.SMOKE_TEST_ADMIN_USER_EMAIL }}
CUSTOMER_USER: ${{ secrets.SMOKE_TEST_CUSTOMER_USER }} # CUSTOMER_USER: ${{ secrets.SMOKE_TEST_CUSTOMER_USER }}
CUSTOMER_PASSWORD: ${{ secrets.SMOKE_TEST_CUSTOMER_PASSWORD }} # CUSTOMER_PASSWORD: ${{ secrets.SMOKE_TEST_CUSTOMER_PASSWORD }}
DEFAULT_TIMEOUT_OVERRIDE: 120000 # DEFAULT_TIMEOUT_OVERRIDE: 120000
steps: # steps:
- uses: actions/checkout@v3 # - uses: actions/checkout@v3
- name: Setup WooCommerce Monorepo # - name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo # uses: ./.github/actions/setup-woocommerce-monorepo
with: # with:
install-filters: woocommerce # install-filters: woocommerce
build: false # build: false
- name: Download and install Chromium browser. # - name: Download and install Chromium browser.
working-directory: plugins/woocommerce # working-directory: plugins/woocommerce
run: pnpm exec playwright install chromium # run: pnpm exec playwright install chromium
- name: Run 'Update WooCommerce' test. # - name: Run 'Update WooCommerce' test.
working-directory: plugins/woocommerce # working-directory: plugins/woocommerce
env: # env:
UPDATE_WC: nightly # UPDATE_WC: nightly
run: pnpm exec playwright test --config=tests/e2e-pw/daily.playwright.config.js update-woocommerce.spec.js # run: pnpm exec playwright test --config=tests/e2e-pw/daily.playwright.config.js update-woocommerce.spec.js
- name: Run API tests. # - name: Run API tests.
working-directory: plugins/woocommerce # working-directory: plugins/woocommerce
env: # env:
USER_KEY: ${{ secrets.SMOKE_TEST_ADMIN_USER }} # USER_KEY: ${{ secrets.SMOKE_TEST_ADMIN_USER }}
USER_SECRET: ${{ secrets.SMOKE_TEST_ADMIN_PASSWORD }} # USER_SECRET: ${{ secrets.SMOKE_TEST_ADMIN_PASSWORD }}
run: pnpm exec playwright test --config=tests/api-core-tests/playwright.config.js hello.test.js # run: pnpm exec playwright test --config=tests/api-core-tests/playwright.config.js hello.test.js
- name: Generate API Test report. # - name: Generate API Test report.
if: success() || failure() # if: success() || failure()
working-directory: plugins/woocommerce # working-directory: plugins/woocommerce
run: pnpm exec allure generate --clean ${{ env.ALLURE_RESULTS_DIR }} --output ${{ env.ALLURE_REPORT_DIR }} # run: pnpm exec allure generate --clean ${{ env.ALLURE_RESULTS_DIR }} --output ${{ env.ALLURE_REPORT_DIR }}
- name: Archive API test report # - name: Archive API test report
if: success() || failure() # if: success() || failure()
uses: actions/upload-artifact@v3 # uses: actions/upload-artifact@v3
with: # with:
name: ${{ env.API_ARTIFACT }} # name: ${{ env.API_ARTIFACT }}
path: | # path: |
${{ env.ALLURE_RESULTS_DIR }} # ${{ env.ALLURE_RESULTS_DIR }}
${{ env.ALLURE_REPORT_DIR }} # ${{ env.ALLURE_REPORT_DIR }}
if-no-files-found: ignore # if-no-files-found: ignore
retention-days: 5 # retention-days: 5
e2e-tests: # e2e-tests:
name: E2E tests on nightly build # name: E2E tests on nightly build
if: false # mytodo re-enable # runs-on: ubuntu-20.04
runs-on: ubuntu-20.04 # permissions:
permissions: # contents: read
contents: read # needs: [api-tests]
needs: [api-tests] # env:
env: # ADMIN_PASSWORD: ${{ secrets.SMOKE_TEST_ADMIN_PASSWORD }}
ADMIN_PASSWORD: ${{ secrets.SMOKE_TEST_ADMIN_PASSWORD }} # ADMIN_USER: ${{ secrets.SMOKE_TEST_ADMIN_USER }}
ADMIN_USER: ${{ secrets.SMOKE_TEST_ADMIN_USER }} # ADMIN_USER_EMAIL: ${{ secrets.SMOKE_TEST_ADMIN_USER_EMAIL }}
ADMIN_USER_EMAIL: ${{ secrets.SMOKE_TEST_ADMIN_USER_EMAIL }} # ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/test-results/allure-report
ALLURE_REPORT_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/test-results/allure-report # ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/test-results/allure-results
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/test-results/allure-results # BASE_URL: ${{ secrets.SMOKE_TEST_URL }}
BASE_URL: ${{ secrets.SMOKE_TEST_URL }} # CUSTOMER_PASSWORD: ${{ secrets.SMOKE_TEST_CUSTOMER_PASSWORD }}
CUSTOMER_PASSWORD: ${{ secrets.SMOKE_TEST_CUSTOMER_PASSWORD }} # CUSTOMER_USER: ${{ secrets.SMOKE_TEST_CUSTOMER_USER }}
CUSTOMER_USER: ${{ secrets.SMOKE_TEST_CUSTOMER_USER }} # DEFAULT_TIMEOUT_OVERRIDE: 120000
DEFAULT_TIMEOUT_OVERRIDE: 120000
steps: # steps:
- uses: actions/checkout@v3 # - uses: actions/checkout@v3
- name: Setup WooCommerce Monorepo # - name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo # uses: ./.github/actions/setup-woocommerce-monorepo
with: # with:
install-filters: woocommerce # install-filters: woocommerce
build: false # build: false
- name: Download and install Chromium browser. # - name: Download and install Chromium browser.
working-directory: plugins/woocommerce # working-directory: plugins/woocommerce
run: pnpm exec playwright install chromium # run: pnpm exec playwright install chromium
- name: Run E2E tests. # - name: Run E2E tests.
timeout-minutes: 60 # timeout-minutes: 60
working-directory: plugins/woocommerce # working-directory: plugins/woocommerce
env: # env:
E2E_MAX_FAILURES: 25 # E2E_MAX_FAILURES: 25
RESET_SITE: true # RESET_SITE: true
run: pnpm exec playwright test --config=tests/e2e-pw/playwright.config.js # run: pnpm exec playwright test --config=tests/e2e-pw/playwright.config.js
- name: Generate Playwright E2E Test report. # - name: Generate Playwright E2E Test report.
if: success() || failure() # if: success() || failure()
working-directory: plugins/woocommerce # working-directory: plugins/woocommerce
run: pnpm exec allure generate --clean ${{ env.ALLURE_RESULTS_DIR }} --output ${{ env.ALLURE_REPORT_DIR }} # run: pnpm exec allure generate --clean ${{ env.ALLURE_RESULTS_DIR }} --output ${{ env.ALLURE_REPORT_DIR }}
- name: Archive E2E test report # - name: Archive E2E test report
if: success() || failure() # if: success() || failure()
uses: actions/upload-artifact@v3 # uses: actions/upload-artifact@v3
with: # with:
name: ${{ env.E2E_ARTIFACT }} # name: ${{ env.E2E_ARTIFACT }}
path: | # path: |
${{ env.ALLURE_RESULTS_DIR }} # ${{ env.ALLURE_RESULTS_DIR }}
${{ env.ALLURE_REPORT_DIR }} # ${{ env.ALLURE_REPORT_DIR }}
if-no-files-found: ignore # if-no-files-found: ignore
retention-days: 5 # retention-days: 5
k6-tests: # k6-tests:
name: k6 tests on nightly build # name: k6 tests on nightly build
runs-on: ubuntu-20.04 # runs-on: ubuntu-20.04
permissions: # permissions:
contents: read # contents: read
needs: [api-tests] # needs: [api-tests]
# if: success() || failure() # if: success() || failure()
if: false # mytodo re-enable # steps:
steps: # - uses: actions/checkout@v3
- uses: actions/checkout@v3
- name: Setup WooCommerce Monorepo # - name: Setup WooCommerce Monorepo
uses: ./.github/actions/setup-woocommerce-monorepo # uses: ./.github/actions/setup-woocommerce-monorepo
with: # with:
install-filters: woocommerce # install-filters: woocommerce
build: false # build: false
- name: Download and install Chromium browser. # - name: Download and install Chromium browser.
working-directory: plugins/woocommerce # working-directory: plugins/woocommerce
run: pnpm exec playwright install chromium # run: pnpm exec playwright install chromium
- name: Update performance test site with E2E test # - name: Update performance test site with E2E test
working-directory: plugins/woocommerce # working-directory: plugins/woocommerce
env: # env:
BASE_URL: ${{ secrets.SMOKE_TEST_PERF_URL }}/ # BASE_URL: ${{ secrets.SMOKE_TEST_PERF_URL }}/
ADMIN_USER: ${{ secrets.SMOKE_TEST_PERF_ADMIN_USER }} # ADMIN_USER: ${{ secrets.SMOKE_TEST_PERF_ADMIN_USER }}
ADMIN_PASSWORD: ${{ secrets.SMOKE_TEST_PERF_ADMIN_PASSWORD }} # ADMIN_PASSWORD: ${{ secrets.SMOKE_TEST_PERF_ADMIN_PASSWORD }}
CUSTOMER_USER: ${{ secrets.SMOKE_TEST_PERF_ADMIN_USER }} # CUSTOMER_USER: ${{ secrets.SMOKE_TEST_PERF_ADMIN_USER }}
CUSTOMER_PASSWORD: ${{ secrets.SMOKE_TEST_PERF_ADMIN_PASSWORD }} # CUSTOMER_PASSWORD: ${{ secrets.SMOKE_TEST_PERF_ADMIN_PASSWORD }}
UPDATE_WC: nightly # UPDATE_WC: nightly
DEFAULT_TIMEOUT_OVERRIDE: 120000 # DEFAULT_TIMEOUT_OVERRIDE: 120000
run: | # run: |
pnpm exec playwright test --config=tests/e2e-pw/playwright.config.js update-woocommerce.spec.js # pnpm exec playwright test --config=tests/e2e-pw/playwright.config.js update-woocommerce.spec.js
continue-on-error: true # continue-on-error: true
- name: Install k6 # - name: Install k6
run: | # run: |
curl https://github.com/grafana/k6/releases/download/v0.33.0/k6-v0.33.0-linux-amd64.tar.gz -L | tar xvz --strip-components 1 # curl https://github.com/grafana/k6/releases/download/v0.33.0/k6-v0.33.0-linux-amd64.tar.gz -L | tar xvz --strip-components 1
- name: Run k6 smoke tests # - name: Run k6 smoke tests
env: # env:
URL: ${{ secrets.SMOKE_TEST_PERF_URL }} # URL: ${{ secrets.SMOKE_TEST_PERF_URL }}
HOST: ${{ secrets.SMOKE_TEST_PERF_HOST }} # HOST: ${{ secrets.SMOKE_TEST_PERF_HOST }}
A_USER: ${{ secrets.SMOKE_TEST_PERF_ADMIN_USER }} # A_USER: ${{ secrets.SMOKE_TEST_PERF_ADMIN_USER }}
A_PW: ${{ secrets.SMOKE_TEST_PERF_ADMIN_PASSWORD }} # A_PW: ${{ secrets.SMOKE_TEST_PERF_ADMIN_PASSWORD }}
C_USER: ${{ secrets.SMOKE_TEST_PERF_ADMIN_USER }} # C_USER: ${{ secrets.SMOKE_TEST_PERF_ADMIN_USER }}
C_PW: ${{ secrets.SMOKE_TEST_PERF_ADMIN_PASSWORD }} # C_PW: ${{ secrets.SMOKE_TEST_PERF_ADMIN_PASSWORD }}
P_ID: 22733 # P_ID: 22733
run: | # run: |
./k6 run plugins/woocommerce/tests/performance/tests/gh-action-daily-ext-requests.js # ./k6 run plugins/woocommerce/tests/performance/tests/gh-action-daily-ext-requests.js
test-plugins: test-plugins:
name: Smoke tests on trunk with ${{ matrix.plugin }} plugin installed name: Smoke tests on trunk with ${{ matrix.plugin }} plugin installed
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
permissions: permissions:
contents: read contents: read
needs: [api-tests] # mytodo uncomment
# needs: [api-tests]
env: env:
USE_WP_ENV: 1 USE_WP_ENV: 1
ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/allure-results ALLURE_RESULTS_DIR: ${{ github.workspace }}/plugins/woocommerce/tests/e2e-pw/allure-results
@ -251,63 +250,62 @@ jobs:
if-no-files-found: ignore if-no-files-found: ignore
retention-days: 5 retention-days: 5
trunk-results: # trunk-results:
name: Publish report on smoke tests on nightly build # name: Publish report on smoke tests on nightly build
# if: | # if: |
# ( success() || failure() ) && # ( success() || failure() ) &&
# ! github.event.pull_request.head.repo.fork # ! github.event.pull_request.head.repo.fork
if: false # mytodo re-enable # runs-on: ubuntu-20.04
runs-on: ubuntu-20.04 # permissions:
permissions: # contents: read
contents: read # needs: [e2e-tests, test-plugins, k6-tests]
needs: [e2e-tests, test-plugins, k6-tests] # steps:
steps: # - name: Create dirs
- name: Create dirs # run: |
run: | # mkdir -p repo
mkdir -p repo # mkdir -p artifacts/api
mkdir -p artifacts/api # mkdir -p artifacts/e2e
mkdir -p artifacts/e2e # mkdir -p output
mkdir -p output
- name: Checkout code # - name: Checkout code
uses: actions/checkout@v3 # uses: actions/checkout@v3
with: # with:
path: repo # path: repo
- name: Download API test report artifact # - name: Download API test report artifact
uses: actions/download-artifact@v3 # uses: actions/download-artifact@v3
with: # with:
name: ${{ env.API_ARTIFACT }} # name: ${{ env.API_ARTIFACT }}
path: artifacts/api # path: artifacts/api
- name: Download E2E test report artifact # - name: Download E2E test report artifact
uses: actions/download-artifact@v3 # uses: actions/download-artifact@v3
with: # with:
name: ${{ env.E2E_ARTIFACT }} # name: ${{ env.E2E_ARTIFACT }}
path: artifacts/e2e # path: artifacts/e2e
- name: Post test summary # - name: Post test summary
uses: actions/github-script@v6 # uses: actions/github-script@v6
env: # env:
API_SUMMARY_PATH: ${{ github.workspace }}/artifacts/api/allure-report/widgets/summary.json # API_SUMMARY_PATH: ${{ github.workspace }}/artifacts/api/allure-report/widgets/summary.json
E2E_PW_SUMMARY_PATH: ${{ github.workspace }}/artifacts/e2e/allure-report/widgets/summary.json # E2E_PW_SUMMARY_PATH: ${{ github.workspace }}/artifacts/e2e/allure-report/widgets/summary.json
with: # with:
result-encoding: string # result-encoding: string
script: | # script: |
const script = require( './repo/.github/workflows/scripts/prepare-test-summary-daily.js' ) # const script = require( './repo/.github/workflows/scripts/prepare-test-summary-daily.js' )
return await script( { core } ) # return await script( { core } )
- name: Publish report # - name: Publish report
env: # env:
GITHUB_TOKEN: ${{ secrets.REPORTS_TOKEN }} # GITHUB_TOKEN: ${{ secrets.REPORTS_TOKEN }}
RUN_ID: ${{ github.run_id }} # RUN_ID: ${{ github.run_id }}
run: | # run: |
gh workflow run publish-test-reports-daily.yml \ # gh workflow run publish-test-reports-daily.yml \
-f run_id=$RUN_ID \ # -f run_id=$RUN_ID \
-f api_artifact="$API_ARTIFACT" \ # -f api_artifact="$API_ARTIFACT" \
-f e2e_artifact="$E2E_ARTIFACT" \ # -f e2e_artifact="$E2E_ARTIFACT" \
-f s3_root=public \ # -f s3_root=public \
--repo woocommerce/woocommerce-test-reports # --repo woocommerce/woocommerce-test-reports
plugins-results: plugins-results:
name: Publish report on Smoke tests on trunk with plugins name: Publish report on Smoke tests on trunk with plugins
@ -315,7 +313,8 @@ jobs:
( success() || failure() ) && ( success() || failure() ) &&
! github.event.pull_request.head.repo.fork ! github.event.pull_request.head.repo.fork
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
needs: [e2e-tests, test-plugins, k6-tests] # needs: [e2e-tests, test-plugins, k6-tests]
needs: [test-plugins] # mytodo revert to the above
env: env:
GITHUB_TOKEN: ${{ secrets.REPORTS_TOKEN }} GITHUB_TOKEN: ${{ secrets.REPORTS_TOKEN }}
RUN_ID: ${{ github.run_id }} RUN_ID: ${{ github.run_id }}
@ -344,8 +343,6 @@ jobs:
with: with:
name: ${{ env.ARTIFACT }} name: ${{ env.ARTIFACT }}
# TODO: Add step to post job summary
- name: Get slug - name: Get slug
id: get-slug id: get-slug
uses: actions/github-script@v6 uses: actions/github-script@v6