Skip to content

Update CMake, refactor CziReader/Writer, add validation #8

Update CMake, refactor CziReader/Writer, add validation

Update CMake, refactor CziReader/Writer, add validation #8

Workflow file for this run

name: Build for Ubuntu-x64
on:
push:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up MATLAB
uses: matlab-actions/setup-matlab@v2
- name: Run MATLAB script to give the header and library paths
# We run a MATLAB script, which writes the header and library paths the GITHUB_ENV file,
# which is a special file that can be used to set environment variables for subsequent steps.
uses: matlab-actions/run-command@v2
with:
command: |
headerPath = fullfile(matlabroot, 'extern', 'include');libPath = fullfile(matlabroot, 'extern', 'lib', computer('arch'));envFile = getenv('GITHUB_ENV');fid = fopen(envFile, 'a');fprintf(fid, 'MATLAB_HEADER_PATH=%s\n', headerPath);fprintf(fid, 'MATLAB_LIB_PATH=%s\n', libPath);fclose(fid);
- name: run build
shell: bash
run: |
mkdir build
cd build
#cmake .. -DCMAKE_BUILD_TYPE=Release -DMEXLIBCZI_HEADERS=$MATLAB_HEADER_PATH -DMEXLIBCZI_LIBS=$MATLAB_LIB_PATH
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . --config Release
- name: Prepare artifact
shell: bash
run: |
mkdir -p artifacts
name="MEXlibCZI-linux-x64-$(git describe --always)"
mkdir -p artifacts/${name}
cp build/MEXlibCZI/MEXlibCZI.mexa64 artifacts/${name}/
echo "artifactName=${name}" >> "$GITHUB_ENV"
echo "artifactPath=artifacts/${name}" >> "$GITHUB_ENV"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
path: ${{ env.artifactPath }}/
name: ${{ env.artifactName }}