forked from topology-tool-kit/ttk
-
Notifications
You must be signed in to change notification settings - Fork 0
212 lines (182 loc) · 5.76 KB
/
ccache.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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
name: store_ccache
on:
push:
branch-ignore:
- '*'
tags:
- 'ccache'
env:
PV_TAG: v5.10.0-headless
PV_REPO: topology-tool-kit/ttk-paraview
jobs:
# -------#
# Ubuntu #
# -------#
ccache-ubuntu:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
steps:
- uses: actions/checkout@v2
name: Checkout TTK source code
- name: Install Ubuntu dependencies
run: |
sudo apt update
# TTK dependencies
sudo apt install -y \
ccache \
libboost-system-dev \
libeigen3-dev \
libgraphviz-dev \
libosmesa-dev \
libsqlite3-dev \
graphviz \
ninja-build \
zlib1g-dev \
dpkg-dev
sudo python3 -m pip install scikit-learn
- name: Install optional dependencies
uses: ./.github/actions/install-deps-unix
- uses: dsaltares/fetch-gh-release-asset@master
name: Fetch TTK-ParaView headless Debian package
with:
repo: "${{ env.PV_REPO }}"
version: "tags/${{ env.PV_TAG }}"
file: "ttk-paraview-headless-${{ matrix.os }}.deb"
target: "ttk-paraview-headless.deb"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install ParaView .deb
run: |
sudo apt install ./ttk-paraview-headless.deb
- name: Create & configure TTK build directory
run: |
mkdir build
cd build
cmake \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_INSTALL_PREFIX=/usr \
-DTTK_BUILD_PARAVIEW_PLUGINS=TRUE \
-DTTK_BUILD_VTK_WRAPPERS=TRUE \
-DTTK_BUILD_STANDALONE_APPS=TRUE \
-DTTK_ENABLE_KAMIKAZE=TRUE \
-DTTK_ENABLE_CPU_OPTIMIZATION=FALSE \
-DTTK_ENABLE_SHARED_BASE_LIBRARIES=TRUE \
-GNinja \
$GITHUB_WORKSPACE
- name: Build TTK
run: |
cd build
cmake --build . --parallel
- name: Archive cache
run: |
cd /home/runner
tar czf ttk-ccache.tar.gz .ccache
- name: Upload ccache archive
uses: actions/upload-artifact@v2
with:
name: ttk-ccache-${{ matrix.os }}
path: /home/runner/ttk-ccache.tar.gz
# ------#
# macOS #
# ------#
ccache-macos:
runs-on: macos-latest
env:
CCACHE_DIR: /Users/runner/work/ttk/.ccache
steps:
- uses: actions/checkout@v2
name: Checkout TTK source code
- name: Remove hosted Python
run: |
sudo rm -rf /usr/local/Frameworks/Python.framework
- name: Install macOS dependencies
run: |
# ParaView dependencies
brew install --cask xquartz
brew install wget libomp ninja python
# TTK dependencies
brew install boost eigen graphviz numpy embree ccache
python3 -m pip install scikit-learn
# prepend ccache to system path
echo "$(brew --prefix)/opt/ccache/libexec" >> $GITHUB_PATH
- name: Install optional dependencies
uses: ./.github/actions/install-deps-unix
- name: Fetch TTK-ParaView headless macOS binary archive
run: |
wget https://github.com/${{ env.PV_REPO }}/releases/download/${{ env.PV_TAG }}/ttk-paraview-headless.tar.gz
- name: Install ParaView
run: |
tar xzf ttk-paraview-headless.tar.gz
sudo cp -r ttk-paraview/* /usr/local
- name: Create & configure TTK build directory
run: |
mkdir build
cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DPython3_ROOT_DIR=$(brew --prefix python) \
-DTTK_BUILD_PARAVIEW_PLUGINS=TRUE \
-DTTK_BUILD_VTK_WRAPPERS=TRUE \
-DTTK_BUILD_STANDALONE_APPS=TRUE \
-DTTK_ENABLE_KAMIKAZE=TRUE \
-DTTK_ENABLE_CPU_OPTIMIZATION=FALSE \
-DTTK_ENABLE_SHARED_BASE_LIBRARIES=TRUE \
-GNinja \
$GITHUB_WORKSPACE
- name: Build TTK
run: |
cd build
cmake --build . --parallel
- name: Archive cache
run: |
cd /Users/runner/work/ttk
tar czf ttk-ccache.tar.gz .ccache
- name: Upload ccache archive
uses: actions/upload-artifact@v2
with:
name: ttk-ccache-macOS
path: /Users/runner/work/ttk/ttk-ccache.tar.gz
# --------------------- #
# Upload release assets #
# --------------------- #
create-release:
runs-on: ubuntu-latest
needs: [ccache-ubuntu, ccache-macos]
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: true
- name: Fetch all uploaded artifacts
uses: actions/download-artifact@v2
- name: Upload Ubuntu Bionic .deb as Release Asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: ttk-ccache-ubuntu-18.04/ttk-ccache.tar.gz
asset_name: ttk-ccache-ubuntu-18.04.tar.gz
- name: Upload Ubuntu Focal .deb as Release Asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: ttk-ccache-ubuntu-20.04/ttk-ccache.tar.gz
asset_name: ttk-ccache-ubuntu-20.04.tar.gz
- name: Upload .pkg as Release Asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: ttk-ccache-macOS/ttk-ccache.tar.gz
asset_name: ttk-ccache-macOS.tar.gz