|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 2 | +# or more contributor license agreements. See the NOTICE file |
| 3 | +# distributed with this work for additional information |
| 4 | +# regarding copyright ownership. The ASF licenses this file |
| 5 | +# to you under the Apache License, Version 2.0 (the |
| 6 | +# "License"); you may not use this file except in compliance |
| 7 | +# with the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, |
| 12 | +# software distributed under the License is distributed on an |
| 13 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | +# KIND, either express or implied. See the License for the |
| 15 | +# specific language governing permissions and limitations |
| 16 | +# under the License. |
| 17 | + |
| 18 | +{% import 'macros.jinja' as macros with context %} |
| 19 | + |
| 20 | +{{ macros.github_header() }} |
| 21 | + |
| 22 | +jobs: |
| 23 | + |
| 24 | + ubuntu: |
| 25 | + name: AMD64 Ubuntu 20.04 MATLAB |
| 26 | + runs-on: ubuntu-20.04 |
| 27 | + steps: |
| 28 | + {{ macros.github_checkout_arrow()|indent }} |
| 29 | + - name: Install ninja-build |
| 30 | + run: sudo apt-get update && sudo apt-get install ninja-build |
| 31 | + - name: Install MATLAB |
| 32 | + uses: matlab-actions/setup-matlab@v1 |
| 33 | + with: |
| 34 | + release: R2023a |
| 35 | + - name: Build MATLAB Interface |
| 36 | + env: |
| 37 | + {{ macros.github_set_sccache_envvars()|indent(8) }} |
| 38 | + run: arrow/ci/scripts/matlab_build.sh $(pwd)/arrow |
| 39 | + - name: Change shared library dependency name |
| 40 | + # MATLAB's programmatic packaging interface does not properly |
| 41 | + # include symbolic link files in the package MLTBX - this is a |
| 42 | + # bug. As a temporary workaround, change the expected name of the |
| 43 | + # Arrow C++ library which libarrowproxy.so depends on. For example, |
| 44 | + # change libarrow.so.1500 to libarrow.so.1500.0.0. |
| 45 | + run: | |
| 46 | + pushd arrow/matlab/install/arrow_matlab/+libmexclass/+proxy/ |
| 47 | + SYMLINK_ARROW_LIB="$(find . -name 'libarrow.so.*' -type l | xargs basename)" |
| 48 | + REGULAR_ARROW_LIB="$(echo libarrow.so.*.*)" |
| 49 | + echo "SYMLINK_ARROW_LIB = ${SYMLINK_ARROW_LIB}" |
| 50 | + echo "REGULAR_ARROW_LIB = ${REGULAR_ARROW_LIB}" |
| 51 | + patchelf --replace-needed $SYMLINK_ARROW_LIB $REGULAR_ARROW_LIB libarrowproxy.so |
| 52 | + popd |
| 53 | + - name: Compress into single artifact |
| 54 | + run: tar -cvzf matlab-arrow-ubuntu.tar.gz arrow/matlab/install/arrow_matlab |
| 55 | + - name: Upload artifacts |
| 56 | + uses: actions/upload-artifact@v4 |
| 57 | + with: |
| 58 | + name: matlab-arrow-ubuntu.tar.gz |
| 59 | + path: matlab-arrow-ubuntu.tar.gz |
| 60 | + |
| 61 | + macos: |
| 62 | + name: AMD64 macOS 12 MATLAB |
| 63 | + runs-on: macos-latest |
| 64 | + steps: |
| 65 | + {{ macros.github_checkout_arrow()|indent }} |
| 66 | + - name: Install ninja-build |
| 67 | + run: brew install ninja |
| 68 | + - name: Install MATLAB |
| 69 | + uses: matlab-actions/setup-matlab@v1 |
| 70 | + with: |
| 71 | + release: R2023a |
| 72 | + - name: Build MATLAB Interface |
| 73 | + env: |
| 74 | + {{ macros.github_set_sccache_envvars()|indent(8) }} |
| 75 | + run: arrow/ci/scripts/matlab_build.sh $(pwd)/arrow |
| 76 | + - name: Change shared library dependency name |
| 77 | + # MATLAB's programmatic packaging interface does not properly |
| 78 | + # include symbolic link files in the package MLTBX - this is a |
| 79 | + # bug. As a temporary workaround, change the expected name of the |
| 80 | + # Arrow C++ library which libarrowproxy.dylib depends on. |
| 81 | + # For example, change libarrow.1500.dylib to libarrow.1500.0.0.dylib. |
| 82 | + run: | |
| 83 | + pushd arrow/matlab/install/arrow_matlab/+libmexclass/+proxy |
| 84 | + SYMLINK_ARROW_LIB="$(find . -name 'libarrow.*.dylib' -type l | xargs basename)" |
| 85 | + REGULAR_ARROW_LIB="$(echo libarrow.*.*.dylib)" |
| 86 | + echo "SYMLINK_ARROW_LIB = ${SYMLINK_ARROW_LIB}" |
| 87 | + echo "REGULAR_ARROW_LIB = ${REGULAR_ARROW_LIB}" |
| 88 | + install_name_tool -change @rpath/$SYMLINK_ARROW_LIB @rpath/$REGULAR_ARROW_LIB libarrowproxy.dylib |
| 89 | + popd |
| 90 | + - name: Compress into single artifact |
| 91 | + run: tar -cvzf matlab-arrow-macos.tar.gz arrow/matlab/install/arrow_matlab |
| 92 | + - name: Upload artifacts |
| 93 | + uses: actions/upload-artifact@v4 |
| 94 | + with: |
| 95 | + name: matlab-arrow-macos.tar.gz |
| 96 | + path: matlab-arrow-macos.tar.gz |
| 97 | + |
| 98 | + windows: |
| 99 | + name: AMD64 Windows 2022 MATLAB |
| 100 | + runs-on: windows-2022 |
| 101 | + steps: |
| 102 | + {{ macros.github_checkout_arrow()|indent }} |
| 103 | + - name: Install MATLAB |
| 104 | + uses: matlab-actions/setup-matlab@v1 |
| 105 | + with: |
| 106 | + release: R2023a |
| 107 | + - name: Install sccache |
| 108 | + shell: bash |
| 109 | + run: arrow/ci/scripts/install_sccache.sh pc-windows-msvc $(pwd)/sccache |
| 110 | + - name: Build MATLAB Interface |
| 111 | + shell: cmd |
| 112 | + env: |
| 113 | + {{ macros.github_set_sccache_envvars()|indent(8) }} |
| 114 | + run: | |
| 115 | + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64 |
| 116 | + bash -c "arrow/ci/scripts/matlab_build.sh $(pwd)/arrow" |
| 117 | + - name: Compress into single artifact |
| 118 | + shell: bash |
| 119 | + run: tar -cvzf matlab-arrow-windows.tar.gz arrow/matlab/install/arrow_matlab |
| 120 | + - name: Upload artifacts |
| 121 | + uses: actions/upload-artifact@v4 |
| 122 | + with: |
| 123 | + name: matlab-arrow-windows.tar.gz |
| 124 | + path: matlab-arrow-windows.tar.gz |
| 125 | + |
| 126 | + package-mltbx: |
| 127 | + name: Package MATLAB Toolbox (MLTBX) Files |
| 128 | + runs-on: ubuntu-latest |
| 129 | + needs: |
| 130 | + - ubuntu |
| 131 | + - macos |
| 132 | + - windows |
| 133 | + steps: |
| 134 | + {{ macros.github_checkout_arrow(fetch_depth=0)|indent }} |
| 135 | + - name: Download Artifacts |
| 136 | + uses: actions/download-artifact@v4 |
| 137 | + with: |
| 138 | + path: artifacts-downloaded |
| 139 | + - name: Decompress Artifacts |
| 140 | + run: | |
| 141 | + mv artifacts-downloaded/*/*.tar.gz . |
| 142 | + tar -xzvf matlab-arrow-ubuntu.tar.gz |
| 143 | + tar -xzvf matlab-arrow-macos.tar.gz |
| 144 | + tar -xzvf matlab-arrow-windows.tar.gz |
| 145 | + - name: Copy LICENSE.txt and NOTICE.txt for packaging |
| 146 | + run: | |
| 147 | + cp arrow/LICENSE.txt arrow/matlab/install/arrow_matlab/LICENSE.txt |
| 148 | + cp arrow/NOTICE.txt arrow/matlab/install/arrow_matlab/NOTICE.txt |
| 149 | + - name: Install MATLAB |
| 150 | + uses: matlab-actions/setup-matlab@v1 |
| 151 | + with: |
| 152 | + release: R2023a |
| 153 | + - name: Run commands |
| 154 | + env: |
| 155 | + MATLABPATH: arrow/matlab/tools |
| 156 | + ARROW_MATLAB_TOOLBOX_FOLDER: arrow/matlab/install/arrow_matlab |
| 157 | + ARROW_MATLAB_TOOLBOX_OUTPUT_FOLDER: artifacts/matlab-dist |
| 158 | + ARROW_MATLAB_TOOLBOX_VERSION: {{ arrow.no_rc_version }} |
| 159 | + uses: matlab-actions/run-command@v1 |
| 160 | + with: |
| 161 | + command: packageMatlabInterface |
| 162 | + {{ macros.github_upload_releases(["artifacts/matlab-dist/*.mltbx"])|indent }} |
0 commit comments