-
Notifications
You must be signed in to change notification settings - Fork 119
129 lines (113 loc) · 3.65 KB
/
wasm_tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: WebAssembly Tests
on:
push:
branches:
- main
- "releases/**"
pull_request:
branches:
- main
- "releases/**"
# Restrict tests to the most recent commit.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
wasmQt6:
name: Wasm Qt6
runs-on: ubuntu-20.04
outputs:
matrix: ${{ steps.testGen.outputs.tests }}
env:
QTVERSION: 6.2.4
steps:
- name: Clone repository
uses: actions/checkout@v3
with:
submodules: 'true'
- name: Install build dependencies
shell: bash
run: |
pip3 install -r requirements.txt
- name: Install Qt6
shell: bash
run: |
python3 -m pip install aqtinstall
# qt6.2.3 for wasm needs the desktop linux installation
python3 -m aqt install-qt -O /opt linux desktop $QTVERSION
python3 -m aqt install-qt -O /opt linux desktop $QTVERSION wasm_32 -m qtcharts qtwebsockets qt5compat
- name: Setup emsdk
uses: mymindstorm/setup-emsdk@v7
- name: Compile test client
shell: bash
run: |
export PATH=/opt/$QTVERSION/wasm_32/bin:/opt/$QTVERSION/gcc_64/bin:$PATH
mkdir -p build/cmake
/opt/$QTVERSION/wasm_32/bin/qt-cmake -S $(pwd) -B build/cmake -DCMAKE_BUILD_TYPE=Release \
-DQT_HOST_PATH_CMAKE_DIR=/opt/$QTVERSION/gcc_64/lib/cmake \
-DQT_HOST_PATH=/opt/$QTVERSION/gcc_64
cmake --build build/cmake -j4
cp -r build/cmake/wasm_build build/wasm_build
- uses: actions/upload-artifact@v3
with:
name: WebAssembly Build Qt6
path: |
build/
!build/cmake/
- name: Compile test addons
shell: bash
run: |
mkdir -p build/addons
cmake -S $(pwd)/tests/functional/addons -B build/addons \
-DCMAKE_PREFIX_PATH=/opt/$QTVERSION/gcc_64/lib/cmake
cmake --build build/addons
- name: Generate tasklist
id: testGen
shell: bash
run: |
echo -n "tests=" >> $GITHUB_OUTPUT
for test in $(find tests/functional -name 'test*.js' | sort); do
printf '{"name": "%s", "path": "%s"}' $(basename ${test%.js} | sed -n 's/test//p') $test
done | jq -s -c >> $GITHUB_OUTPUT
- name: Check tests
shell: bash
env:
TEST_LIST: ${{ steps.testGen.outputs.tests }}
run: |
echo $TEST_LIST | jq
functionaltests:
name: Functional tests
needs:
- wasmQt6
runs-on: ubuntu-20.04
timeout-minutes: 45
strategy:
fail-fast: false # Don't cancel other jobs if a test fails
matrix:
test: ${{ fromJson(needs.wasmQt6.outputs.matrix) }}
env:
QTVERSION: 6.2.4
steps:
- name: Clone repository
uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: WebAssembly Build Qt6
path: build/
- name: Install test dependecies
run: |
sudo apt install --no-upgrade firefox xvfb -y
pip3 install -r requirements.txt
npm install
- name: Running ${{ matrix.test.name }} Tests
id: runTests
uses: nick-invision/retry@v2
with:
timeout_minutes: 15
max_attempts: 3
command: |
export PATH=$GECKOWEBDRIVER:$(npm bin):$PATH
export HEADLESS=yes
export WASM_BUILD_DIRECTORY=$(pwd)/build/wasm_build
export MVPN_ADDONS_PATH=$(pwd)/build/addons
xvfb-run -a npm run functionalTestWasm -- --retries 3 ${{ matrix.test.path }}