-
Notifications
You must be signed in to change notification settings - Fork 0
197 lines (188 loc) · 7.79 KB
/
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
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
189
190
191
192
193
194
195
196
197
name: build
on: push
env:
cache-suffix: v1
build_flags: "-DWITH_COMMON=OFF -DWITH_BUILD_REQUIRED=ON -DWITH_BUILD_LAPACK=ON -DWITH_LAPACK=ON -DWITH_HSL=ON -DWITH_METIS=ON -DWITH_BUILD_METIS=ON -DWITH_BUILD_HSL=ON -DBUILD_HSL_SRC=/work/coinhsl/coinhsl-2022.11.09 -DWITH_BQPD=ON -DWITH_BUILD_BQPD=ON -DBUILD_BQPD_SRC=/work/bqpd"
build_flags_32bit: ""
build_flags_manylinux1: ""
build_flags_windows: ""
build_flags_mac: "-DWITH_BUILD_LAPACK=OFF"
build_flags_mac_intel: ""
build_flags_mac_m1: ""
jobs:
main-dockcross:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
target: [manylinux1-x64,manylinux1-x86,manylinux2014-x64,manylinux2014-x86,windows-shared-x64-posix]
steps:
- uses: actions/checkout@v3.3.0
with:
repository: casadi/casadi
ref: uno
fetch-depth: 0 # for git-restore-mtime
- run: ls && pwd
- uses: chetan/git-restore-mtime-action@v1.2
- uses: dsaltares/fetch-gh-release-asset@1.1.0
with:
repo: jgillis/restricted
file: coinhsl-2022.11.09.zip
token: ${{ secrets.JGILLIS_RESTRICTED }}
- run: unzip coinhsl-2022.11.09.zip -d coinhsl
shell: bash
- uses: dsaltares/fetch-gh-release-asset@1.1.0
with:
repo: jgillis/restricted
file: bqpd.zip
token: ${{ secrets.JGILLIS_RESTRICTED }}
- run: unzip bqpd.zip
shell: bash
- run: ls bqpd
- run: cat coinhsl/coinhsl-2022.11.09/Makefile.in
- run: ls && pwd
- name: Setup dockcross
run: |
docker pull ghcr.io/jgillis/${{ matrix.target }}:production
docker image inspect ghcr.io/jgillis/${{ matrix.target }}:production
docker run --rm --env DEFAULT_DOCKCROSS_IMAGE=ghcr.io/jgillis/${{ matrix.target }}:production ghcr.io/jgillis/${{ matrix.target }}:production > dockcross
chmod +x dockcross
pwd
ls -al dockcross
- name: Cache build dir
uses: actions/cache@v3.2.3
with:
key: core-build-${{ matrix.target }}-${{env.cache-suffix}}
path: build
- name: Build
run: |
rm -f build/CMakeCache.txt
./dockcross cmake -Bbuild -DCMAKE_INSTALL_PREFIX=/work/install -DWITH_SELFCONTAINED=ON ${{env.build_flags}} ${{ contains(matrix.target,'86') && env.build_flags_32bit || ''}} ${{ contains(matrix.target,'manylinux1') && env.build_flags_manylinux1 || ''}} ${{ contains(matrix.target,'windows') && env.build_flags_windows || ''}} -DCMAKE_PREFIX_PATH=/work/mockups/cmake -H.
# In MXE land, (cross).pkg-config does not listen to PKG_CONFIG_PATH straight see https://mxe.cc/#tutorial-4
# Needed to make CoinUtils work
./dockcross --args "--env PKG_CONFIG_PATH_x86_64_w64_mingw32_shared_posix=/work/build/external_projects/lib64/pkgconfig:/work/build/external_projects/lib/pkgconfig:/work/build/external_projects/share/pkgconfig" -- /work/.github/workflows/patch_toolchain cmake --build build -v
./dockcross cmake --build build --target install -v
- uses: jgillis/universal_grafter@master
if: "!contains(matrix.target, 'windows')"
with:
source_path: install/casadi
destination_path: install/casadi
dockcross: ${{ matrix.target }}
bitness: 64
skip_libs: 'filternothing'
- name: build archives
run: |
zip -j -q hsl-${{matrix.target}}.zip install/casadi/lib*hsl*
- name: Upload files to a GitHub release
uses: svenstaro/upload-release-action@2.4.0
with:
overwrite: true
tag: perpetual
file: hsl-${{matrix.target}}.zip
prerelease: true
repo_token: ${{ secrets.JGILLIS_RESTRICTED }}
repo_name: jgillis/restricted
- name: build archives
run: |
zip -j -q bqpd-${{matrix.target}}.zip install/casadi/lib*bqpd*
- name: Upload files to a GitHub release
uses: svenstaro/upload-release-action@2.4.0
with:
overwrite: true
tag: perpetual
file: bqpd-${{matrix.target}}.zip
prerelease: true
repo_token: ${{ secrets.JGILLIS_RESTRICTED }}
repo_name: jgillis/restricted
matrix-arch-mac:
runs-on: ubuntu-20.04
steps:
- id: build-matrix
uses: jgillis/setup-build-matrix@v1.2.0-if
with:
config: |
matrix:
image: [macos-11]
operations:
- type: append
if: ${{ vars.BLESSED_REPO == 'yes' }}
matrix:
image: [macos-m1]
- run: echo ${{ steps.build-matrix.outputs.matrix }}
outputs:
matrix: ${{ steps.build-matrix.outputs.matrix }}
core-osx:
needs: [matrix-arch-mac]
runs-on: ${{matrix.image == 'macos-m1' && 'self-hosted' || matrix.image }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.matrix-arch-mac.outputs.matrix) }}
steps:
- run: echo "${{ vars.BLESSED_REPO }} ${{ vars.BLESSED_REPO }}"
- uses: casadi/action-setup-compiler@master
with:
cache-suffix: ''
target: ${{matrix.image == 'macos-m1' && 'arm64' || 'x86_64'}}
- run: brew install pkg-config
- uses: actions/checkout@v3.3.0
with:
repository: casadi/casadi
ref: uno
fetch-depth: 0 # for git-restore-mtime
- uses: chetan/git-restore-mtime-action@v1.2
- uses: dsaltares/fetch-gh-release-asset@1.1.0
with:
repo: jgillis/restricted
file: coinhsl-2022.11.09.zip
token: ${{ secrets.JGILLIS_RESTRICTED }}
- run: unzip coinhsl-2022.11.09.zip -d coinhsl
shell: bash
- uses: dsaltares/fetch-gh-release-asset@1.1.0
with:
repo: jgillis/restricted
file: bqpd.zip
token: ${{ secrets.JGILLIS_RESTRICTED }}
- run: unzip bqpd.zip
shell: bash
- run: ls && pwd
- name: Cache build dir
uses: actions/cache@v3.2.3
with:
key: core-build-${{matrix.image}}-${{env.cache-suffix}}
path: build
- name: Build
run: |
rm -f build/CMakeCache.txt
CC=${{ env.CC }} FC=${{ env.FC }} CXX=${{ env.CXX }} cmake -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/install -DCMAKE_OSX_SYSROOT=${{env.CONDA_BUILD_SYSROOT}} -Bbuild -DWITH_SELFCONTAINED=ON ${{env.build_flags}} ${{env.build_flags_mac}} ${{ contains(matrix.image,'m1') && env.build_flags_mac_m1 || ''}} ${{ contains(matrix.image,'macos-11') && env.build_flags_mac_intel || ''}} -DCMAKE_PREFIX_PATH=${{ github.workspace }}/mockups/cmake -DBUILD_HSL_SRC=${{ github.workspace }}/coinhsl/coinhsl-2022.11.09 -DBUILD_BQPD_SRC=${{ github.workspace }}/bqpd -H.
CC=${{ env.CC }} FC=${{ env.FC }} CXX=${{ env.CXX }} cmake --build build -v
cmake --build build --target install -v
- uses: jgillis/universal_grafter@master
with:
source_path: install/casadi
destination_path: install/casadi
search_paths: ${{env.COMPILER_LIB_SEARCH_PATH}}
skip_libs: 'filternothing'
- name: build archives
run: |
zip -j -q hsl-${{matrix.image}}.zip install/casadi/lib*hsl*
- name: Upload files to a GitHub release
uses: svenstaro/upload-release-action@2.4.0
with:
overwrite: true
tag: perpetual
file: hsl-${{matrix.image}}.zip
repo_token: ${{ secrets.JGILLIS_RESTRICTED }}
prerelease: true
repo_name: jgillis/restricted
- name: build archives
run: |
zip -j -q bqpd-${{matrix.image}}.zip install/casadi/lib*bqpd*
- name: Upload files to a GitHub release
uses: svenstaro/upload-release-action@2.4.0
with:
overwrite: true
tag: perpetual
file: bqpd-${{matrix.image}}.zip
repo_token: ${{ secrets.JGILLIS_RESTRICTED }}
prerelease: true
repo_name: jgillis/restricted