From 097d3753fa05dffa746b2d21b600c23992ab300d Mon Sep 17 00:00:00 2001 From: Pariterre Date: Mon, 12 Aug 2024 10:40:55 -0400 Subject: [PATCH 01/22] Trying to add matlab to github actions --- .github/workflows/run_matlab_tests.yml | 73 ++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/run_matlab_tests.yml diff --git a/.github/workflows/run_matlab_tests.yml b/.github/workflows/run_matlab_tests.yml new file mode 100644 index 00000000..328ff8b7 --- /dev/null +++ b/.github/workflows/run_matlab_tests.yml @@ -0,0 +1,73 @@ +name: Run the Matlab tests + +on: [pull_request] + +env: + BUILD_FOLDER: build + EXAMPLES_FOLDER: examples + +jobs: + build: + strategy: + matrix: + include: + - os: ubuntu-22.04 + label: linux-64 + prefix: /usr/share/miniconda3/envs/ezc3d + name: ${{ matrix.label }} + 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 + + - name: Build ezc3d + 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=ON -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 + + - name: Run the Matlab binder tests + run: | + MAIN_FOLDER=`pwd` + cd + HOME=`pwd` + cd $MAIN_FOLDER/test/matlab + cp $HOME/ezc3d_matlab/* . + matlab test_binder_matlab.m + matlab test_binder_matlab_force_platform.m + cd $MAIN_FOLDER From 30bfb3fb6ec4f96f6893f6a746f2d82e081969dd Mon Sep 17 00:00:00 2001 From: Pariterre Date: Mon, 12 Aug 2024 10:50:02 -0400 Subject: [PATCH 02/22] Removed display when running matlab linux tests --- .github/workflows/run_matlab_tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/run_matlab_tests.yml b/.github/workflows/run_matlab_tests.yml index 328ff8b7..3d921a7d 100644 --- a/.github/workflows/run_matlab_tests.yml +++ b/.github/workflows/run_matlab_tests.yml @@ -68,6 +68,7 @@ jobs: HOME=`pwd` cd $MAIN_FOLDER/test/matlab cp $HOME/ezc3d_matlab/* . + export DISPLAY=:0.0 matlab test_binder_matlab.m matlab test_binder_matlab_force_platform.m cd $MAIN_FOLDER From 2850fe6d6e21e6011ed1d515d04e39267e5216e0 Mon Sep 17 00:00:00 2001 From: Pariterre Date: Mon, 12 Aug 2024 10:56:16 -0400 Subject: [PATCH 03/22] Same --- .github/workflows/run_matlab_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_matlab_tests.yml b/.github/workflows/run_matlab_tests.yml index 3d921a7d..e10476fc 100644 --- a/.github/workflows/run_matlab_tests.yml +++ b/.github/workflows/run_matlab_tests.yml @@ -69,6 +69,6 @@ jobs: cd $MAIN_FOLDER/test/matlab cp $HOME/ezc3d_matlab/* . export DISPLAY=:0.0 - matlab test_binder_matlab.m - matlab test_binder_matlab_force_platform.m + matlab -r test_binder_matlab.m + matlab -r test_binder_matlab_force_platform.m cd $MAIN_FOLDER From 46610942d937d62f4456e7bbf2f39c9960d9d008 Mon Sep 17 00:00:00 2001 From: Pariterre Date: Mon, 12 Aug 2024 10:59:55 -0400 Subject: [PATCH 04/22] again --- .github/workflows/run_matlab_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_matlab_tests.yml b/.github/workflows/run_matlab_tests.yml index e10476fc..30e647b0 100644 --- a/.github/workflows/run_matlab_tests.yml +++ b/.github/workflows/run_matlab_tests.yml @@ -69,6 +69,6 @@ jobs: cd $MAIN_FOLDER/test/matlab cp $HOME/ezc3d_matlab/* . export DISPLAY=:0.0 - matlab -r test_binder_matlab.m - matlab -r test_binder_matlab_force_platform.m + matlab -batch test_binder_matlab.m + matlab -batch test_binder_matlab_force_platform.m cd $MAIN_FOLDER From 4ad8157b88ddde55d6a2d02bd1d168355bced66e Mon Sep 17 00:00:00 2001 From: Pariterre Date: Mon, 12 Aug 2024 11:08:13 -0400 Subject: [PATCH 05/22] Tests cannot be run for Matlab (lack of licence) --- .github/workflows/run_matlab_tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run_matlab_tests.yml b/.github/workflows/run_matlab_tests.yml index 30e647b0..e917f2e7 100644 --- a/.github/workflows/run_matlab_tests.yml +++ b/.github/workflows/run_matlab_tests.yml @@ -68,7 +68,7 @@ jobs: HOME=`pwd` cd $MAIN_FOLDER/test/matlab cp $HOME/ezc3d_matlab/* . - export DISPLAY=:0.0 - matlab -batch test_binder_matlab.m - matlab -batch test_binder_matlab_force_platform.m + # 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 From 3db13d2fb4715bac5b7aa22f06d581f51f65eb91 Mon Sep 17 00:00:00 2001 From: Pariterre Date: Mon, 12 Aug 2024 11:19:38 -0400 Subject: [PATCH 06/22] Testing auto upload for MATLAB --- .github/workflows/run_matlab_tests.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_matlab_tests.yml b/.github/workflows/run_matlab_tests.yml index e917f2e7..b72d639d 100644 --- a/.github/workflows/run_matlab_tests.yml +++ b/.github/workflows/run_matlab_tests.yml @@ -57,11 +57,11 @@ jobs: 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=ON -DBUILD_DOC=OFF -DBUILD_EXAMPLE=OFF -DUSE_MATRIX_FAST_ACCESSOR=OFF -DBINDER_MATLAB=ON -DMatlab_ezc3d_INSTALL_DIR=$HOME -DBINDER_PYTHON3=OFF .. + cmake -DCMAKE_INSTALL_PREFIX=$CONDA_ENV_PATH -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTS=ON -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 - - name: Run the Matlab binder tests + - name: Run the MATLAB binder tests run: | MAIN_FOLDER=`pwd` cd @@ -72,3 +72,15 @@ jobs: # matlab -batch test_binder_matlab.m # matlab -batch test_binder_matlab_force_platform.m cd $MAIN_FOLDER + + - name: Build MATLAB archives + run: | + zip -r ezc3d_matlab.zip ezc3d_matlab + + - name: Upload files to a GitHub release + uses: svenstaro/upload-release-action@2.4.0 + with: + overwrite: true + tag: nightly-coucou + file: ezc3d_matlab.zip + prerelease: true \ No newline at end of file From d1f77e4a493bbf54bfdb9497ce3b6da8bd1ecc52 Mon Sep 17 00:00:00 2001 From: Pariterre Date: Mon, 12 Aug 2024 11:24:03 -0400 Subject: [PATCH 07/22] Forgot a cd --- .github/workflows/run_matlab_tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/run_matlab_tests.yml b/.github/workflows/run_matlab_tests.yml index b72d639d..aa75af73 100644 --- a/.github/workflows/run_matlab_tests.yml +++ b/.github/workflows/run_matlab_tests.yml @@ -75,6 +75,7 @@ jobs: - name: Build MATLAB archives run: | + cd $HOME zip -r ezc3d_matlab.zip ezc3d_matlab - name: Upload files to a GitHub release From f5588824d5c15107e54847215c4d9ec55120d953 Mon Sep 17 00:00:00 2001 From: Pariterre Date: Mon, 12 Aug 2024 11:47:04 -0400 Subject: [PATCH 08/22] Trying another toolchain for matlab upload --- .github/workflows/run_matlab_tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run_matlab_tests.yml b/.github/workflows/run_matlab_tests.yml index aa75af73..67826d6f 100644 --- a/.github/workflows/run_matlab_tests.yml +++ b/.github/workflows/run_matlab_tests.yml @@ -79,9 +79,9 @@ jobs: zip -r ezc3d_matlab.zip ezc3d_matlab - name: Upload files to a GitHub release - uses: svenstaro/upload-release-action@2.4.0 + uses: xresloader/upload-to-github-release@v1 with: + file: "ezc3d_matlab.zip" overwrite: true - tag: nightly-coucou - file: ezc3d_matlab.zip - prerelease: true \ No newline at end of file + update_latest_release: true + \ No newline at end of file From 9465435596086b8c5f448bf0dc5b51b679058a38 Mon Sep 17 00:00:00 2001 From: Pariterre Date: Mon, 12 Aug 2024 11:53:26 -0400 Subject: [PATCH 09/22] Wrong path --- .github/workflows/run_matlab_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_matlab_tests.yml b/.github/workflows/run_matlab_tests.yml index 67826d6f..36abc6b6 100644 --- a/.github/workflows/run_matlab_tests.yml +++ b/.github/workflows/run_matlab_tests.yml @@ -81,7 +81,7 @@ jobs: - name: Upload files to a GitHub release uses: xresloader/upload-to-github-release@v1 with: - file: "ezc3d_matlab.zip" + file: "$HOME/ezc3d_matlab.zip" + verbose: true overwrite: true update_latest_release: true - \ No newline at end of file From 99071f64061aac0e8ba40cf431a1290041535b39 Mon Sep 17 00:00:00 2001 From: Pariterre Date: Mon, 12 Aug 2024 11:59:49 -0400 Subject: [PATCH 10/22] Again --- .github/workflows/run_matlab_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_matlab_tests.yml b/.github/workflows/run_matlab_tests.yml index 36abc6b6..69f83650 100644 --- a/.github/workflows/run_matlab_tests.yml +++ b/.github/workflows/run_matlab_tests.yml @@ -76,7 +76,7 @@ jobs: - name: Build MATLAB archives run: | cd $HOME - zip -r ezc3d_matlab.zip ezc3d_matlab + zip -r $HOME/ezc3d_matlab.zip ezc3d_matlab - name: Upload files to a GitHub release uses: xresloader/upload-to-github-release@v1 From 2d7954491f0cdf1d8ce3f80e613ecea2f499e878 Mon Sep 17 00:00:00 2001 From: Pariterre Date: Mon, 12 Aug 2024 12:05:10 -0400 Subject: [PATCH 11/22] Again --- .github/workflows/run_matlab_tests.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run_matlab_tests.yml b/.github/workflows/run_matlab_tests.yml index 69f83650..f9c57014 100644 --- a/.github/workflows/run_matlab_tests.yml +++ b/.github/workflows/run_matlab_tests.yml @@ -75,13 +75,12 @@ jobs: - name: Build MATLAB archives run: | - cd $HOME - zip -r $HOME/ezc3d_matlab.zip ezc3d_matlab + zip -r ezc3d_matlab.zip $HOME/ezc3d_matlab - name: Upload files to a GitHub release uses: xresloader/upload-to-github-release@v1 with: - file: "$HOME/ezc3d_matlab.zip" + file: "ezc3d_matlab.zip" verbose: true overwrite: true update_latest_release: true From 14b939129be3b5d1048e2c6ace93916c694aaaec Mon Sep 17 00:00:00 2001 From: Pariterre Date: Mon, 12 Aug 2024 12:09:29 -0400 Subject: [PATCH 12/22] Added Env --- .github/workflows/run_matlab_tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/run_matlab_tests.yml b/.github/workflows/run_matlab_tests.yml index f9c57014..dc606279 100644 --- a/.github/workflows/run_matlab_tests.yml +++ b/.github/workflows/run_matlab_tests.yml @@ -79,6 +79,8 @@ jobs: - name: Upload files to a GitHub release uses: xresloader/upload-to-github-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: file: "ezc3d_matlab.zip" verbose: true From 27318814c89ee815637a9c78aa0949181c0fb2af Mon Sep 17 00:00:00 2001 From: Pariterre Date: Mon, 12 Aug 2024 13:16:47 -0400 Subject: [PATCH 13/22] Quicken for testing --- .github/workflows/run_codecoverage.yml | 61 -------------- .github/workflows/run_matlab_tests.yml | 85 +++++++++---------- .github/workflows/run_octave_tests.yml | 72 ---------------- .github/workflows/run_tests.yml | 109 ------------------------- 4 files changed, 44 insertions(+), 283 deletions(-) delete mode 100644 .github/workflows/run_codecoverage.yml delete mode 100644 .github/workflows/run_octave_tests.yml delete mode 100644 .github/workflows/run_tests.yml diff --git a/.github/workflows/run_codecoverage.yml b/.github/workflows/run_codecoverage.yml deleted file mode 100644 index b7e8cfec..00000000 --- a/.github/workflows/run_codecoverage.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Code coverage - -on: [pull_request] - -env: - BUILD_FOLDER: build - EXAMPLES_FOLDER: examples - -jobs: - build: - strategy: - matrix: - include: - - os: ubuntu-20.04 - label: linux-64 - prefix: /usr/share/miniconda3/envs/biorbd_eigen - name: ${{ matrix.label }} - runs-on: ${{ matrix.os }} - defaults: - run: - shell: bash -l {0} - steps: - - uses: actions/checkout@v2 - - - 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 - activate-environment: ezc3d - environment-file: environment.yml - - - name: Print mamba info - run: | - mamba info - mamba list - - - name: Install code coverage dependencies - run: | - mamba install cmake git pkgconfig codecov lcov -cconda-forge - mamba list - git submodule update --init --recursive - - - name: Perform code coverage - run: | - MAIN_FOLDER=`pwd` - CONDA_ENV_PATH=$CONDA/envs/ezc3d - mkdir -p $BUILD_FOLDER - cd $BUILD_FOLDER - cmake -DCMAKE_INSTALL_PREFIX=$CONDA_ENV_PATH -DCMAKE_BUILD_TYPE=Coverage -DBUILD_TESTS=ON -DBUILD_EXAMPLE=OFF -DBUILD_DOC=OFF -DUSE_MATRIX_FAST_ACCESSOR=OFF -DBINDER_PYTHON3=OFF .. - make ezc3d_coverage -j${{ steps.cpu-cores.outputs.count }} - lcov --directory . --capture --output-file coverage.info - lcov --remove coverage.info '/usr/*' --output-file coverage.info - lcov --list coverage.info - bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports" - cd $MAIN_FOLDER diff --git a/.github/workflows/run_matlab_tests.yml b/.github/workflows/run_matlab_tests.yml index dc606279..ea7d401e 100644 --- a/.github/workflows/run_matlab_tests.yml +++ b/.github/workflows/run_matlab_tests.yml @@ -27,55 +27,58 @@ jobs: 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: 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: 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 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 + # - name: Install MATLAB + # uses: matlab-actions/setup-matlab@v2 - - name: Build ezc3d - 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=ON -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 + # - name: Build ezc3d + # 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=ON -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 - - 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 + # - 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 + # - name: Build MATLAB archives + # run: | + # zip -r ezc3d_matlab.zip $HOME/ezc3d_matlab - name: Build MATLAB archives run: | - zip -r ezc3d_matlab.zip $HOME/ezc3d_matlab + zip -r ezc3d_matlab.zip README.md - name: Upload files to a GitHub release uses: xresloader/upload-to-github-release@v1 diff --git a/.github/workflows/run_octave_tests.yml b/.github/workflows/run_octave_tests.yml deleted file mode 100644 index 7db171c5..00000000 --- a/.github/workflows/run_octave_tests.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: Run the Octave tests - -on: [pull_request] - -env: - BUILD_FOLDER: build - EXAMPLES_FOLDER: examples - -jobs: - build: - strategy: - matrix: - include: - - os: ubuntu-20.04 - label: linux-64 - prefix: /usr/share/miniconda3/envs/ezc3d - - os: macos-latest - label: osx-64 - prefix: /Users/runner/miniconda3/envs/ezc3d - name: ${{ matrix.label }} - runs-on: ${{ matrix.os }} - defaults: - run: - shell: bash -l {0} - steps: - - uses: actions/checkout@v2 - - - 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 octave -cconda-forge - mamba list - git submodule update --init --recursive - - - name: Build ezc3d - 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=ON -DBUILD_DOC=OFF -DBUILD_EXAMPLE=OFF -DUSE_MATRIX_FAST_ACCESSOR=OFF -DBINDER_OCTAVE=ON -DOctave_ezc3d_INSTALL_DIR=$HOME -DBINDER_PYTHON3=OFF .. - make install -j${{ steps.cpu-cores.outputs.count }} - cd $MAIN_FOLDER - - - name: Run the Octave binder tests - run: | - MAIN_FOLDER=`pwd` - cd - HOME=`pwd` - cd $MAIN_FOLDER/test/matlab - cp $HOME/ezc3d_octave/* . - octave test_binder_matlab.m - octave test_binder_matlab_force_platform.m - cd $MAIN_FOLDER diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml deleted file mode 100644 index 9e220220..00000000 --- a/.github/workflows/run_tests.yml +++ /dev/null @@ -1,109 +0,0 @@ -name: Run the tests - -on: [pull_request] - -env: - BUILD_FOLDER: build - EXAMPLES_FOLDER: examples - -jobs: - build: - strategy: - matrix: - include: - - os: ubuntu-20.04 - 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 - name: ${{ matrix.label }} - runs-on: ${{ matrix.os }} - defaults: - run: - shell: bash -l {0} - steps: - - uses: actions/checkout@v2 - - - 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 - activate-environment: ezc3d - environment-file: environment.yml - - - name: Print mamba info - run: | - mamba info - mamba list - - - name: Install extra common dependencies - run: | - mamba install cmake git pkgconfig swig numpy pytest -cconda-forge - mamba list - git submodule update --init --recursive - - - name: Build ezc3d UNIX - run: | - MAIN_FOLDER=`pwd` - 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=ON -DBUILD_DOC=OFF -DBUILD_EXAMPLE=ON -DUSE_MATRIX_FAST_ACCESSOR=OFF -DBINDER_OCTAVE=OFF -DBINDER_PYTHON3=ON .. - make install -j${{ steps.cpu-cores.outputs.count }} - cd $MAIN_FOLDER - if: matrix.label != 'win-64' - - - name: Run tests UNIX - run: | - MAIN_FOLDER=`pwd` - cd $MAIN_FOLDER/$BUILD_FOLDER/test - ./ezc3d_test - cd $MAIN_FOLDER - if: matrix.label != 'win-64' - - - name: Build ezc3d WINDOWS - run: | - MAIN_FOLDER=`pwd` - echo ${{ matrix.prefix }} - 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=ON -DBUILD_DOC=OFF -DBUILD_EXAMPLE=ON -DUSE_MATRIX_FAST_ACCESSOR=OFF -DBINDER_OCTAVE=OFF -DBINDER_PYTHON3=ON .. - cmake --build . --config Release --target install -j${{ steps.cpu-cores.outputs.count }} - cd $MAIN_FOLDER - if: matrix.label == 'win-64' - - - name: Run tests WINDOWS - run: | - MAIN_FOLDER=`pwd` - cd $MAIN_FOLDER/$BUILD_FOLDER/test - cp $MAIN_FOLDER/$BUILD_FOLDER/Release/*.dll . - cp $MAIN_FOLDER/$BUILD_FOLDER/bin/Release/*.dll . - cp Release/ezc3d_test.exe . - ./ezc3d_test.exe - cd $MAIN_FOLDER - if: matrix.label == 'win-64' - - - name: Run python binder tests - run: | - MAIN_FOLDER=`pwd` - cd $MAIN_FOLDER/$BUILD_FOLDER - pytest -v --color=yes $MAIN_FOLDER/test/python3 - cd $MAIN_FOLDER - - - name: Test installed version of python - run: | - MAIN_FOLDER=`pwd` - cd - python -c "import ezc3d" - cd $MAIN_FOLDER From cf345ec7ce4c20e6d08e64f0458267b19efe6b33 Mon Sep 17 00:00:00 2001 From: Pariterre Date: Mon, 12 Aug 2024 13:37:15 -0400 Subject: [PATCH 14/22] test again --- .github/workflows/run_matlab_tests.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run_matlab_tests.yml b/.github/workflows/run_matlab_tests.yml index ea7d401e..a2ebf69d 100644 --- a/.github/workflows/run_matlab_tests.yml +++ b/.github/workflows/run_matlab_tests.yml @@ -82,10 +82,17 @@ jobs: - name: Upload files to a GitHub release uses: xresloader/upload-to-github-release@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # file: "ezc3d_matlab.zip" + # verbose: true + # overwrite: true + # update_latest_release: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: file: "ezc3d_matlab.zip" - verbose: true - overwrite: true - update_latest_release: true + tags: true + draft: true + \ No newline at end of file From 00447af2d9bc9823bdac318db27c11eddc435800 Mon Sep 17 00:00:00 2001 From: Pariterre Date: Mon, 12 Aug 2024 13:38:13 -0400 Subject: [PATCH 15/22] again --- .github/workflows/run_matlab_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_matlab_tests.yml b/.github/workflows/run_matlab_tests.yml index a2ebf69d..a3d4b2ac 100644 --- a/.github/workflows/run_matlab_tests.yml +++ b/.github/workflows/run_matlab_tests.yml @@ -93,6 +93,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: file: "ezc3d_matlab.zip" - tags: true + tags: false draft: true \ No newline at end of file From 515565cbf198e70a9da2e4011a25bdb09ff75839 Mon Sep 17 00:00:00 2001 From: Pariterre Date: Mon, 12 Aug 2024 13:42:09 -0400 Subject: [PATCH 16/22] Again --- .github/workflows/run_matlab_tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/run_matlab_tests.yml b/.github/workflows/run_matlab_tests.yml index a3d4b2ac..1f441662 100644 --- a/.github/workflows/run_matlab_tests.yml +++ b/.github/workflows/run_matlab_tests.yml @@ -95,4 +95,5 @@ jobs: file: "ezc3d_matlab.zip" tags: false draft: true + tag_name: Release_1.5.10 \ No newline at end of file From 6a8a2fd184d95d2723f2693d46fdecb6814b5038 Mon Sep 17 00:00:00 2001 From: Pariterre Date: Mon, 12 Aug 2024 14:05:53 -0400 Subject: [PATCH 17/22] Trying another action --- .github/workflows/run_matlab_tests.yml | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/run_matlab_tests.yml b/.github/workflows/run_matlab_tests.yml index 1f441662..e92d011f 100644 --- a/.github/workflows/run_matlab_tests.yml +++ b/.github/workflows/run_matlab_tests.yml @@ -81,19 +81,11 @@ jobs: zip -r ezc3d_matlab.zip README.md - name: Upload files to a GitHub release - uses: xresloader/upload-to-github-release@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # file: "ezc3d_matlab.zip" - # verbose: true - # overwrite: true - # update_latest_release: true + uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - file: "ezc3d_matlab.zip" - tags: false - draft: true - tag_name: Release_1.5.10 - \ No newline at end of file + upload_url: https://github.com/pyomeca/ezc3d/releases/tag/Release_1.5.10 + asset_path: ./ezc3d_matlab.zip + asset_name: ezc3d_matlab.zip + asset_content_type: application/zip \ No newline at end of file From 18d7df0e94506a4967d29f2652a7c7e4e23bba43 Mon Sep 17 00:00:00 2001 From: Pariterre Date: Mon, 12 Aug 2024 14:10:29 -0400 Subject: [PATCH 18/22] again --- .github/workflows/run_matlab_tests.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run_matlab_tests.yml b/.github/workflows/run_matlab_tests.yml index e92d011f..b56e2d18 100644 --- a/.github/workflows/run_matlab_tests.yml +++ b/.github/workflows/run_matlab_tests.yml @@ -80,12 +80,23 @@ jobs: run: | zip -r ezc3d_matlab.zip README.md + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: TATA + release_name: Release_TATA + draft: false + prerelease: false + - name: Upload files to a GitHub release uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: https://github.com/pyomeca/ezc3d/releases/tag/Release_1.5.10 + upload_url: steps.create_release.outputs.upload_url asset_path: ./ezc3d_matlab.zip asset_name: ezc3d_matlab.zip asset_content_type: application/zip \ No newline at end of file From 1c35afff734166493a887809e04b5e3868bfadbb Mon Sep 17 00:00:00 2001 From: Pariterre Date: Mon, 12 Aug 2024 14:11:45 -0400 Subject: [PATCH 19/22] again --- .github/workflows/run_matlab_tests.yml | 100 +++++-------------------- 1 file changed, 18 insertions(+), 82 deletions(-) diff --git a/.github/workflows/run_matlab_tests.yml b/.github/workflows/run_matlab_tests.yml index b56e2d18..280512b6 100644 --- a/.github/workflows/run_matlab_tests.yml +++ b/.github/workflows/run_matlab_tests.yml @@ -1,102 +1,38 @@ -name: Run the Matlab tests +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 -on: [pull_request] - -env: - BUILD_FOLDER: build - EXAMPLES_FOLDER: examples +name: Upload Release Asset jobs: build: - strategy: - matrix: - include: - - os: ubuntu-22.04 - label: linux-64 - prefix: /usr/share/miniconda3/envs/ezc3d - name: ${{ matrix.label }} - runs-on: ${{ matrix.os }} - defaults: - run: - shell: bash -l {0} + name: Upload Release Asset + runs-on: ubuntu-latest 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 - - # - name: Build ezc3d - # 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=ON -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 - - # - 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 - - # - name: Build MATLAB archives - # run: | - # zip -r ezc3d_matlab.zip $HOME/ezc3d_matlab - - name: Build MATLAB archives + uses: actions/checkout@v2 + - name: Build project # This would actually build your project, using zip for an example artifact run: | - zip -r ezc3d_matlab.zip README.md - + zip --junk-paths my-artifact README.md - name: Create Release id: create_release uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: TATA - release_name: Release_TATA + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} draft: false prerelease: false - - - name: Upload files to a GitHub release + - name: Upload Release Asset + id: upload-release-asset uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: steps.create_release.outputs.upload_url - asset_path: ./ezc3d_matlab.zip - asset_name: ezc3d_matlab.zip + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ./my-artifact.zip + asset_name: my-artifact.zip asset_content_type: application/zip \ No newline at end of file From dfc4d3834a6a1684168eee2040c4fe5a042586de Mon Sep 17 00:00:00 2001 From: Pariterre Date: Mon, 12 Aug 2024 14:15:06 -0400 Subject: [PATCH 20/22] same --- .github/workflows/run_matlab_tests.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/run_matlab_tests.yml b/.github/workflows/run_matlab_tests.yml index 280512b6..156383a7 100644 --- a/.github/workflows/run_matlab_tests.yml +++ b/.github/workflows/run_matlab_tests.yml @@ -1,8 +1,5 @@ on: - push: - # Sequence of patterns matched against refs/tags - tags: - - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + [pull_request] name: Upload Release Asset From e67a2726939983e86ea78b42e8ad3c082db0c7d5 Mon Sep 17 00:00:00 2001 From: Pariterre Date: Mon, 12 Aug 2024 14:16:20 -0400 Subject: [PATCH 21/22] again --- .github/workflows/run_matlab_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_matlab_tests.yml b/.github/workflows/run_matlab_tests.yml index 156383a7..f148a475 100644 --- a/.github/workflows/run_matlab_tests.yml +++ b/.github/workflows/run_matlab_tests.yml @@ -1,5 +1,5 @@ on: - [pull_request] + push: name: Upload Release Asset From 5a0ca875ff25e823a4f007c005230aa2bd7796f7 Mon Sep 17 00:00:00 2001 From: Pariterre Date: Mon, 12 Aug 2024 14:19:13 -0400 Subject: [PATCH 22/22] reverted --- .github/workflows/run_matlab_tests.yml | 108 +++++++++++++++++++------ 1 file changed, 83 insertions(+), 25 deletions(-) diff --git a/.github/workflows/run_matlab_tests.yml b/.github/workflows/run_matlab_tests.yml index f148a475..df62effb 100644 --- a/.github/workflows/run_matlab_tests.yml +++ b/.github/workflows/run_matlab_tests.yml @@ -1,35 +1,93 @@ -on: - push: +name: Run the Matlab tests -name: Upload Release Asset +on: + release: + types: [published] + +env: + BUILD_FOLDER: build + EXAMPLES_FOLDER: examples jobs: build: - name: Upload Release Asset - runs-on: ubuntu-latest + strategy: + matrix: + include: + - os: ubuntu-22.04 + label: linux-64 + prefix: /usr/share/miniconda3/envs/ezc3d + name: ${{ matrix.label }} + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash -l {0} steps: - name: Checkout code - uses: actions/checkout@v2 - - name: Build project # This would actually build your project, using zip for an example artifact + 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 + + # - name: Build ezc3d + # 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=ON -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 + + # - 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 + + # - name: Build MATLAB archives + # run: | + # zip -r ezc3d_matlab.zip $HOME/ezc3d_matlab + - name: Build MATLAB archives run: | - zip --junk-paths my-artifact README.md - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - draft: false - prerelease: false - - name: Upload Release Asset - id: upload-release-asset - uses: actions/upload-release-asset@v1 + zip -r ezc3d_matlab.zip README.md + + - name: Upload files to a GitHub release + uses: xresloader/upload-to-github-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps - asset_path: ./my-artifact.zip - asset_name: my-artifact.zip - asset_content_type: application/zip \ No newline at end of file + file: "ezc3d_matlab.zip" + update_latest_release: true + verbose: true + overwrite: true \ No newline at end of file