[Snyk] Security upgrade react-native from 0.69.4 to 0.72.0 #18
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: End-to-End Tests | |
on: | |
pull_request: | |
push: | |
branches: | |
- trunk | |
- 'release/**' | |
- 'wp/**' | |
# Cancels all previous workflow runs for pull requests that have not completed. | |
concurrency: | |
# The concurrency group contains the workflow name and the branch name for pull requests | |
# or the commit hash for any other events. | |
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
e2e-puppeteer: | |
name: Puppeteer - ${{ matrix.part }} | |
runs-on: ubuntu-latest | |
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
part: [1, 2, 3, 4] | |
totalParts: [4] | |
steps: | |
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 | |
- name: Use desired version of NodeJS | |
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 | |
with: | |
node-version-file: '.nvmrc' | |
cache: npm | |
- name: Npm install and build | |
run: | | |
npm ci | |
npm run build | |
- name: Install WordPress | |
run: | | |
npm run wp-env start | |
- name: Running the tests | |
run: | | |
$( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --listTests > ~/.jest-e2e-tests | |
$( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % ${{ matrix.totalParts }} == ${{ matrix.part }} - 1' < ~/.jest-e2e-tests ) | |
- name: Archive debug artifacts (screenshots, HTML snapshots) | |
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 | |
if: always() | |
with: | |
name: failures-artifacts | |
path: artifacts | |
if-no-files-found: ignore | |
- name: Archive flaky tests report | |
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 | |
if: always() | |
with: | |
name: flaky-tests-report | |
path: flaky-tests | |
if-no-files-found: ignore | |
e2e-playwright: | |
name: Playwright - ${{ matrix.part }} | |
runs-on: ubuntu-latest | |
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
part: [1, 2] | |
totalParts: [2] | |
steps: | |
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 | |
- name: Use desired version of NodeJS | |
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 | |
with: | |
node-version-file: '.nvmrc' | |
cache: npm | |
- name: Npm install and build | |
run: | | |
npm ci | |
npm run build | |
- name: Install Playwright dependencies | |
run: | | |
npx playwright install chromium firefox webkit --with-deps | |
- name: Install WordPress and start the server | |
run: | | |
npm run wp-env start | |
- name: Run the tests | |
run: | | |
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test:e2e:playwright -- --shard=${{ matrix.part }}/${{ matrix.totalParts }} | |
- name: Archive debug artifacts (screenshots, traces) | |
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 | |
if: always() | |
with: | |
name: failures-artifacts | |
path: artifacts/test-results | |
if-no-files-found: ignore | |
- name: Archive flaky tests report | |
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 | |
if: always() | |
with: | |
name: flaky-tests-report | |
path: flaky-tests | |
if-no-files-found: ignore | |
report-to-issues: | |
name: Report to GitHub | |
needs: [e2e-puppeteer, e2e-playwright] | |
if: ${{ always() }} | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout defaults to using the branch which triggered the event, which | |
# isn't necessarily `trunk` (e.g. in the case of a merge). | |
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 | |
with: | |
ref: trunk | |
- uses: actions/download-artifact@v3 | |
id: download_artifact | |
# Don't fail the job if there isn't any flaky tests report. | |
continue-on-error: true | |
with: | |
name: flaky-tests-report | |
path: flaky-tests | |
- name: Use desired version of NodeJS | |
if: ${{ steps.download_artifact.outcome == 'success' }} | |
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 | |
with: | |
node-version-file: '.nvmrc' | |
cache: npm | |
- name: Npm install and build | |
if: ${{ steps.download_artifact.outcome == 'success' }} | |
# TODO: We don't have to build the entire project, just the action itself. | |
run: | | |
npm ci | |
npm run build:packages | |
- name: Report flaky tests | |
if: ${{ steps.download_artifact.outcome == 'success' }} | |
uses: ./packages/report-flaky-tests | |
with: | |
repo-token: '${{ secrets.GITHUB_TOKEN }}' | |
label: '[Type] Flaky Test' | |
artifact-path: flaky-tests |