chore: update monorepo tokens #4458
Workflow file for this run
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: Integration tests | |
env: | |
CI: true | |
WALLET_ENVIRONMENT: testing | |
on: | |
push: | |
branches: | |
- gh-readonly-queue/dev/** | |
pull_request: | |
branches: | |
- dev | |
jobs: | |
test: | |
name: Shard ${{ matrix.shardIndex }} of ${{ matrix.shardTotal }} | |
timeout-minutes: 30 | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8] | |
shardTotal: [8] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/provision | |
- name: Get installed Playwright version | |
id: playwright-version | |
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package.json').devDependencies['@playwright/test'])")" >> $GITHUB_ENV | |
- uses: actions/cache@v3 | |
id: cache | |
with: | |
path: '**/node_modules' | |
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }}-${{ env.PLAYWRIGHT_VERSION }}-force | |
- name: Install dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
env: | |
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | |
run: yarn --frozen-lockfile | |
- name: Cache playwright binaries | |
uses: actions/cache@v3 | |
id: playwright-cache | |
with: | |
path: ~/.cache/ms-playwright | |
key: ${{ runner.os }}-playwright-cache-${{ env.PLAYWRIGHT_VERSION }} | |
- name: Install Playwright browsers | |
run: yarn playwright install chrome chromium | |
if: steps.playwright-cache.outputs.cache-hit != 'true' | |
- name: Install Playwright deps | |
run: yarn playwright install --with-deps | |
if: steps.playwright-cache.outputs.cache-hit != 'true' | |
- name: Build extension in test mode | |
run: yarn build:test | |
- name: Extract branch name | |
shell: bash | |
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT | |
id: extract_branch | |
# Playwright can only test extensions in headed mode, see | |
# https://playwright.dev/docs/chrome-extensions. To run a browser in | |
# headed mode, a display server is necessary. However, this job runs on | |
# an Ubuntu worker without a display server. | |
# | |
# The `xvfb-run` utility, | |
# https://manpages.ubuntu.com/manpages/xenial/man1/xvfb-run.1.html, | |
# provides a virtual X display server to the process it runs, allowing | |
# processes that require a display server to run in environments where | |
# one is not available. | |
- name: Run Playwright tests | |
run: xvfb-run yarn playwright test tests/specs --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --workers=1 | |
env: | |
BRANCH_NAME: ${{ steps.extract_branch.outputs.branch }} | |
TEST_ACCOUNT_SECRET_KEY: ${{ secrets.TEST_ACCOUNT_SECRET_KEY }} | |
- name: Upload blob report to GitHub Actions Artifacts | |
if: always() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: all-blob-reports | |
path: blob-report | |
retention-days: 1 | |
if-no-files-found: error | |
merge-reports: | |
name: Merge reports | |
if: always() | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
- name: Install dependencies | |
run: yarn --frozen-lockfile | |
- name: Download blob reports from GitHub Actions Artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: all-blob-reports | |
path: all-blob-reports | |
- name: Merge into HTML Report | |
run: npx playwright merge-reports --reporter html ./all-blob-reports | |
- name: Extract branch name | |
shell: bash | |
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT | |
id: extract_branch | |
- name: Deploy PR | |
uses: peaceiris/actions-gh-pages@v3 | |
if: github.event_name == 'pull_request' | |
with: | |
personal_token: ${{ secrets.SEMANTIC_RELEASE_TOKEN }} | |
external_repository: leather-wallet/playwright-reports | |
publish_branch: main | |
publish_dir: ./playwright-report | |
destination_dir: ${{ steps.extract_branch.outputs.branch }} | |
- name: Deploy specs.leather.io | |
uses: peaceiris/actions-gh-pages@v3 | |
if: steps.extract_branch.outputs.branch == 'dev' | |
with: | |
personal_token: ${{ secrets.SEMANTIC_RELEASE_TOKEN }} | |
external_repository: leather-wallet/specs.leather.io | |
publish_branch: main | |
publish_dir: ./playwright-report | |
cname: specs.leather.io |