forked from Tulip-Dev/tulip
-
Notifications
You must be signed in to change notification settings - Fork 1
134 lines (134 loc) · 5 KB
/
macos-homebrew-build.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
name: macos-homebrew-build
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
macos:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- name: Talipot build on macOS 13 (x86_64)
os: macos-13
pyver: "3.12"
homebrew_path: /usr/local
- name: Talipot build on macOS 14 (arm64)
os: macos-14
pyver: "3.12"
homebrew_path: /opt/homebrew
steps:
- name: Checkout Talipot code
uses: actions/checkout@v4
- name: Install Talipot build dependencies
run: brew install
ccache
cmake
llvm
qhull
yajl
zstd
graphviz
libgit2
python@${{ matrix.config.pyver }}
cppunit
glew
freetype
fribidi
fontconfig
qt6
quazip
- name: Install SIP
run: pip${{ matrix.config.pyver }} install sip --break-system-packages
- name: Prepare ccache timestamp
id: get-current-date
run: |
echo "date=$(date -u "+%Y-%m-%d-%H-%m-%S")" >> $GITHUB_OUTPUT
shell: bash
- name: Cache files
uses: actions/cache@v4
with:
path: /Users/runner/Library/Caches/ccache
key: ${{ matrix.config.os }}-ccache-${{ steps.get-current-date.outputs.date }}
restore-keys: |
${{ matrix.config.os }}-ccache-
save-always: true
- name: Create build directory
run: mkdir build
- name: Configure Talipot core build with CMake
working-directory: ./build
run: cmake .. -DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX=$PWD/install
-DCMAKE_C_COMPILER=${{ matrix.config.homebrew_path }}/opt/llvm/bin/clang
-DCMAKE_CXX_COMPILER=${{ matrix.config.homebrew_path }}/opt/llvm/bin/clang++
-DCMAKE_SHARED_LINKER_FLAGS="-L${{ matrix.config.homebrew_path }}/opt/llvm/lib/c++
-Wl,-rpath,${{ matrix.config.homebrew_path }}/opt/llvm/lib/c++
-L${{ matrix.config.homebrew_path }}/opt/llvm/lib/unwind -lunwind"
-DCMAKE_EXE_LINKER_FLAGS="-L${{ matrix.config.homebrew_path }}/opt/llvm/lib/c++
-Wl,-rpath,${{ matrix.config.homebrew_path }}/opt/llvm/lib/c++
-L${{ matrix.config.homebrew_path }}/opt/llvm/lib/unwind -lunwind"
-DCMAKE_RANLIB=/usr/bin/ranlib
-DPython3_EXECUTABLE=${{ matrix.config.homebrew_path }}/bin/python${{ matrix.config.pyver }}
-DTALIPOT_BUILD_CORE_ONLY=ON
-DTALIPOT_BUILD_TESTS=ON
-DTALIPOT_BUILD_DOC=OFF
-DTALIPOT_USE_CCACHE=ON
- name: Talipot core build
working-directory: ./build
run: make -j4
- name: Install Talipot core build
working-directory: ./build
run: make -j4 install
- name: Run Talipot core build unit tests
working-directory: ./build
run: make tests
- name: Configure Talipot complete build with CMake
working-directory: ./build
run: cmake .
-DTALIPOT_BUILD_CORE_ONLY=OFF
-DCMAKE_PREFIX_PATH=${{ matrix.config.homebrew_path }}/opt/qt6
-DTALIPOT_USE_QT6=ON
- name: Talipot complete build
working-directory: ./build
run: make -j4
- name: Install Talipot complete build
working-directory: ./build
run: make -j4 install
- name: Run Talipot complete build unit tests
working-directory: ./build
run: make tests
- name: Check Talipot application can be executed
working-directory: ./build/install/bin
run: ./talipot --check-application-starts --debug-plugins-load
- name: Generate Talipot dmg bundle
working-directory: ./build
run: make bundle
- name: Check bundled Talipot can be installed and executed
working-directory: ./build
run: |
for package in $(brew list); do
brew uninstall --ignore-dependencies --force $package
done
hdiutil attach Talipot*.dmg
cp -r /Volumes/Talipot*/Talipot*.app /Applications/
sudo xattr -r -d com.apple.quarantine /Applications/Talipot*.app
/Applications/Talipot*.app/Contents/MacOS/Talipot \
--check-application-starts \
--debug-plugins-load
hdiutil detach /Volumes/Talipot*
- name: Upload Talipot bundle to GitHub Actions artifacts
uses: actions/upload-artifact@v4
with:
name: Talipot-macOS-bundles-${{ matrix.config.os }}
path: ./build/Talipot*.dmg
- name: Upload Talipot bundle to dev-latest prerelease
if: github.ref == 'refs/tags/dev-latest'
uses: ncipollo/release-action@v1
with:
allowUpdates: true
name: Talipot development build
prerelease: true
artifacts: ./build/Talipot*.dmg
token: ${{ secrets.GITHUB_TOKEN }}