Files
trezor-suite/.github/workflows/test-suite-web-e2e-pr.yml

146 lines
4.8 KiB
YAML

name: "[Test] PR Suite Web e2e tests"
# Executed as part of PR checks
# Builds/deploys the web app to dev.suite.sldev.cz/suite-web/<branch-name>/web
# Runs e2e test suite for Suite Web, limited to webOnly tests
permissions:
id-token: write # for fetching the OIDC token
contents: read # for actions/checkout
pull-requests: write # for posting comments
# run only if there are changes in suite or related libs paths
on:
pull_request:
branches:
- develop
paths-ignore:
- "suite-native/**"
# - "packages/suite-desktop*/**"
- "packages/react-native-usb/**"
# ignore unrelated github workflows config files
- ".github/workflows/connect-examples"
- ".github/workflows/connect-mobile"
- ".github/workflows/connect-plugin-*"
- ".github/workflows/connect-theme"
- ".github/workflows/suite-native*"
- ".github/workflows/build-desktop*"
- ".github/workflows/release*"
- ".github/workflows/template*"
- ".github/actions/release*/**"
- "**.md"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
DEV_SERVER_URL: "https://dev.suite.sldev.cz"
STAGING_SUITE_SERVER_URL: "https://staging-suite.trezor.io"
jobs:
check-previous-runs:
if: github.repository == 'trezor/trezor-suite'
runs-on: ubuntu-latest
outputs:
skip_tests: ${{ steps.check-previous-runs.outputs.skip_tests }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Generate GitHub App token
id: trezor-bot-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.TREZOR_BOT_APP_ID }}
private-key: ${{ secrets.TREZOR_BOT_PRIVATE_KEY }}
- name: Check previous runs
id: check-previous-runs
uses: "./.github/actions/check-previous-test-runs"
with:
github_token: ${{ steps.trezor-bot-token.outputs.token }}
pr_branch: ${{ github.head_ref }}
pr_created: ${{ github.event.pull_request.created_at }}
repo: ${{ github.repository }}
workflow_name: ${{ github.workflow }}
run_attempt: ${{ github.run_attempt }}
build-web:
if: github.repository == 'trezor/trezor-suite'
uses: ./.github/workflows/build-suite-web-e2e.yml
extract-branch:
if: github.repository == 'trezor/trezor-suite'
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.extract_branch.outputs.branch }}
steps:
- name: Extract branch name
id: extract_branch
run: |
BRANCH_NAME="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
echo "branch=$BRANCH_NAME" >> $GITHUB_OUTPUT
build-connect:
needs: [extract-branch]
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.extract-branch.outputs.branch }}
- name: Release connect to dev environment
uses: ./.github/actions/release-connect
with:
awsRoleToAssume: "arn:aws:iam::538326561891:role/gh_actions_trezor_suite_dev_deploy"
awsRegion: "eu-central-1"
serverHostname: "dev.suite.sldev.cz"
serverPath: "connect/${{ needs.extract-branch.outputs.branch }}"
uploadArtifacts: "true"
buildArtifacts: "true"
nodeEnv: "development"
post-currents-link:
if: github.repository == 'trezor/trezor-suite' && github.event_name == 'pull_request' && needs.check-previous-runs.outputs.skip_tests != 'true'
runs-on: ubuntu-latest
needs:
- build-web
- build-connect
- check-previous-runs
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Generate GitHub App token
id: trezor-bot-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.TREZOR_BOT_APP_ID }}
private-key: ${{ secrets.TREZOR_BOT_PRIVATE_KEY }}
- name: Post Currents link
uses: ./.github/actions/post-currents-link
with:
github_token: ${{ steps.trezor-bot-token.outputs.token }}
project: "web"
currents-project-id: "Og0NOQ"
run-e2e-suite-web-tests:
if: github.repository == 'trezor/trezor-suite' && needs.check-previous-runs.outputs.skip_tests != 'true'
needs:
- build-web
- build-connect
- check-previous-runs
strategy:
fail-fast: false
matrix:
TEST_GROUP: [1, 2, 3, 4, 5]
uses: ./.github/workflows/template-suite-run-e2e.yml
with:
target: "web"
pw-config: "./playwright-config/playwright-web-pr.config.ts"
test-group: ${{ matrix.TEST_GROUP }}
fail-fast: "7"
currents-project-id: "Og0NOQ"
secrets:
currents-record-key: ${{ secrets.CURRENTS_RECORD_KEY }}
e2e-passphrase: ${{ secrets.E2E_TEST_PASSPHRASE }}