-
Notifications
You must be signed in to change notification settings - Fork 36
129 lines (106 loc) · 4.14 KB
/
build-mac.yml
File metadata and controls
129 lines (106 loc) · 4.14 KB
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
name: Mac Build
on:
push:
branches:
- master
- release_v*
tags:
- '*'
pull_request:
schedule:
- cron: '0 0 * * 0'
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
MACOSX_DEPLOYMENT_TARGET: "12.0"
SW_CLOUD_LOGIN: ${{ secrets.CLOUD_LOGIN }}
CACHE_HOST: ${{ secrets.SSH_HOST }}
GA_MEASUREMENT_ID: ${{ secrets.GA_MEASUREMENT_ID }}
GA_API_SECRET: ${{ secrets.GA_API_SECRET }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: macos-15-intel
steps:
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v3.0.4
- name: OS Setup
run: |
echo CONDA=$CONDA
sudo chown -R $UID $CONDA
conda init zsh
source ~/.zshrc
brew install ccache pigz gnu-tar coreutils
- name: Checkout code
uses: actions/checkout@v3
with:
lfs: true
- name: Get tags
run: git fetch --unshallow origin +refs/tags/*:refs/tags/*
- name: Conda Installs
shell: bash -l {0}
run: .github/workflows/gha_conda.sh
- name: Restore Dependencies Cache
id: cache-deps-restore
uses: actions/cache/restore@v3
with:
path: /Users/runner/install
key: ${{ runner.os }}-intel-deps-osx${{ env.MACOSX_DEPLOYMENT_TARGET }}-${{ hashFiles('.github/workflows/gha_deps.sh', 'install_shapeworks.sh', 'python_requirements.txt', 'build_dependencies.sh') }}
- name: Build Dependencies
shell: bash -l {0}
run: .github/workflows/gha_deps.sh
- name: Save Dependencies Cache
if: steps.cache-deps-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v3
with:
path: /Users/runner/install
key: ${{ runner.os }}-intel-deps-osx${{ env.MACOSX_DEPLOYMENT_TARGET }}-${{ hashFiles('.github/workflows/gha_deps.sh', 'install_shapeworks.sh', 'python_requirements.txt', 'build_dependencies.sh') }}
- name: cmake
shell: bash -l {0}
run: conda activate shapeworks && mkdir build && cd build && cmake -DCMAKE_LIBTOOL=/usr/bin/libtool -DCMAKE_CXX_FLAGS=-g -DCMAKE_OSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET -DCMAKE_PREFIX_PATH=$HOME/install -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DPython3_ROOT_DIR:FILEPATH=${CONDA_PREFIX} -DUSE_OPENMP=OFF -DBuild_Studio=ON -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/shapeworks-install -DBUILD_DOCUMENTATION=OFF -DGA_MEASUREMENT_ID=$GA_MEASUREMENT_ID -DGA_API_SECRET=$GA_API_SECRET ..
- name: make
shell: bash -l {0}
run: conda activate shapeworks && cd build && make -j4
- name: make install
shell: bash -l {0}
run: conda activate shapeworks && cd build && make install
- name: Build Binary Package
shell: bash -l {0}
env:
PR_NUMBER: ${{ github.event.number }}
run: conda activate shapeworks && source ./devenv.sh ./build/bin && ./Support/package.sh tag ${GITHUB_WORKSPACE}/shapeworks-install $HOME/install
- name: Download test data
shell: bash -l {0}
run: .github/workflows/download_test_data.sh
- name: make test
shell: bash -l {0}
run: conda activate shapeworks && source ./devenv.sh ./build/bin && cd build && ctest -VV
- name: Print crash reports
if: failure()
run: |
echo "=== Crash Reports ==="
for f in ~/Library/Logs/DiagnosticReports/*.crash ~/Library/Logs/DiagnosticReports/*.ips; do
if [ -f "$f" ]; then
echo "--- $f ---"
cat "$f"
echo ""
fi
done
- uses: actions/upload-artifact@v4
with:
name: artifact-${{github.sha}}-mac
path: ${{runner.workspace}}/ShapeWorks/artifacts
- name: Deploy
id: deploy
if: github.ref == 'refs/heads/master'
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "dev-mac"
prerelease: true
title: "Development Build for Mac"
files: |
${{runner.workspace}}/ShapeWorks/artifacts/*.zip
${{runner.workspace}}/ShapeWorks/artifacts/*.pkg