-
Notifications
You must be signed in to change notification settings - Fork 2
188 lines (167 loc) · 7.13 KB
/
ci.linux.matlab.yml
File metadata and controls
188 lines (167 loc) · 7.13 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
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
name: Linux with MATLAB (g++/clang++)
on:
push:
branches: [ master, dev ]
pull_request:
branches: [ master, dev ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
VCPKG_NUGET_REPOSITORY: https://github.com/Neumann-A/my-vcpkg-packages.git
jobs:
job:
name: ${{ matrix.name }}-build-and-test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
name: [ubuntu-latest-g++, ubuntu-20.04-clang++]
# For Windows clang-cl, for Linux g++ and clang++. I don't intend to support osx
include:
- name: ubuntu-20.04-clang++
os: ubuntu-20.04
cxx: clang++-12
cc: clang-12
triplet: x64-linux-release
host-triplet: x64-linux-release
mono: 'mono'
resource_limited: 'ON'
- name: ubuntu-latest-g++
os: ubuntu-latest
cxx: g++-11
cc: gcc-11
triplet: x64-linux-release
host-triplet: x64-linux-release
mono: 'mono'
resource_limited: 'OFF'
env:
buildDir: '${{ github.workspace }}/b'
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite;files,${{ github.workspace }}/vcpkg_cache'
VCPKG_DISABLE_METRICS: '1'
BASH_ENV: .github/workflows/bashrc
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
steps:
- uses: actions/checkout@v2.3.4
with:
token: ${{ secrets.CI_ACCESS_PAT }}
submodules: recursive
# Install latest CMake
- uses: lukka/get-cmake@v3.21.2
- name: Install system dependencies
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install libgl1-mesa-dev
sudo apt-get install gcc-11 g++-11
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 60 --slave /usr/bin/g++ g++ /usr/bin/g++--11
- name: Set up MATLAB
uses: matlab-actions/setup-matlab@v1
# - name: Run script
# uses: matlab-actions/run-command@v1
# with:
# command: version
- name: Try to get Matlab version
shell: bash
run: |
matlab -nosplash -nojvm -nodesktop -batch "version, exit" 2>&1
# - name: Try to get Matlab version
# shell: bash
# run: |
# matlab -nosplash -nojvm -nodesktop -nodisplay -r "version, exit"
- name: Cache vcpkg binary dir.
uses: pat-s/always-upload-cache@v2.1.5
with:
path: |
${{ github.workspace }}/vcpkg_cache
key: ${{ matrix.name }}-${{ hashFiles('vcpkg/versions/baseline.json') }}
- name: bootstrap vcpkg
uses: lukka/run-vcpkg@v7.3
with:
# Just install vcpkg for now, do not install any ports in this step yet.
setupOnly: true
# Location of the vcpkg as submodule of the repository.
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
appendedCacheKey: ${{ hashFiles( '**/vcpkg_manifest/vcpkg.json' ) }}
additionalCachedPaths: ${{ env.buildDir }}/vcpkg_installed
vcpkgGitCommitId: 18e6e8855d2da137fada2387b6d137583c02b77c
# This step assumes `vcpkg` has been bootstrapped (run `./vcpkg/bootstrap-vcpkg`)
- name: 'Setup NuGet Credentials'
shell: 'bash'
run: >
${{ matrix.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
sources add
-source "https://nuget.pkg.github.com/Neumann-A/index.json"
-storepasswordincleartext
-name "GitHub"
-username "Neumann-A"
-password "${{ secrets.CI_ACCESS_PAT }}"
- name: 'setup NuGet apikey'
shell: 'bash'
run: >
${{ matrix.mono }} `./vcpkg/vcpkg fetch nuget | tail -n 1`
setapikey "${{ secrets.CI_ACCESS_PAT }}" -Source "https://nuget.pkg.github.com/Neumann-A/index.json"
- name: configure and build
uses: lukka/run-cmake@v3.4
env:
CC: '${{ matrix.cc }}'
CXX: '${{ matrix.cxx }}'
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
cmakeAppendedArgs: >
-GNinja
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_COMPILER=${{ matrix.cc }}
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }}
-DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }}
-DVCPKG_HOST_TRIPLET=${{ matrix.host-triplet }}
-DVCPKG_MANIFEST_FEATURES=matlab
-DStoPhys_ARCH_LIST:STRING=AVX2
-DStoPhys_LIMITED_RESOURCE=${{ matrix.resource_limited }}
-DWITH_STATIC_CRT=OFF
-DStoPhys_LIMITED_RESOURCE=ON
"-DMATLAB_ADDITIONAL_VERSIONS=\"2021b=9.11\""
buildWithCMake: true
buildWithCMakeArgs: '-- -v'
buildDirectory: '${{ env.buildDir }}'
useVcpkgToolchainFile: true
- name: collect build logs
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.name }}-artifact
path: |
${{ env.buildDir }}/b/**/*.log
${{ github.workspace }}/vcpkg/buildtrees/**/*.log
retention-days: 2
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
# steps:
#- uses: actions/checkout@v2
#- name: Create Build Environment
# Some projects don't allow in-source building, so create a separate build directory
# We'll use this as our working directory for all subsequent commands
# run: cmake -E make_directory ${{runner.workspace}}/build
#- name: Configure CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
# shell: bash
# working-directory: ${{runner.workspace}}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
# run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
#- name: Build
# working-directory: ${{runner.workspace}}/build
# shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
# run: cmake --build . --config $BUILD_TYPE
#- name: Test
# working-directory: ${{runner.workspace}}/build
# shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
# run: ctest -C $BUILD_TYPE