@@ -2,37 +2,11 @@ name: Run desktop regression tests
22on :
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)'
5024 description : ' Playwright workers to start'
5125 required : true
5226 type : number
53- default : 8
27+ default : 1
5428
5529concurrency :
5630 group : ${{ github.workflow }}
@@ -65,105 +39,83 @@ 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 libfuse2 && \
62+ git lfs install \
63+ modprobe fuse
9164
9265 - uses : actions/checkout@v4
93- name : ' Checkout Session desktop'
9466 with :
95- repository : ${{ github.event.inputs.SESSION_DESKTOP_REPO }}
96- ref : ${{ github.event.inputs.BRANCH_TO_CHECKOUT_SESSION }}
97- path : ' desktop'
67+ lfs : true
9868
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
69+ - name : ' Download prebuilt session-desktop '
70+ run : |
71+ RUN_ID=$(echo "$DESKTOP_JOB_URL" | sed -E 's|.*/runs/([0-9]+).*|\1|')
72+ echo "Run ID: $RUN_ID"
10373
104- - name : Install node
105- uses : actions/setup-node@v3
106- with :
107- node-version-file : ' desktop/.nvmrc '
74+ response=$(curl -s -H "Authorization: Bearer $PAT_TOKEN" \
75+ -H "Accept: application/vnd.github+json" \
76+ "https://api.github.com/repos/session-foundation/session-desktop/actions/runs/$RUN_ID/artifacts")
77+ echo "response: $response"
10878
109- - uses : actions/setup-python@v4
110- with :
111- python-version : ' 3.12 '
79+ artifact_url=$(echo "$response" | jq -r \
80+ --arg name "$ARTIFACT_NAME" \
81+ '.artifacts[] | select(.name == $name) | .archive_download_url')
11282
113- - name : Install setuptools for python 3.12
114- shell : bash
115- run : python -m pip install --upgrade pip setuptools
11683
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 }}
84+ echo "Session desktop Artifact URL: $artifact_url"
12385
124- - name : Install yarn
125- run : |
126- npm install -g yarn
86+ curl -L \
87+ -H "Authorization: token $PAT_TOKEN" \
88+ -H "Accept: application/vnd.github+json" \
89+ -o artifact.zip \
90+ $artifact_url
12791
128- - name : List desktop folder
129- run : |
130- pwd
131- ls -la desktop
92+ unzip artifact.zip
13293
133- - name : List playwright folder
94+ - name : ' print files '
13495 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
96+ ls -l
14297
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 }}
98+ - name : Install node
99+ uses : actions/setup-node@v4
100+ with :
101+ node-version-file : ' .nvmrc'
149102
150- - name : Build desktop
151- shell : bash
152- run : cd $GITHUB_WORKSPACE/desktop && yarn build-everything
103+ - name : Install yarn
104+ run : |
105+ npm install -g yarn
153106
154- - name : Install playwright dependencies
107+ - name : Install dependencies
155108 run : |
156- cd $GITHUB_WORKSPACE/playwright && yarn install --frozen-lockfile
109+ yarn install --frozen-lockfile
157110
158111 - name : Build the Desktop tests
159112 run : |
160- cd $GITHUB_WORKSPACE/playwright
113+ cd $GITHUB_WORKSPACE
161114 yarn tsc
162115
163116 - name : Run the Desktop tests
164117 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
118+ 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
167119 # DEBUG="pw:*"
168120
169121 - name : Kill all running electron app
0 commit comments