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 new file mode 100644 index 00000000..df62effb --- /dev/null +++ b/.github/workflows/run_matlab_tests.yml @@ -0,0 +1,93 @@ +name: Run the Matlab tests + +on: + release: + types: [published] + +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_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 -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" + update_latest_release: true + verbose: true + overwrite: true \ No newline at end of file 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