-
Notifications
You must be signed in to change notification settings - Fork 10
145 lines (126 loc) · 4.91 KB
/
webassembly.yml
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: "webassembly"
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: mymindstorm/setup-emsdk@v13
with:
version: 3.1.37
- uses: actions/checkout@v3
- name: Install Qt native version (required by webassembly version)
uses: jurplel/install-qt-action@v3
with:
aqtversion: '==3.1.*'
version: '6.6.1'
host: linux
target: 'desktop'
arch: gcc_64
dir: '${{github.workspace}}/qt'
install-deps: 'true'
- name: Set QT_HOST_PATH
run: echo "QT_HOST_PATH=${Qt6_DIR}" >> "$GITHUB_ENV"
- name: Install Linux Dependencies
run: sudo apt-get install -y build-essential ninja-build
- name: Install Qt Webassembly version
uses: jurplel/install-qt-action@v3
with:
aqtversion: '==3.1.*'
version: '6.6.1'
host: linux
target: 'desktop'
arch: wasm_singlethread
dir: '${{github.workspace}}/qt'
install-deps: 'true'
- name: Make qt webassembly binaries executable
run: |
chmod u+x ${Qt6_DIR}/bin/*
- name: Verify emcc
run: emcc -v
- name: Set reusable strings
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
echo "install-dir=${{ github.workspace }}/install" >> "$GITHUB_OUTPUT"
- name: Configure CMake for short tests
env:
CMAKE_PREFIX_PATH: ${{env.Qt6_DIR}}/lib/cmake
run: >
${Qt6_DIR}/bin/qt-cmake
-G Ninja
-B ${{ steps.strings.outputs.build-output-dir }}_short
-DCMAKE_BUILD_TYPE=Release
-DAA_ENABLE_LONG_TEST_RUN=OFF
-DAA_WWW_INSTALL_DIR=${{ steps.strings.outputs.install-dir }}/short
-DFMT_INSTALL=OFF
-S ${{ github.workspace }}
- name: Build short tests
run: cmake --build ${{ steps.strings.outputs.build-output-dir }}_short --target install
- name: Configure CMake for long tests
env:
CMAKE_PREFIX_PATH: ${{env.Qt6_DIR}}/lib/cmake
run: >
${Qt6_DIR}/bin/qt-cmake
-G Ninja
-B ${{ steps.strings.outputs.build-output-dir }}_long
-DCMAKE_BUILD_TYPE=Release
-DAA_ENABLE_LONG_TEST_RUN=ON
-DAA_WWW_INSTALL_DIR=${{ steps.strings.outputs.install-dir }}/long
-DFMT_INSTALL=OFF
-S ${{ github.workspace }}
- name: Build long tests
run: cmake --build ${{ steps.strings.outputs.build-output-dir }}_long --target install
- name: Create artifact
uses: actions/upload-artifact@v4
with:
name: webassembly_tests
path: ${{ steps.strings.outputs.install-dir }}
if-no-files-found: error
- name: Create index.html
run: |
echo "<html>" >> ${{ steps.strings.outputs.install-dir }}/index.html
echo " <head>" >> ${{ steps.strings.outputs.install-dir }}/index.html
echo " <title>Goofy Tests</title>" >> ${{ steps.strings.outputs.install-dir }}/index.html
echo " </head>" >> ${{ steps.strings.outputs.install-dir }}/index.html
echo " <body>" >> ${{ steps.strings.outputs.install-dir }}/index.html
echo " <ul>" >> ${{ steps.strings.outputs.install-dir }}/index.html
echo " <li><a href="./short/GoofyTC.html">short tests (be patient)</li>" >> ${{ steps.strings.outputs.install-dir }}/index.html
echo " <li><a href="./long/GoofyTC.html">long tests (be super patient)</li>" >> ${{ steps.strings.outputs.install-dir }}/index.html
echo " </ul>" >> ${{ steps.strings.outputs.install-dir }}/index.html
echo " </body>" >> ${{ steps.strings.outputs.install-dir }}/index.html
echo "</html>" >> ${{ steps.strings.outputs.install-dir }}/index.html
echo "" >> ${{ steps.strings.outputs.install-dir }}/index.html
- name: Create Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ${{ steps.strings.outputs.install-dir }}
deploy:
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- name: Debug output
run: echo ${{ steps.deployment.outputs.page_url }}