Update M1 working directory #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: cMaBoSS MacOS | |
on: | |
push: | |
pull_request: | |
release: | |
types: [created] | |
jobs: | |
cmaboss_macos: | |
name: cMaBoSS | |
runs-on: macos-11 | |
env: | |
GCC: clang | |
CXX: clang++ | |
INSTALL_PATH: /usr/local/ | |
BUILD_PATH: /tmp/ | |
LIBXML_LIBDIR: /usr/local/opt/libxml2/lib/libxml2.dylib | |
LIBXML_INCLUDEDIR: /usr/local/opt/libxml2/include/libxml2/ | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
brew install flex bison python3 cmake | |
pip3 install numpy wheel delocate pandas | |
- name: Manually install libxml2 2.11 | |
run: | | |
wget https://github.com/Homebrew/homebrew-core/raw/38ba35404e3cdb398694419850179e0023158887/Formula/lib/libxml2.rb | |
brew install -s libxml2.rb | |
- name: Cache compiled libSBML | |
id: cache-libsbml-clang | |
uses: actions/cache@v4 | |
with: | |
path: /tmp/libsbml-5.20.2 | |
key: ${{ runner.os }}-libSBML-5.20.2-clang++-namespace | |
- name: Compiling libSBML | |
if: steps.cache-libsbml-clang.outputs.cache-hit != 'true' | |
run: bash scripts/build_libsbml.sh | |
- name: Install libSBML | |
run: sudo bash scripts/install_libsbml.sh | |
- name: Build cMaBoSS | |
run: | | |
cd engine/src | |
make | |
cd ../python | |
cp -r ../src cmaboss | |
python3 -m pip wheel -w wheelhouse . | |
cp /usr/local/lib/libsbml*.dylib . | |
delocate-wheel -w fixed_wheels -v `ls wheelhouse/cmaboss*.whl` | |
pip3 install `ls fixed_wheels/cmaboss*.whl` | |
- name: Test cMaBoSS | |
run: bash scripts/run_cmaboss_tests.sh | |
build_wheels_macos: | |
name: Build MacOS wheels | |
runs-on: macOS-11 | |
strategy: | |
matrix: | |
arch: ["x86_64", "arm64"] | |
needs: cmaboss_macos | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install cibuildwheel | |
run: python -m pip install cibuildwheel numpy twine | |
- name: Build wheels | |
env: | |
CIBW_ARCHS: ${{ matrix.arch }} | |
CIBW_TEST_SKIP: "*-macosx_arm64" | |
CIBW_BEFORE_ALL: > | |
wget https://github.com/Homebrew/homebrew-core/raw/38ba35404e3cdb398694419850179e0023158887/Formula/lib/libxml2.rb && | |
brew install -s libxml2.rb && | |
GCC=clang CXX=clang++ INSTALL_PATH=/usr/local/ BUILD_PATH=/tmp/ \ | |
LIBXML_LIBDIR=/usr/local/opt/libxml2/lib/libxml2.dylib \ | |
LIBXML_INCLUDEDIR=/usr/local/opt/libxml2/include/libxml2/ \ | |
bash scripts/build_libsbml.sh && | |
BUILD_PATH=/tmp/ bash scripts/install_libsbml.sh | |
CIBW_REPAIR_WHEEL_COMMAND_MACOS: > | |
DYLD_LIBRARY_PATH=/usr/local/lib/ delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} | |
run: | | |
cd engine/src | |
make grammars | |
cd ../../ | |
cp -r engine/src engine/python/cmaboss/ | |
python -m cibuildwheel --output-dir wheelhouse engine/python | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: wheels-${{ matrix.arch }} | |
path: wheelhouse/*.whl | |
- name: Upload cMaBoSS to test Pypi | |
if: github.repository == 'vincent-noel/MaBoSS' && github.ref == 'refs/heads/master' | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_TOKEN }} | |
run: | | |
python -m twine upload --repository testpypi --skip-existing wheelhouse/cmaboss* | |
- name: Upload cMaBoSS to Pypi | |
if: github.repository == 'sysbio-curie/MaBoSS' && github.event_name == 'release' | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
run: | | |
python -m twine upload --skip-existing wheelhouse/cmaboss* | |
conda_cmaboss_macosx: | |
name: cMaBoSS Conda package | |
runs-on: macos-12 | |
needs: cmaboss_macos | |
strategy: | |
matrix: | |
version: [{python: "3.8", numpy: "1.22"}, {python: "3.9", numpy: "1.22"}, {python: "3.10", numpy: "1.22"}, {python: "3.11", numpy: "1.23"}, {python: "3.12", numpy: "1.26"}] | |
defaults: | |
run: | |
shell: sh -l {0} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
channels: defaults | |
python-version: 3.12 | |
miniforge-variant: Mambaforge | |
use-mamba: true | |
- name: Install conda-build | |
run: | | |
conda install conda-build conda-verify | |
- name: Installing MacOSX10.10 SDK | |
run: | | |
wget https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.10.sdk.tar.xz | |
sudo tar xf MacOSX10.10.sdk.tar.xz -C /opt | |
echo "conda_build:" > ~/.condarc | |
echo " config_file: ~/.conda/conda_build_config.yaml" >> ~/.condarc | |
echo "CONDA_BUILD_SYSROOT:" > ~/.conda/conda_build_config.yaml | |
echo " - /opt/MacOSX10.10.sdk # [osx]" >> ~/.conda/conda_build_config.yaml | |
- name: Build cMaBoSS Anaconda package | |
run: | | |
conda build -c colomoto --variants "{\"python\": [\"${{ matrix.version.python }}\"], \"numpy\": [\"${{ matrix.version.numpy }}\"]}" conda/cmaboss; | |
- name: Caching produced conda package | |
uses: actions/cache@v4 | |
with: | |
path: | | |
/Users/runner/miniconda3/envs/test/conda-bld/* | |
key: ${{ runner.os }}-cmaboss-conda-${{ github.run_id }}-${{ matrix.version.python }} | |
conda_cmaboss_conda_forge_macosx: | |
name: cMaBoSS Conda package (conda-forge) | |
runs-on: macos-12 | |
needs: cmaboss_macos | |
strategy: | |
matrix: | |
version: [{python: "3.8", numpy: "1.22"}, {python: "3.9", numpy: "1.22"}, {python: "3.10", numpy: "1.22"}, {python: "3.11", numpy: "1.23"}, {python: "3.12", numpy: "1.26"}] | |
defaults: | |
run: | |
shell: sh -l {0} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
channels: conda-forge | |
python-version: 3.12 | |
miniforge-variant: Mambaforge | |
use-mamba: true | |
- name: Install conda-build | |
run: | | |
conda install conda-build conda-verify | |
- name: Installing MacOSX10.10 SDK | |
run: | | |
wget https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX10.10.sdk.tar.xz | |
sudo tar xf MacOSX10.10.sdk.tar.xz -C /opt | |
echo "conda_build:" > ~/.condarc | |
echo " config_file: ~/.conda/conda_build_config.yaml" >> ~/.condarc | |
echo "CONDA_BUILD_SYSROOT:" > ~/.conda/conda_build_config.yaml | |
echo " - /opt/MacOSX10.10.sdk # [osx]" >> ~/.conda/conda_build_config.yaml | |
- name: Build cMaBoSS Anaconda package | |
run: | | |
CUSTOM_BUILD_NUMBER=1 conda build -c conda-forge -c colomoto --variants "{\"python\": [\"${{ matrix.version.python }}\"], \"numpy\": [\"${{ matrix.version.numpy }}\"]}" conda/cmaboss; | |
- name: Caching produced conda package | |
uses: actions/cache@v4 | |
with: | |
path: | | |
/Users/runner/miniconda3/envs/test/conda-bld/* | |
key: ${{ runner.os }}-cmaboss-conda-forge-${{ github.run_id }}-${{ matrix.version.python }} | |
cmaboss_conda_test_macosx: | |
name: cMaBoSS Anaconda package test | |
runs-on: macos-12 | |
needs: conda_cmaboss_macosx | |
strategy: | |
matrix: | |
version: [{python: "3.8", numpy: "1.22"}, {python: "3.9", numpy: "1.22"}, {python: "3.10", numpy: "1.22"}, {python: "3.11", numpy: "1.23"}, {python: "3.12", numpy: "1.26"}] | |
defaults: | |
run: | |
shell: sh -l {0} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
channels: defaults | |
python-version: ${{ matrix.version.python }} | |
miniforge-variant: Mambaforge | |
use-mamba: true | |
- name: Install conda-build | |
run: | | |
conda install conda-build conda-index | |
- name: Caching produced conda package | |
uses: actions/cache@v4 | |
with: | |
path: | | |
/Users/runner/miniconda3/envs/test/conda-bld/* | |
key: ${{ runner.os }}-cmaboss-conda-${{ github.run_id }}-${{ matrix.version.python }} | |
- name: Install package | |
run: | | |
python -m conda_index /Users/runner/miniconda3/envs/test/conda-bld/ | |
conda install -c file:///Users/runner/miniconda3/envs/test/conda-bld/ -c colomoto cmaboss | |
- name: Install test dependencies | |
run: | | |
pip install pandas | |
- name: Test package | |
run: | | |
cd engine/tests | |
python -m unittest test | |
python -m unittest test_128n | |
cmaboss_conda_test_conda_forge_macosx: | |
name: cMaBoSS Anaconda package test (conda-forge) | |
runs-on: macos-12 | |
needs: conda_cmaboss_conda_forge_macosx | |
strategy: | |
matrix: | |
version: [{python: "3.8", numpy: "1.22"}, {python: "3.9", numpy: "1.22"}, {python: "3.10", numpy: "1.22"}, {python: "3.11", numpy: "1.23"}, {python: "3.12", numpy: "1.26"}] | |
defaults: | |
run: | |
shell: sh -l {0} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
channels: conda-forge | |
python-version: ${{ matrix.version.python }} | |
miniforge-variant: Mambaforge | |
use-mamba: true | |
- name: Install conda-build | |
run: | | |
conda install conda-build conda-index | |
- name: Caching produced conda package | |
uses: actions/cache@v4 | |
with: | |
path: | | |
/Users/runner/miniconda3/envs/test/conda-bld/* | |
key: ${{ runner.os }}-cmaboss-conda-forge-${{ github.run_id }}-${{ matrix.version.python }} | |
- name: Install package | |
run: | | |
python -m conda_index /Users/runner/miniconda3/envs/test/conda-bld/ | |
conda install -c file:///Users/runner/miniconda3/envs/test/conda-bld/ -c colomoto cmaboss | |
- name: Install test dependencies | |
run: | | |
pip install pandas | |
- name: Test package | |
run: | | |
cd engine/tests | |
python -m unittest test | |
python -m unittest test_128n | |
cmaboss_conda_publish_macosx: | |
name: cMaBoSS Anaconda package publication | |
runs-on: macos-12 | |
needs: cmaboss_conda_test_macosx | |
strategy: | |
matrix: | |
version: [{python: "3.8", numpy: "1.22"}, {python: "3.9", numpy: "1.22"}, {python: "3.10", numpy: "1.22"}, {python: "3.11", numpy: "1.23"}, {python: "3.12", numpy: "1.26"}] | |
defaults: | |
run: | |
shell: sh -l {0} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
channels: conda-forge | |
python-version: 3.12 | |
miniforge-variant: Mambaforge | |
use-mamba: true | |
- name: Install conda-build | |
run: | | |
conda install conda-build anaconda-client | |
- name: Caching produced conda package | |
uses: actions/cache@v4 | |
with: | |
path: | | |
/Users/runner/miniconda3/envs/test/conda-bld/* | |
key: ${{ runner.os }}-cmaboss-conda-${{ github.run_id }}-${{ matrix.version.python }} | |
- name: Upload MaBoSS to Anaconda cloud on vincent-noel | |
run: | | |
anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload -u vincent-noel /Users/runner/miniconda3/envs/test/conda-bld/osx-64/*.tar.bz2 --force; | |
- name: Upload MaBoSS to Anaconda cloud on colomoto | |
if: github.repository == 'sysbio-curie/MaBoSS' && github.event_name == 'release' | |
run: | | |
anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload -u colomoto /Users/runner/miniconda3/envs/test/conda-bld/osx-64/*.tar.bz2 --force; | |
cmaboss_conda_publish_conda_forge_macosx: | |
name: cMaBoSS Anaconda package publication (conda-forge) | |
runs-on: macos-12 | |
needs: cmaboss_conda_test_conda_forge_macosx | |
strategy: | |
matrix: | |
version: [{python: "3.8", numpy: "1.22"}, {python: "3.9", numpy: "1.22"}, {python: "3.10", numpy: "1.22"}, {python: "3.11", numpy: "1.23"}, {python: "3.12", numpy: "1.26"}] | |
defaults: | |
run: | |
shell: sh -l {0} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
channels: conda-forge | |
python-version: 3.12 | |
miniforge-variant: Mambaforge | |
use-mamba: true | |
- name: Install conda-build | |
run: | | |
conda install conda-build anaconda-client | |
- name: Caching produced conda package | |
uses: actions/cache@v4 | |
with: | |
path: | | |
/Users/runner/miniconda3/envs/test/conda-bld/* | |
key: ${{ runner.os }}-cmaboss-conda-forge-${{ github.run_id }}-${{ matrix.version.python }} | |
- name: Upload MaBoSS to Anaconda cloud on vincent-noel | |
run: | | |
anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload -u vincent-noel /Users/runner/miniconda3/envs/test/conda-bld/osx-64/*.tar.bz2 --force; | |
- name: Upload MaBoSS to Anaconda cloud on colomoto | |
if: github.repository == 'sysbio-curie/MaBoSS' && github.event_name == 'release' | |
run: | | |
anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload -u colomoto /Users/runner/miniconda3/envs/test/conda-bld/osx-64/*.tar.bz2 --force; | |