-
Notifications
You must be signed in to change notification settings - Fork 3
184 lines (162 loc) · 5.69 KB
/
sketcher-builder.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
name: Sketcher Build and Test
on:
workflow_dispatch: ~
push: ~
pull_request: ~
schedule:
- cron: "0 4 * * *"
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
# os: [macos-latest, ubuntu-latest, windows-latest]
# build-output: [app]
include:
- os: ubuntu-latest
build-output: wasm
steps:
- uses: actions/checkout@v4
- name: Create and activate virtualenv
if: matrix.os == 'macos-latest'
run: |
python3 -m venv .venv
source .venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Install Python packages
run: python3 -m pip install ninja clang-format==14.0.6
- name: Code formatting check
run: find . -name *.h -o -name *.cpp | xargs clang-format -n --Werror
- name: Read external/versions.json
run: |
{
echo 'VERSIONS_JSON<<EOF'
cat external/versions.json
echo -e '\nEOF'
} >> "$GITHUB_ENV"
- name: Activate emscripten
if: matrix.build-output == 'wasm'
uses: ./.github/actions/activate-emsdk
with:
version: ${{ fromJson(env.VERSIONS_JSON).emscripten }}
- name: Configure Dependency CMake
run: |
${{matrix.build-output == 'wasm' && 'emcmake ' || ''}}cmake --fresh -B build/external/ -S external/ -G Ninja \
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}
- name: Fetch fmt
id: fetch-fmt
uses: ./.github/actions/build-external
with:
library: fmt
version: ${{ fromJson(env.VERSIONS_JSON).fmt }}
- name: Fetch zlib
if: matrix.build-output != 'wasm'
id: fetch-zlib
uses: ./.github/actions/build-external
with:
library: zlib
version: ${{ fromJson(env.VERSIONS_JSON).zlib }}
- name: Fetch zstd
id: fetch-zstd
uses: ./.github/actions/build-external
with:
library: zstd
version: ${{ fromJson(env.VERSIONS_JSON).zstd }}
- name: Fetch Boost
id: fetch-boost
uses: ./.github/actions/build-external
with:
library: boost
version: ${{ fromJson(env.VERSIONS_JSON).boost }}
- name: Fetch RDKit
id: fetch-rdkit
uses: ./.github/actions/build-external
with:
library: rdkit
version: ${{ fromJson(env.VERSIONS_JSON).rdkit }}
- name: Install Qt's required packages
if: ${{ matrix.os == 'ubuntu-latest' && matrix.build-output != 'wasm'}}
run: |
sudo apt-get install \
libfontconfig1-dev \
libfreetype-dev \
libx11-dev \
libx11-xcb-dev \
libxcb-cursor-dev \
libxcb-glx0-dev \
libxcb-icccm4-dev \
libxcb-image0-dev \
libxcb-keysyms1-dev \
libxcb-randr0-dev \
libxcb-render-util0-dev \
libxcb-shape0-dev \
libxcb-shm0-dev \
libxcb-sync-dev \
libxcb-util-dev \
libxcb-xfixes0-dev \
libxcb-xinerama0-dev \
libxcb-xkb-dev \
libxcb1-dev \
libxext-dev \
libxfixes-dev \
libxi-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
libxrender-dev
- name: Fetch Qt
id: fetch-qt
uses: ./.github/actions/build-external
with:
library: qt
version: ${{ fromJson(env.VERSIONS_JSON).qt }}
- name: Configure CMake
if: matrix.build-output != 'wasm'
env:
CMAKE_PREFIX_PATH: "${{ steps.fetch-fmt.outputs.path }};\
${{ steps.fetch-zlib.outputs.path }};\
${{ steps.fetch-zstd.outputs.path }};\
${{ steps.fetch-boost.outputs.path }};\
${{ steps.fetch-rdkit.outputs.path }};\
${{ steps.fetch-qt.outputs.path }}"
Boost_VERBOSE: 1
Boost_DEBUG: 1
run: |
${{matrix.build-output == 'wasm' && 'emcmake' || ''}} \
cmake --fresh -B build -S . -G Ninja \
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
-DCMAKE_PREFIX_PATH="${{ env.CMAKE_PREFIX_PATH }}"
- name: Build
if: matrix.build-output != 'wasm'
run: cmake --build build --config ${{ env.BUILD_TYPE }}
- name: Test
if: matrix.build-output != 'wasm'
working-directory: build
# the first line of the command launches xvfb-run -a, but only for
# Ubuntu non-wasm builds
run: |
${{ matrix.os == 'ubuntu-latest' && matrix.build-output != 'wasm' && 'xvfb-run -a' || ''}} \
ctest --build-config ${{ env.BUILD_TYPE }} --output-on-failure
- name: Download sketcher executable
if: matrix.build-output != 'wasm'
uses: actions/upload-artifact@v4
env:
# ".exe" on Windows, empty everywhere else
dot_exe: ${{matrix.os == 'windows-latest' && '.exe' || ''}}
with:
name: sketcher_${{ matrix.os}}_${{ matrix.build-output }}${{env.dot_exe}}
path: build/sketcher_app${{env.dot_exe}}
- name: Create wasm tarball
if: matrix.build-output == 'not wasm'
run: sketcher/wasm/create_wasm_tarball.sh sketcher-wasm
- name: Download wasm tarball
if: matrix.build-output == 'not wasm'
uses: actions/upload-artifact@v4
with:
name: sketcher-wasm.tar.gz
path: sketcher-wasm.tar.gz