|
1 |
| -name: Run android regression tests |
| 1 | +name: Run desktop regression tests |
2 | 2 | on:
|
3 | 3 | workflow_dispatch:
|
4 | 4 | inputs:
|
|
12 | 12 | - bilb/session-playwright
|
13 | 13 | default: oxen-io/session-playwright
|
14 | 14 |
|
| 15 | + BRANCH_TO_CHECKOUT_PW: |
| 16 | + description: 'branch to checkout on session-playwright' |
| 17 | + required: true |
| 18 | + type: string |
| 19 | + default: ci-desktop-regression-self-hosted |
| 20 | + |
| 21 | + SESSION_DESKTOP_REPO: |
| 22 | + description: 'Session desktop repo to checkout' |
| 23 | + required: true |
| 24 | + type: choice |
| 25 | + options: |
| 26 | + - oxen-io/session-desktop |
| 27 | + - bilb/session-desktop |
| 28 | + - yougotwill/session-desktop |
| 29 | + default: oxen-io/session-desktop |
| 30 | + |
| 31 | + BRANCH_TO_CHECKOUT_SESSION: |
| 32 | + description: 'Branch to checkout on session-desktop' |
| 33 | + required: true |
| 34 | + type: string |
| 35 | + default: unstable |
| 36 | + |
| 37 | + PLAYWRIGHT_REPEAT_COUNT: |
| 38 | + description: 'Repeats of each tests (0 to only run each once)' |
| 39 | + required: true |
| 40 | + type: number |
| 41 | + default: 0 |
| 42 | + |
| 43 | + PLAYWRIGHT_RETRIES_COUNT: |
| 44 | + description: 'Retries of each tests (0 to only run each once, 1 to run another attempt)' |
| 45 | + required: true |
| 46 | + type: number |
| 47 | + default: 0 |
| 48 | + |
| 49 | + PLAYWRIGHT_WORKER_COUNT: |
| 50 | + description: 'Playwright workers to start' |
| 51 | + required: true |
| 52 | + type: number |
| 53 | + default: 4 |
| 54 | + |
| 55 | +concurrency: |
| 56 | + group: ${{ github.workflow }} |
| 57 | + cancel-in-progress: true |
| 58 | + |
15 | 59 | jobs:
|
16 | 60 | desktop-regression:
|
17 | 61 | name: Desktop Regression Tests
|
18 | 62 | runs-on: [self-hosted, linux, x64, qa-desktop]
|
| 63 | + container: |
| 64 | + image: mcr.microsoft.com/playwright:v1.47.1-noble |
| 65 | + options: --cpus 8 |
| 66 | + |
| 67 | + env: |
| 68 | + SESSION_DESKTOP_ROOT: '$GITHUB_WORKSPACE/desktop' |
| 69 | + # PLAYWRIGHT_CUSTOM_REPORTER: 1 |
| 70 | + PLAYWRIGHT_REPEAT_COUNT: ${{ github.event.inputs.PLAYWRIGHT_REPEAT_COUNT }} |
| 71 | + PLAYWRIGHT_RETRIES_COUNT: ${{ github.event.inputs.PLAYWRIGHT_RETRIES_COUNT }} |
| 72 | + PLAYWRIGHT_WORKER_COUNT: ${{ github.event.inputs.PLAYWRIGHT_WORKER_COUNT }} |
19 | 73 |
|
20 | 74 | steps:
|
21 | 75 | - uses: actions/checkout@v4
|
| 76 | + - name: Runner Details |
| 77 | + run: | |
| 78 | + echo "SESSION_DESKTOP_ROOT ${{ env.SESSION_DESKTOP_ROOT }}" |
| 79 | + echo "PLAYWRIGHT_REPO ${{ github.event.inputs.PLAYWRIGHT_REPO }}" |
| 80 | + echo "BRANCH_TO_CHECKOUT_PW ${{ github.event.inputs.BRANCH_TO_CHECKOUT_PW }}" |
| 81 | + echo "SESSION_DESKTOP_REPO ${{ github.event.inputs.SESSION_DESKTOP_REPO }}" |
| 82 | + echo "BRANCH_TO_CHECKOUT_SESSION ${{ github.event.inputs.BRANCH_TO_CHECKOUT_SESSION }}" |
| 83 | +
|
| 84 | + - uses: actions/checkout@v4 |
| 85 | + name: 'Checkout playwright' |
| 86 | + with: |
| 87 | + repository: ${{ github.event.inputs.PLAYWRIGHT_REPO }} |
| 88 | + ref: ${{ github.event.inputs.BRANCH_TO_CHECKOUT_PW }} |
| 89 | + path: 'playwright' |
| 90 | + |
| 91 | + - name: Install system deps |
| 92 | + run: apt update && apt install -y git g++ build-essential cmake |
| 93 | + |
| 94 | + - uses: actions/checkout@v4 |
| 95 | + name: 'Checkout Session desktop' |
| 96 | + with: |
| 97 | + repository: ${{ github.event.inputs.SESSION_DESKTOP_REPO }} |
| 98 | + ref: ${{ github.event.inputs.BRANCH_TO_CHECKOUT_SESSION }} |
| 99 | + path: 'desktop' |
| 100 | + |
| 101 | + - name: Install node |
| 102 | + uses: actions/setup-node@v3 |
| 103 | + with: |
| 104 | + node-version-file: 'desktop/.nvmrc' |
| 105 | + |
| 106 | + - uses: actions/setup-python@v4 |
| 107 | + with: |
| 108 | + python-version: '3.11' |
| 109 | + |
| 110 | + - uses: actions/cache/restore@v4 |
| 111 | + id: cache-desktop-modules |
| 112 | + |
| 113 | + - name: Install yarn |
| 114 | + run: | |
| 115 | + npm install -g yarn |
| 116 | +
|
| 117 | + - name: List desktop folder |
| 118 | + run: | |
| 119 | + pwd |
| 120 | + ls -la desktop |
| 121 | +
|
| 122 | + - name: List playwright folder |
| 123 | + run: | |
| 124 | + pwd |
| 125 | + ls -la playwright |
| 126 | +
|
| 127 | + - name: Install desktop dependencies |
| 128 | + shell: bash |
| 129 | + if: steps.cache-desktop-modules.outputs.cache-hit != 'true' |
| 130 | + run: cd $GITHUB_WORKSPACE/desktop && yarn install --frozen-lockfile --network-timeout 600000 |
| 131 | + |
| 132 | + - uses: actions/cache/save@v4 |
| 133 | + if: always() |
| 134 | + with: |
| 135 | + path: node_modules |
| 136 | + key: ${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package.json', 'yarn.lock', 'patches/**') }} |
| 137 | + |
| 138 | + - name: Build desktop |
| 139 | + shell: bash |
| 140 | + run: cd $GITHUB_WORKSPACE/desktop && yarn build-everything |
| 141 | + |
| 142 | + - name: Install playwright dependencies |
| 143 | + run: | |
| 144 | + cd $GITHUB_WORKSPACE/playwright && yarn install --frozen-lockfile |
| 145 | +
|
| 146 | + - name: Build the Desktop tests |
| 147 | + run: | |
| 148 | + cd $GITHUB_WORKSPACE/playwright |
| 149 | + yarn tsc |
| 150 | +
|
| 151 | + - name: Run the Android tests |
| 152 | + run: | |
| 153 | + cd $GITHUB_WORKSPACE/playwright |
| 154 | + yarn test -g "Create User" |
| 155 | +
|
| 156 | + - name: Kill all running electron app |
| 157 | + if: always() |
| 158 | + continue-on-error: true # just so we don't fail |
| 159 | + shell: bash |
| 160 | + run: | |
| 161 | + killall electron; |
0 commit comments