-
Notifications
You must be signed in to change notification settings - Fork 13
executable file
·130 lines (116 loc) · 4.82 KB
/
build_pat.yaml
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
name: Build_PAT
on:
pull_request:
branches:
- '*'
push:
branches:
- '*'
tags:
- '*'
jobs:
pat_build:
name: Build ${{ matrix.name }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.allow_failure }}
strategy:
# fail-fast: Default is true, switch to false to allow one platform to fail and still run others
fail-fast: false
matrix:
name: [Ubuntu, macOS, Windows_2022]
include:
- name: Ubuntu
os: ubuntu-22.04
node-version: 18
allow_failure: false
- name: macOS
os: macos-12
node-version: 18
allow_failure: false
MACOSX_DEPLOYMENT_TARGET: 10.15
SDKROOT: /Applications/Xcode_11.7.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
DEVELOPER_DIR: /Applications/Xcode_11.7.app/Contents/Developer
- name: Windows_2022
os: windows-2022
node-version: 18
allow_failure: false
steps:
- uses: actions/checkout@v3
- name: Set up Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install System dependencies
shell: bash
run: |
set -x
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt update
sudo apt install cmake
elif [ "$RUNNER_OS" == "macOS" ]; then
curl -L -O https://download.qt.io/archive/qt-installer-framework/4.3.0/QtInstallerFramework-macOS-x64-4.3.0.dmg
hdiutil attach -mountpoint ./qtfiw_installer QtInstallerFramework-macOS-x64-4.3.0.dmg
echo "ls ./qtfiw_installer"
sudo ./qtfiw_installer/QtInstallerFramework-macOS-x64-4.3.0.app/Contents/MacOS/QtInstallerFramework-macOS-x64-4.3.0 --verbose --script ./ci/install_script_qtifw.qs
ls ~/Qt/QtIFW-4.3.0 || true
echo "~/Qt/QtIFW-4.3.0/bin/" >> $GITHUB_PATH
echo MACOSX_DEPLOYMENT_TARGET=${{ matrix.MACOSX_DEPLOYMENT_TARGET }} >> $GITHUB_ENV
# echo CMAKE_MACOSX_DEPLOYMENT_TARGET='-DCMAKE_OSX_DEPLOYMENT_TARGET=$MACOSX_DEPLOYMENT_TARGET' >> $GITHUB_ENV
elif [ "$RUNNER_OS" == "Windows" ]; then
curl -L -O https://download.qt.io/archive/qt-installer-framework/4.3.0/QtInstallerFramework-windows-x86-4.3.0.exe
./QtInstallerFramework-windows-x86-4.3.0.exe --verbose --script ./ci/install_script_qtifw.qs
dir "C:/Qt/"
echo "C:/Qt/QtIFW-4.3.0/bin" >> $GITHUB_PATH
#echo "Setting CMAKE_GENERATOR options equivalent to ='-G \"Visual Studio 16 2019\" -A x64'"
#echo CMAKE_GENERATOR='Visual Studio 16 2019' >> $GITHUB_ENV
#echo CMAKE_GENERATOR_PLATFORM=x64 >> $GITHUB_ENV
# C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise
# Command below no longer working and returning the version number.
# MSVC_DIR=$(cmd.exe /c "vswhere -products * -requires Microsoft.Component.MSBuild -property installationPath -latest")
MSVC_DIR="C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
echo "Latest is: $MSVC_DIR"
echo "MSVC_DIR=$MSVC_DIR" >> $GITHUB_ENV
# add folder containing vcvarsall.bat
echo "$MSVC_DIR\VC\Auxiliary\Build" >> $GITHUB_PATH
fi;
- name: Create Build Directory
run: cmake -E make_directory ./build/
- name: Configure CMake & build (Windows)
working-directory: ./build
if: runner.os == 'Windows'
shell: cmd
run: |
echo "Using vcvarsall to initialize the development environment"
call vcvarsall.bat x64
cmake -G "Visual Studio 17 2022" -A x64 ..
cmake --build . --target package -j 2 --config Release
- name: Configure CMake & build (Linux)
working-directory: ./build
if: runner.os == 'Linux'
shell: bash
run: |
set -x
cmake -DCMAKE_BUILD_TYPE=Release \
-DCPACK_BINARY_DEB=ON \
-DCPACK_BINARY_IFW=OFF \
-DCPACK_BINARY_TGZ=OFF \
-DCPACK_BINARY_TZ=OFF \
-DCPACK_BINARY_STGZ=OFF \
-DCPACK_BINARY_TBZ2=OFF \
../
cmake --build . --target package -j 2
- name: Configure CMake & build (macOS)
working-directory: ./build
if: runner.os == 'macOS'
shell: bash
run: |
set -x
cmake -DCMAKE_OSX_DEPLOYMENT_TARGET=11 \
-DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" \
-DCMAKE_BUILD_TYPE=Release \
../
cmake --build . --target package -j 2
- name: Save artifact
uses: actions/upload-artifact@v2
with:
path: ./build/ParametricAnalysisTool-*