@@ -11,156 +11,108 @@ on:
1111 types : ['released', 'prereleased']
1212
1313jobs :
14- build-linux :
15- runs-on : ubuntu-latest
16- env :
17- HOST : ' x86_64-centos7-linux-gnu'
18- TOOLS_VERSION : ' 0.1.0-beta3'
19- TOOLS_URL : ' https://github.com/tttapa/cross-python/releases/download'
20- steps :
21- - uses : actions/checkout@v4
22- with :
23- submodules : recursive
24- - name : Set up MATLAB
25- uses : matlab-actions/setup-matlab@64144ac4bb7c754f9ef7642f693671c873701c60
26- with :
27- release : R2020b
28- - name : Download toolchain
29- run : wget "${{ env.TOOLS_URL }}/${{ env.TOOLS_VERSION }}/full-${{ env.HOST }}.tar.xz" -O- | sudo tar xJ -C /opt
30- - name : Configure
31- run : |
32- host="${{ env.HOST }}"
33- staging="/opt/$host"
34- cmake -B build -S QPALM \
35- -D CMAKE_BUILD_TYPE=RelWithDebInfo \
36- -D QPALM_WITH_MEX=On \
37- -D CMAKE_POSITION_INDEPENDENT_CODE=On \
38- -D CMAKE_C_COMPILER="$staging/x-tools/$host/bin/$host-gcc" \
39- -D CMAKE_CXX_COMPILER="$staging/x-tools/$host/bin/$host-g++" \
40- -D CMAKE_Fortran_COMPILER="$staging/x-tools/$host/bin/$host-gfortran"
41- env :
42- CXXFLAGS : " -march=skylake -static-libstdc++ -static-libgcc"
43- LDFLAGS : " -static-libstdc++ -static-libgcc"
44- CFLAGS : " -march=skylake -static-libgcc"
45- - name : Build
46- run : |
47- cmake --build build \
48- --config RelWithDebInfo \
49- -j
50- - name : Install
51- run : |
52- cmake --install build \
53- --config RelWithDebInfo \
54- --component mex_interface \
55- --prefix staging
56- - name : Package
57- run : |
58- zip -r ../qpalm-matlab-glnxa64.zip ./*
59- working-directory : staging
60- - name : Upload
61- uses : actions/upload-artifact@v4
62- with :
63- name : qpalm-matlab-glnxa64
64- path : qpalm-matlab-glnxa64.zip
65- - name : Release
66- if : ${{ github.event.action == 'released' || github.event.action == 'prereleased' }}
67- uses : softprops/action-gh-release@73e673b2dead314c6b971e962dd8e84e230ae99d
68- with :
69- files : qpalm-matlab-glnxa64.zip
70-
71- build-macos :
72- runs-on : macos-${{ matrix.macos-version }}
14+ build :
7315 strategy :
7416 matrix :
75- macos-version : ['13', '14']
7617 include :
77- - macos-version : ' 14'
78- arch : ' maca64'
18+ - os : ubuntu-22.04
19+ name : glnxa64
20+ matlab-release : ' R2021a'
21+ host : x86_64-bionic-linux-gnu
22+ - os : macos-14
23+ name : maca64
7924 matlab-release : ' R2023b'
80- - macos-version : ' 13'
81- arch : ' maci64'
25+ host : macos
26+ - os : macos-13
27+ name : maci64
8228 matlab-release : ' R2021a'
29+ host : macos
30+ fail-fast : false
31+ runs-on : ${{ matrix.os }}
8332 steps :
8433 - uses : actions/checkout@v4
8534 with :
8635 submodules : recursive
36+
37+ - name : Setup Conan and sccache
38+ uses : ./.github/workflows/setup-conan
39+ with :
40+ python-version : ' 3.12'
41+ cache-key : build-matlab-${{ matrix.name }}
42+
8743 - name : Set up MATLAB
8844 uses : matlab-actions/setup-matlab@64144ac4bb7c754f9ef7642f693671c873701c60
45+ id : matlab
8946 with :
9047 release : ${{ matrix.matlab-release }}
91- - name : Configure
92- run : |
93- cmake -B build -S QPALM \
94- -D CMAKE_BUILD_TYPE=RelWithDebInfo \
95- -D QPALM_WITH_MEX=On \
96- -D CMAKE_POSITION_INDEPENDENT_CODE=On
48+
9749 - name : Build
98- run : |
99- cmake --build build \
100- --config RelWithDebInfo \
101- -j
102- - name : Install
103- run : |
104- cmake --install build \
105- --config RelWithDebInfo \
106- --component mex_interface \
107- --prefix staging
50+ run : >
51+ bash scripts/ci/build-matlab.sh
52+ "${{ steps.matlab.outputs.matlabroot }}" ${{ matrix.host }} . staging
53+
10854 - name : Package
109- run : |
110- zip -r ../qpalm-matlab-${{ matrix.arch }}.zip ./*
55+ run : zip -r ../qpalm-matlab-${{ matrix.name }}.zip ./*
11156 working-directory : staging
57+
11258 - name : Upload
11359 uses : actions/upload-artifact@v4
11460 with :
115- name : qpalm-matlab-${{ matrix.arch }}
116- path : qpalm-matlab-${{ matrix.arch }}.zip
61+ name : qpalm-matlab-${{ matrix.name }}
62+ path : qpalm-matlab-${{ matrix.name }}.zip
11763 - name : Release
11864 if : ${{ github.event.action == 'released' || github.event.action == 'prereleased' }}
119- uses : softprops/action-gh-release@73e673b2dead314c6b971e962dd8e84e230ae99d
65+ uses : softprops/action-gh-release@17cd0d34deddf848fc0e7d9be5202c148c270a0a
12066 with :
121- files : qpalm-matlab-${{ matrix.arch }}.zip
67+ files : qpalm-matlab-${{ matrix.name }}.zip
68+
69+ - run : conan cache clean
12270
12371 build-windows :
124- runs-on : windows-latest
72+ strategy :
73+ matrix :
74+ include :
75+ - os : windows-2022
76+ name : win64
77+ matlab-release : ' R2021a'
78+ host : amd64
79+ runs-on : ${{ matrix.os }}
12580 steps :
12681 - uses : actions/checkout@v4
12782 with :
12883 submodules : recursive
84+
85+ - name : Setup Conan and sccache
86+ uses : ./.github/workflows/setup-conan
87+ with :
88+ python-version : ' 3.12'
89+ cache-key : build-matlab-${{ matrix.name }}
90+
12991 - name : Set up MATLAB
13092 uses : matlab-actions/setup-matlab@64144ac4bb7c754f9ef7642f693671c873701c60
93+ id : matlab
13194 with :
132- release : R2021a
133- - name : Configure
134- shell : pwsh
135- run : |
136- cmake -B build -S QPALM `
137- -D CMAKE_BUILD_TYPE=RelWithDebInfo `
138- -D QPALM_WITH_MEX=On `
139- -D CMAKE_POSITION_INDEPENDENT_CODE=On
95+ release : ${{ matrix.matlab-release }}
96+
14097 - name : Build
141- shell : pwsh
142- run : |
143- cmake --build build `
144- --config RelWithDebInfo `
145- -j
146- - name : Install
147- shell : pwsh
148- run : |
149- cmake --install build `
150- --config RelWithDebInfo `
151- --component mex_interface `
152- --prefix staging
98+ shell : cmd
99+ run : >
100+ call .\scripts\ci\build-matlab-windows.bat
101+ "${{ steps.matlab.outputs.matlabroot }}" "${{ matrix.host }}" "." "staging"
102+
153103 - name : Package
154104 shell : pwsh
155- run : |
156- Compress-Archive -Path staging\* qpalm-matlab-win64.zip
105+ run : Compress-Archive -Path staging\* qpalm-matlab-${{ matrix.name }}.zip
106+
157107 - name : Upload
158108 uses : actions/upload-artifact@v4
159109 with :
160- name : qpalm-matlab-win64
161- path : qpalm-matlab-win64 .zip
110+ name : qpalm-matlab-${{ matrix.name }}
111+ path : qpalm-matlab-${{ matrix.name }} .zip
162112 - name : Release
163113 if : ${{ github.event.action == 'released' || github.event.action == 'prereleased' }}
164- uses : softprops/action-gh-release@73e673b2dead314c6b971e962dd8e84e230ae99d
114+ uses : softprops/action-gh-release@17cd0d34deddf848fc0e7d9be5202c148c270a0a
165115 with :
166- files : qpalm-matlab-win64.zip
116+ files : qpalm-matlab-${{ matrix.name }}.zip
117+
118+ - run : conan cache clean
0 commit comments