Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push matlab binaries github action #335

Merged
merged 4 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 104 additions & 0 deletions .github/workflows/publish_matlab_binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Publish MATLAB binaries

on:
release:
types: [published]

env:
BUILD_FOLDER: build

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
version: [R2021b, R2022a, R2022b, R2023a, R2023b, R2024a]
include:
- os: ubuntu-latest
label: linux-64
prefix: /usr/share/miniconda3/envs/ezc3d
- os: macos-latest
label: osx-64
prefix: /Users/runner/miniconda3/envs/ezc3d
- os: windows-latest
label: win-64
prefix: C:\Miniconda3\envs\ezc3d
exclude:
- os: macos-latest
version: R2023b
- os: macos-latest
version: R2024a
name: ${{ matrix.label }}_${{ matrix.version }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores

- name: Setup environment
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true

- name: Print mamba info
run: |
mamba info
mamba list

- name: Install dependencies
run: |
mamba install cmake git pkgconfig -cconda-forge
mamba list
git submodule update --init --recursive

- name: Install MATLAB
uses: matlab-actions/setup-matlab@v2
with:
release: ${{ matrix.version }}

- name: Build ezc3d on UNIX
run: |
MAIN_FOLDER=`pwd`
cd
HOME=`pwd`
cd $MAIN_FOLDER
CONDA_ENV_PATH=$CONDA/envs/ezc3d
mkdir -p $MAIN_FOLDER/$BUILD_FOLDER
cd $MAIN_FOLDER/$BUILD_FOLDER
cmake -DCMAKE_INSTALL_PREFIX=$CONDA_ENV_PATH -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=OFF -DBUILD_DOC=OFF -DBUILD_EXAMPLE=OFF -DUSE_MATRIX_FAST_ACCESSOR=OFF -DBINDER_MATLAB=ON -DMatlab_ezc3d_INSTALL_DIR=$HOME -DBINDER_PYTHON3=OFF ..
make install -j${{ steps.cpu-cores.outputs.count }}
cd $MAIN_FOLDER
if: matrix.label != 'win-64'

- name: Build ezc3d on WINDOWS
run: |
MAIN_FOLDER=`pwd`
CONDA_ENV_PATH=$CONDA/envs/ezc3d
mkdir -p $BUILD_FOLDER
cd $BUILD_FOLDER
cmake -G"Visual Studio 17 2022" -Ax64 -DCMAKE_INSTALL_PREFIX=$CONDA_ENV_PATH -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=OFF -DBUILD_DOC=OFF -DBUILD_EXAMPLE=OFF -DUSE_MATRIX_FAST_ACCESSOR=OFF -DBINDER_MATLAB=ON -DMatlab_ezc3d_INSTALL_DIR=$HOME -DBINDER_PYTHON3=OFF ..
cmake --build . --config Release --target install -j${{ steps.cpu-cores.outputs.count }}
cd $MAIN_FOLDER
if: matrix.label == 'win-64'

- name: Build MATLAB archives
run: |
zip -r ezc3d_matlab.zip $HOME/ezc3d_matlab

- name: Upload files to a GitHub release
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "ezc3d_matlab_${{ matrix.label }}_${{ matrix.version }}.zip"
update_latest_release: true
verbose: true
overwrite: true
2 changes: 1 addition & 1 deletion .github/workflows/run_codecoverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
include:
- os: ubuntu-20.04
- os: ubuntu-latest
label: linux-64
prefix: /usr/share/miniconda3/envs/biorbd_eigen
name: ${{ matrix.label }}
Expand Down
100 changes: 100 additions & 0 deletions .github/workflows/run_matlab_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Run the Matlab tests

on: [pull_request]

env:
BUILD_FOLDER: build

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
version: [R2021b, R2022a, R2022b, R2023a, R2023b, R2024a]
include:
- os: ubuntu-latest
label: linux-64
prefix: /usr/share/miniconda3/envs/ezc3d
- os: macos-latest
label: osx-64
prefix: /Users/runner/miniconda3/envs/ezc3d
- os: windows-latest
label: win-64
prefix: C:\Miniconda3\envs\ezc3d
exclude:
- os: macos-latest
version: R2023b
- os: macos-latest
version: R2024a
name: ${{ matrix.label }}_${{ matrix.version }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores

- name: Setup environment
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true

- name: Print mamba info
run: |
mamba info
mamba list

- name: Install dependencies
run: |
mamba install cmake git pkgconfig -cconda-forge
mamba list
git submodule update --init --recursive

- name: Install MATLAB
uses: matlab-actions/setup-matlab@v2
with:
release: ${{ matrix.version }}

- name: Build ezc3d on UNIX
run: |
MAIN_FOLDER=`pwd`
cd
HOME=`pwd`
cd $MAIN_FOLDER
CONDA_ENV_PATH=$CONDA/envs/ezc3d
mkdir -p $MAIN_FOLDER/$BUILD_FOLDER
cd $MAIN_FOLDER/$BUILD_FOLDER
cmake -DCMAKE_INSTALL_PREFIX=$CONDA_ENV_PATH -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DBUILD_DOC=OFF -DBUILD_EXAMPLE=OFF -DUSE_MATRIX_FAST_ACCESSOR=OFF -DBINDER_MATLAB=ON -DMatlab_ezc3d_INSTALL_DIR=$HOME -DBINDER_PYTHON3=OFF ..
make install -j${{ steps.cpu-cores.outputs.count }}
cd $MAIN_FOLDER
if: matrix.label != 'win-64'

- name: Build ezc3d on WINDOWS
run: |
MAIN_FOLDER=`pwd`
CONDA_ENV_PATH=$CONDA/envs/ezc3d
mkdir -p $BUILD_FOLDER
cd $BUILD_FOLDER
cmake -G"Visual Studio 17 2022" -Ax64 -DCMAKE_INSTALL_PREFIX=$CONDA_ENV_PATH -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DBUILD_DOC=OFF -DBUILD_EXAMPLE=OFF -DUSE_MATRIX_FAST_ACCESSOR=OFF -DBINDER_MATLAB=ON -DMatlab_ezc3d_INSTALL_DIR=$HOME -DBINDER_PYTHON3=OFF ..
cmake --build . --config Release --target install -j${{ steps.cpu-cores.outputs.count }}
cd $MAIN_FOLDER
if: matrix.label == 'win-64'

- name: Run the MATLAB binder tests
run: |
MAIN_FOLDER=`pwd`
cd
HOME=`pwd`
cd $MAIN_FOLDER/test/matlab
cp $HOME/ezc3d_matlab/* .
# We cannot run the tests as we do not have a license. They are however run on octave
# matlab -batch test_binder_matlab.m
# matlab -batch test_binder_matlab_force_platform.m
cd $MAIN_FOLDER
2 changes: 1 addition & 1 deletion .github/workflows/run_octave_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
include:
- os: ubuntu-20.04
- os: ubuntu-latest
label: linux-64
prefix: /usr/share/miniconda3/envs/ezc3d
- os: macos-latest
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
include:
- os: ubuntu-20.04
- os: ubuntu-latest
label: linux-64
prefix: /usr/share/miniconda3/envs/ezc3d
- os: macos-latest
Expand Down Expand Up @@ -74,7 +74,6 @@ jobs:
- name: Build ezc3d WINDOWS
run: |
MAIN_FOLDER=`pwd`
echo ${{ matrix.prefix }}
CONDA_ENV_PATH=$CONDA/envs/ezc3d
mkdir -p $BUILD_FOLDER
cd $BUILD_FOLDER
Expand Down
Loading