Verify Milo Changes #1338
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Verify Milo Changes | |
on: | |
workflow_dispatch: | |
inputs: | |
testCodeBranch: | |
description: 'Test Code Branch' | |
required: true | |
default: 'stage' | |
type: string | |
miloBranch: | |
description: 'Milo Branch' | |
required: true | |
default: 'main' | |
type: string | |
jobs: | |
run-stage-tests: | |
if: ${{ github.event.inputs.miloBranch == 'stage' }} | |
name: Trigger Stage CircleCI Job | |
runs-on: [self-hosted, Linux, X64] | |
steps: | |
- name: Trigger CircleCI Job | |
run: | | |
curl -X POST 'https://circle.ci.adobe.com/api/v2/project/gh/wcms/Platform-UI-DC/pipeline' \ | |
-H 'Circle-Token: ${{ secrets.CCI_TOKEN }}' \ | |
-H 'content-type: application/json' \ | |
-d "{\"branch\":\"main\", \ | |
\"parameters\":{ \ | |
\"env\":\"stage\", \ | |
\"dcbranch\":\"stage\", \ | |
\"milobranch\":\"stage\" \ | |
} \ | |
}" | |
- name: Trigger Jenkins Job | |
run: | | |
curl -X POST 'https://dc.ci.corp.adobe.com/job/DC%20Release%20-%20Run%20Nala/buildWithParameters?token=${{ secrets.JNK_JOB_TOKEN }}&branch=stage' \ | |
-u '${{ secrets.JNK_USER }}:${{ secrets.JNK_API_TOKEN }}' | |
run-prod-tests: | |
if: ${{ github.event.inputs.miloBranch == 'main' }} | |
name: Trigger Prod CircleCI Job | |
runs-on: [self-hosted, Linux, X64] | |
steps: | |
- name: Trigger CircleCI Job | |
run: | | |
curl -X POST 'https://circle.ci.adobe.com/api/v2/project/gh/wcms/Platform-UI-DC/pipeline' \ | |
-H 'Circle-Token: ${{ secrets.CCI_TOKEN }}' \ | |
-H 'content-type: application/json' \ | |
-d "{\"branch\":\"main\", \ | |
\"parameters\":{ \ | |
\"env\":\"prod\", \ | |
\"dcbranch\":\"main\" \ | |
} \ | |
}" | |
- name: Trigger Jenkins Job | |
run: | | |
curl -X POST 'https://dc.ci.corp.adobe.com/job/DC%20Release%20-%20Run%20Nala/buildWithParameters?token=${{ secrets.JNK_JOB_TOKEN }}&branch=main' \ | |
-u '${{ secrets.JNK_USER }}:${{ secrets.JNK_API_TOKEN }}' | |
run-prod-tests-gha: | |
if: ${{ github.event.inputs.miloBranch == 'main' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
include: | |
- os: ubuntu-latest | |
browser: firefox | |
- os: windows-latest | |
browser: chromium | |
- os: macos-latest | |
browser: webkit | |
name: Smoke Test | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ inputs.testCodeBranch }} | |
- name: Cache dependencies | |
id: cache | |
uses: actions/cache@v3 | |
with: | |
path: ./node_modules | |
key: modules-${{ hashFiles('package-lock.json') }}-${{ runner.os }} | |
- name: Install dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: npm ci --ignore-scripts | |
- name: Install browsers | |
run: npx playwright install --with-deps ${{ matrix.browser }} | |
- name: Run the tests | |
run: npx run test/e2e -t "@smoke and (not (@analytics or @extension-installed))" -h -p prod -b ${{ matrix.browser }} --bypassBotDetection | |
env: | |
USER_AGENT_SUFFIX: "${{ secrets.USER_AGENT_SUFFIX }}" | |
- name: Save test logs | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: reports | |
path: reports/ | |
run-integration-tests: | |
name: Integration Tests | |
runs-on: macos-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ inputs.testCodeBranch }} | |
- name: Cache dependencies | |
id: cache | |
uses: actions/cache@v3 | |
with: | |
path: ./node_modules | |
key: modules-${{ hashFiles('package-lock.json') }}-${{ runner.os }} | |
- name: Install dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: npm ci --ignore-scripts | |
- name: Install browsers | |
run: npx playwright install | |
- name: Run the tests | |
run: npm run int | |
env: | |
MILOLIBS: ${{ github.event.inputs.miloBranch }} | |
- name: Save test logs | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: screenshots | |
path: | | |
test/integration/*/screenshots/**/*.test.png | |
test/integration/*/screenshots/**/*.diff.png |