-
Notifications
You must be signed in to change notification settings - Fork 3
139 lines (120 loc) · 4.1 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
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
if: matrix.build-output != 'wasm'
run: |
cmake -B build/external/ -S external/ -G Ninja \
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}
- name: Fetch fmt
if: matrix.build-output != 'wasm'
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
if: matrix.os == 'macos-latest'
id: fetch-zstd
uses: ./.github/actions/build-external
with:
library: zstd
version: ${{ fromJson(env.VERSIONS_JSON).zstd }}
- name: Fetch Boost
if: matrix.build-output != 'wasm'
id: fetch-boost
uses: ./.github/actions/build-external
with:
library: boost
version: ${{ fromJson(env.VERSIONS_JSON).boost }}
- name: Fetch RDKit
if: matrix.build-output != 'wasm'
id: fetch-rdkit
uses: ./.github/actions/build-external
with:
library: rdkit
version: ${{ fromJson(env.VERSIONS_JSON).rdkit }}
- name: Fetch Qt
if: matrix.build-output != 'wasm'
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 }}"
run: |
cmake -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
run: ctest --build-config ${{ env.BUILD_TYPE }} --output-on-failure
- name: Download sketcher executable
if: matrix.build-output != 'wasm'
uses: actions/upload-artifact@v4
with:
name: sketcher_${{ matrix.os}}_${{ matrix.build-output }}
path: build/sketcher_app