Skip to content

Commit 07fd1df

Browse files
committed
chore: run from artefact url
1 parent 5cf7a8a commit 07fd1df

File tree

2 files changed

+60
-109
lines changed

2 files changed

+60
-109
lines changed

.github/workflows/desktop-regression.yml

Lines changed: 49 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,11 @@ name: Run desktop regression tests
22
on:
33
workflow_dispatch:
44
inputs:
5-
PLAYWRIGHT_REPO:
6-
description: 'Playwright repo to checkout'
7-
required: true
8-
type: choice
9-
options:
10-
- session-foundation/session-playwright
11-
- burtonemily/session-playwright
12-
- bilb/session-playwright
13-
default: session-foundation/session-playwright
14-
15-
BRANCH_TO_CHECKOUT_PW:
16-
description: 'branch to checkout on session-playwright'
5+
DESKTOP_JOB_URL:
6+
description: 'URL of the job on session-foundation/session-desktop'
177
required: true
188
type: string
19-
default: regression-tests-groups
20-
21-
SESSION_DESKTOP_REPO:
22-
description: 'Session desktop repo to checkout'
23-
required: true
24-
type: choice
25-
options:
26-
- session-foundation/session-desktop
27-
- bilb/session-desktop
28-
- yougotwill/session-desktop
29-
default: session-foundation/session-desktop
30-
31-
BRANCH_TO_CHECKOUT_SESSION:
32-
description: 'Branch to checkout on session-desktop'
33-
required: true
34-
type: string
35-
default: dev
9+
default: https://github.com/session-foundation/session-desktop/actions/runs/15481004324
3610

3711
PLAYWRIGHT_REPEAT_COUNT:
3812
description: 'Repeats of each tests (0 to only run each once)'
@@ -50,7 +24,7 @@ on:
5024
description: 'Playwright workers to start'
5125
required: true
5226
type: number
53-
default: 8
27+
default: 1
5428

5529
concurrency:
5630
group: ${{ github.workflow }}
@@ -65,105 +39,82 @@ jobs:
6539
options: --cpus 16
6640

6741
env:
42+
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
6843
PLAYWRIGHT_REPEAT_COUNT: ${{ github.event.inputs.PLAYWRIGHT_REPEAT_COUNT }}
6944
PLAYWRIGHT_RETRIES_COUNT: ${{ github.event.inputs.PLAYWRIGHT_RETRIES_COUNT }}
7045
PLAYWRIGHT_WORKERS_COUNT: ${{ github.event.inputs.PLAYWRIGHT_WORKERS_COUNT }}
71-
DESKTOP_CACHED_FOLDER: desktop/node_modules
46+
DESKTOP_JOB_URL: ${{ github.event.inputs.DESKTOP_JOB_URL }}
47+
ARTIFACT_NAME: 'Linux-X64-AppImage-qa-production'
48+
CI: true
7249

7350
steps:
74-
- uses: actions/checkout@v4
7551
- name: Runner Details
7652
run: |
77-
echo "PLAYWRIGHT_REPO ${{ github.event.inputs.PLAYWRIGHT_REPO }}"
78-
echo "BRANCH_TO_CHECKOUT_PW ${{ github.event.inputs.BRANCH_TO_CHECKOUT_PW }}"
79-
echo "SESSION_DESKTOP_REPO ${{ github.event.inputs.SESSION_DESKTOP_REPO }}"
80-
echo "BRANCH_TO_CHECKOUT_SESSION ${{ github.event.inputs.BRANCH_TO_CHECKOUT_SESSION }}"
81-
82-
- uses: actions/checkout@v4
83-
name: 'Checkout playwright'
84-
with:
85-
repository: ${{ github.event.inputs.PLAYWRIGHT_REPO }}
86-
ref: ${{ github.event.inputs.BRANCH_TO_CHECKOUT_PW }}
87-
path: 'playwright'
53+
echo "DESKTOP_JOB_URL ${{ github.event.inputs.DESKTOP_JOB_URL }}"
54+
echo "PLAYWRIGHT_REPEAT_COUNT ${{ github.event.inputs.PLAYWRIGHT_REPEAT_COUNT }}"
55+
echo "PLAYWRIGHT_RETRIES_COUNT ${{ github.event.inputs.PLAYWRIGHT_RETRIES_COUNT }}"
56+
echo "PLAYWRIGHT_WORKERS_COUNT ${{ github.event.inputs.PLAYWRIGHT_WORKERS_COUNT }}"
8857
89-
- name: Install system deps
90-
run: apt update && apt install -y git g++ build-essential cmake
58+
- name: Install git lfs
59+
run: |
60+
apt-get update && \
61+
apt-get install -y git-lfs unzip jq && \
62+
git lfs install
9163
9264
- uses: actions/checkout@v4
93-
name: 'Checkout Session desktop'
9465
with:
95-
repository: ${{ github.event.inputs.SESSION_DESKTOP_REPO }}
96-
ref: ${{ github.event.inputs.BRANCH_TO_CHECKOUT_SESSION }}
97-
path: 'desktop'
66+
lfs: true
9867

99-
# Note: caching is breaking things up (app doesn't start)
100-
# - name: Calculate desktop cache key
101-
# run: |
102-
# echo "CACHE_KEY=${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('desktop/package.json', 'desktop/yarn.lock', 'desktop/patches/**') }}" >> $GITHUB_ENV
68+
- name: 'Download prebuilt session-desktop'
69+
run: |
70+
RUN_ID=$(echo "$DESKTOP_JOB_URL" | sed -E 's|.*/runs/([0-9]+).*|\1|')
71+
echo "Run ID: $RUN_ID"
10372
104-
- name: Install node
105-
uses: actions/setup-node@v3
106-
with:
107-
node-version-file: 'desktop/.nvmrc'
73+
response=$(curl -s -H "Authorization: Bearer $PAT_TOKEN" \
74+
-H "Accept: application/vnd.github+json" \
75+
"https://api.github.com/repos/session-foundation/session-desktop/actions/runs/$RUN_ID/artifacts")
76+
echo "response: $response"
10877
109-
- uses: actions/setup-python@v4
110-
with:
111-
python-version: '3.12'
78+
artifact_url=$(echo "$response" | jq -r \
79+
--arg name "$ARTIFACT_NAME" \
80+
'.artifacts[] | select(.name == $name) | .archive_download_url')
11281
113-
- name: Install setuptools for python 3.12
114-
shell: bash
115-
run: python -m pip install --upgrade pip setuptools
11682
117-
# Note: caching is breaking things up (app doesn't start)
118-
# - uses: actions/cache/restore@v4
119-
# id: cache-desktop-modules
120-
# with:
121-
# path: ${{ env.DESKTOP_CACHED_FOLDER }}
122-
# key: ${{ env.CACHE_KEY }}
83+
echo "Session desktop Artifact URL: $artifact_url"
12384
124-
- name: Install yarn
125-
run: |
126-
npm install -g yarn
85+
curl -L \
86+
-H "Authorization: token $PAT_TOKEN" \
87+
-H "Accept: application/vnd.github+json" \
88+
-o artifact.zip \
89+
$artifact_url
12790
128-
- name: List desktop folder
129-
run: |
130-
pwd
131-
ls -la desktop
91+
unzip artifact.zip
13292
133-
- name: List playwright folder
93+
- name: 'print files'
13494
run: |
135-
pwd
136-
ls -la playwright
137-
138-
- name: Install desktop dependencies
139-
shell: bash
140-
# if: steps.cache-desktop-modules.outputs.cache-hit != 'true'
141-
run: cd $GITHUB_WORKSPACE/desktop && yarn install --frozen-lockfile --network-timeout 600000
95+
ls -l
14296
143-
# Note: caching is breaking things up (app doesn't start)
144-
# - uses: actions/cache/save@v4
145-
# if: always()
146-
# with:
147-
# path: ${{ env.DESKTOP_CACHED_FOLDER }}
148-
# key: ${{ env.CACHE_KEY }}
97+
- name: Install node
98+
uses: actions/setup-node@v4
99+
with:
100+
node-version-file: '.nvmrc'
149101

150-
- name: Build desktop
151-
shell: bash
152-
run: cd $GITHUB_WORKSPACE/desktop && yarn build-everything
102+
- name: Install yarn
103+
run: |
104+
npm install -g yarn
153105
154-
- name: Install playwright dependencies
106+
- name: Install dependencies
155107
run: |
156-
cd $GITHUB_WORKSPACE/playwright && yarn install --frozen-lockfile
108+
yarn install --frozen-lockfile
157109
158110
- name: Build the Desktop tests
159111
run: |
160-
cd $GITHUB_WORKSPACE/playwright
112+
cd $GITHUB_WORKSPACE
161113
yarn tsc
162114
163115
- name: Run the Desktop tests
164116
run: |
165-
cd $GITHUB_WORKSPACE/playwright
166-
SESSION_DESKTOP_ROOT=$GITHUB_WORKSPACE/desktop nice ionice xvfb-run --auto-servernum --server-num=1 --server-args='-screen 0, 1920x1080x24' yarn test
117+
DEBUG="pw:*" PRINT_ONGOING_TESTS=1 SESSION_DESKTOP_ROOT=$GITHUB_WORKSPACE/desktop nice ionice xvfb-run --auto-servernum --server-num=1 --server-args='-screen 0, 1920x1080x24' yarn test
167118
# DEBUG="pw:*"
168119
169120
- name: Kill all running electron app

tests/automation/setup/open.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,20 @@ const openElectronAppOnly = async (multi: string) => {
2626
process.env.NODE_ENV = NODE_ENV;
2727
process.env.SESSION_DEBUG = '1';
2828

29-
// if (!isEmpty(process.env.CI)) {
30-
// const sessionBinPath = getSessionDesktopBinPath();
31-
// const fakeHome = `/tmp/${process.env.NODE_APP_INSTANCE}`;
29+
if (!isEmpty(process.env.CI)) {
30+
const sessionBinPath = './session-desktop-linux-x86_64-1.16.2.AppImage';
31+
const fakeHome = `/tmp/${process.env.NODE_APP_INSTANCE}`;
3232

33-
// console.info(` CI RUN`);
34-
// console.info(` SESSION_BIN_PATH=${sessionBinPath}`);
35-
// console.info(` HOME="${fakeHome}"`);
33+
console.info(` CI RUN`);
34+
console.info(` SESSION_BIN_PATH=${sessionBinPath}`);
35+
console.info(` HOME="${fakeHome}"`);
3636

37-
// process.env.HOME = fakeHome;
37+
process.env.HOME = fakeHome;
3838

39-
// return electron.launch({
40-
// executablePath: sessionBinPath,
41-
// });
42-
// }
39+
return electron.launch({
40+
executablePath: sessionBinPath,
41+
});
42+
}
4343
console.info(` NON CI RUN`);
4444
console.info(' NODE_ENV', process.env.NODE_ENV);
4545
console.info(' NODE_APP_INSTANCE', process.env.NODE_APP_INSTANCE);

0 commit comments

Comments
 (0)