-
Notifications
You must be signed in to change notification settings - Fork 283
78 lines (64 loc) · 2.73 KB
/
ci_macos.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
name: macOS
on: [push]
jobs:
build-macos:
strategy:
matrix:
include:
- qt_version: [5.15, 6.7]
- runner: [macos-latest-large, macos-latest-xlarge]
runs-on: ${{matrix.runner}}
name: build-macos-qt${{matrix.qt_version}}
steps:
- name: Set globals
id: globals
run: |
QT_VERSION_MAJOR=$(echo ${{matrix.qt_version}} | cut -d. -f1)
echo qt_version_major=$QT_VERSION_MAJOR >> ${GITHUB_OUTPUT}
echo qt_path=$(brew --prefix qt@$QT_VERSION_MAJOR) >> ${GITHUB_OUTPUT}
if [[ ${{matrix.runner}} =~ "-large" ]]; then
echo arch=x64 >> ${GITHUB_OUTPUT}
elif [[ ${{matrix.runner}} =~ "-xlarge" ]]; then
echo arch=arm64 >> ${GITHUB_OUTPUT}
fi
- name: Checkout
uses: actions/checkout@v2
- name: Install Qt
run: brew install qt@${{steps.globals.outputs.qt_version_major}}
- name: Install OpenCascade
run: brew install opencascade
- name: Install Assimp
run: brew install assimp
- name: Get count of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores
- name: Build
run: |
mkdir ${{github.workspace}}/build
cd ${{github.workspace}}/build
cmake --version
cmake .. \
-DMayo_BuildTests=ON \
-DMayo_BuildPluginAssimp=ON \
-DQT_DIR=${{steps.globals.outputs.qt_path}}/lib/cmake/Qt${{steps.globals.outputs.qt_version_major}}
cmake --build . \
--config Release \
--parallel ${{steps.cpu-cores.outputs.count}}
- name: Execute Unit Tests
working-directory: ${{github.workspace}}/build
run: |
./mayo.app/Contents/MacOS/mayo --runtests
- name: Create dmg file
if: ${{steps.globals.outputs.qt_version_major}} == '6'
working-directory: ${{github.workspace}}/build
run: |
${{steps.globals.outputs.qt_path}}/bin/macdeployqt mayo.app -dmg
mv mayo.dmg Mayo-0.9.0-macOS-${{steps.globals.outputs.arch}}.dmg
- name: Upload dmg file
if: ${{steps.globals.outputs.qt_version_major}} == '6'
uses: actions/upload-artifact@v4
with:
name: Mayo-0.9.0-macOS-${{steps.globals.outputs.arch}}-dmg
path: |
${{github.workspace}}/build/Mayo-0.9.0-macOS-${{steps.globals.outputs.arch}}.dmg
#${{github.workspace}}/build/MayoConv-0.9.0-macOS-${{steps.globals.outputs.arch}}.dmg