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

106 lines
3.4 KiB
YAML

name: "[Test] PR Suite Desktop e2e tests"
# Executed as part of PR checks
# Builds the desktop app
# Runs full e2e test suite for Suite Desktop
permissions:
id-token: write # for fetching the OIDC token
contents: read # for actions/checkout
pull-requests: write # for posting comments
on:
pull_request:
branches:
- develop
paths-ignore:
- "suite-native/**"
- "packages/connect*/**"
- "packages/react-native-usb/**"
# ignore unrelated github workflows config files
- ".github/workflows/connect*"
- ".github/workflows/suite-native*"
- ".github/workflows/build-desktop*"
- ".github/workflows/release*"
- ".github/workflows/template*"
- "**.md"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
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-app:
needs:
- check-previous-runs
if: github.repository == 'trezor/trezor-suite' && needs.check-previous-runs.outputs.skip_tests != 'true'
uses: ./.github/workflows/build-suite-desktop-e2e.yml
post-currents-link:
if: github.repository == 'trezor/trezor-suite' && github.event_name == 'pull_request'
runs-on: ubuntu-latest
needs:
- build-app
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: "desktop"
currents-project-id: "4ytF0E"
run-e2e-suite-desktop-tests:
if: github.repository == 'trezor/trezor-suite'
needs:
- build-app
- check-previous-runs
strategy:
fail-fast: false
matrix:
TEST_GROUP: [1, 2, 3, 4, 5, 6, 7]
uses: ./.github/workflows/template-suite-run-e2e.yml
with:
target: "desktop"
pw-config: "./playwright-config/playwright-desktop-pr.config.ts"
workspace-dependencies: "@trezor/suite-desktop"
test-group: ${{ matrix.TEST_GROUP }}
fail-fast: "7"
currents-project-id: "4ytF0E"
download-artifact-name: "desktop-app-build-e2e"
secrets:
currents-record-key: ${{ secrets.CURRENTS_RECORD_KEY }}
e2e-passphrase: ${{ secrets.E2E_TEST_PASSPHRASE }}