From 0f8b616030487ae4dbd950c0c8c299accaf697e7 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Wed, 28 Sep 2022 18:06:07 -0400 Subject: [PATCH] WIP: test dotnet interface --- .github/workflows/main.yml | 1169 +++++++++++++++++++----------------- 1 file changed, 609 insertions(+), 560 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f4d54656c93..c3a85df2c54 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -53,591 +53,640 @@ jobs: run: python3 -m pip install typing_extensions - name: Build Cantera run: python3 `which scons` build env_vars=all -j2 debug=n --debug=time - - name: Test Cantera - run: - python3 `which scons` test show_long_tests=yes verbose_tests=yes --debug=time - - clang-compiler: - name: LLVM/Clang with Python 3.8 - runs-on: ubuntu-22.04 - timeout-minutes: 60 - steps: - - uses: actions/checkout@v2 - name: Checkout the repository + - name: Upload shared library + uses: actions/upload-artifact@v3 + if: matrix.python-version == '3.10' && matrix.os == 'ubuntu-22.04' with: - submodules: recursive - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: 3.8 - architecture: x64 - - name: Install Apt dependencies - run: | - sudo apt update - sudo apt install libboost-dev gfortran libomp-dev libomp5 libopenblas-dev - - name: Upgrade pip - run: python3 -m pip install -U pip setuptools wheel - - name: Install Python dependencies - run: python3 -m pip install ruamel.yaml scons numpy cython h5py pandas pytest - pytest-github-actions-annotate-failures - - name: Build Cantera - run: python3 `which scons` build env_vars=all - CXX=clang++-12 CC=clang-12 f90_interface=n extra_lib_dirs=/usr/lib/llvm/lib - -j2 debug=n --debug=time + path: build/lib/libcantera_shared.so + name: libcantera_shared.so + retention-days: 2 - name: Test Cantera run: python3 `which scons` test show_long_tests=yes verbose_tests=yes --debug=time - macos-multiple-pythons: - name: macOS with Python ${{ matrix.python-version }} - runs-on: macos-11 - timeout-minutes: 90 - strategy: - matrix: - python-version: [ '3.7', '3.9', '3.10' ] - fail-fast: false - steps: - # Attempt to fix intermittent cloning errors. The error message says something like - # error: RPC failed; curl 18 transfer closed with outstanding read data remaining - # The clone is already being done with --depth=1, so the next recommended fix is to - # increase the buffer size. See also: - # https://github.com/actions/virtual-environments/issues/2198 - # https://stackoverflow.com/q/38618885 - - name: Configure git - run: /usr/local/bin/git config --global http.postBuffer 1048576000 - - uses: actions/checkout@v2 - name: Checkout the repository - with: - submodules: recursive - - name: Install Brew dependencies - run: | - brew install boost libomp scons python@${{ matrix.python-version }} - - name: Upgrade pip - run: python3 -m pip install -U pip 'setuptools>=47.0.0,<48' wheel - - name: Install Python dependencies - run: python3 -m pip install ruamel.yaml numpy cython h5py pandas pytest - pytest-github-actions-annotate-failures - - name: Install typing_extensions for Python 3.7 - if: matrix.python-version == '3.7' - run: python3 -m pip install typing_extensions - - name: Build Cantera - run: scons build env_vars=all -j3 debug=n --debug=time - - name: Test Cantera - run: - scons test show_long_tests=yes verbose_tests=yes --debug=time + # clang-compiler: + # name: LLVM/Clang with Python 3.8 + # runs-on: ubuntu-22.04 + # timeout-minutes: 60 + # steps: + # - uses: actions/checkout@v2 + # name: Checkout the repository + # with: + # submodules: recursive + # - name: Setup Python + # uses: actions/setup-python@v2 + # with: + # python-version: 3.8 + # architecture: x64 + # - name: Install Apt dependencies + # run: | + # sudo apt update + # sudo apt install libboost-dev gfortran libomp-dev libomp5 libopenblas-dev + # - name: Upgrade pip + # run: python3 -m pip install -U pip setuptools wheel + # - name: Install Python dependencies + # run: python3 -m pip install ruamel.yaml scons numpy cython h5py pandas pytest + # pytest-github-actions-annotate-failures + # - name: Build Cantera + # run: python3 `which scons` build env_vars=all + # CXX=clang++-12 CC=clang-12 f90_interface=n extra_lib_dirs=/usr/lib/llvm/lib + # -j2 debug=n --debug=time + # - name: Test Cantera + # run: + # python3 `which scons` test show_long_tests=yes verbose_tests=yes --debug=time - # Coverage is its own job because macOS builds of the samples - # use Homebrew gfortran which is not compatible for coverage - # with XCode clang. Also, turning off optimization really - # slows down the tests - coverage: - name: Coverage - runs-on: ubuntu-latest - timeout-minutes: 90 - steps: - - uses: actions/checkout@v2 - name: Checkout the repository - with: - submodules: recursive - - name: Setup python - uses: actions/setup-python@v2 - with: - python-version: '3.8' - architecture: x64 - - name: Install Apt dependencies - run: | - sudo apt update - sudo apt install libboost-dev gfortran liblapack-dev libblas-dev libsundials-dev - - name: Upgrade pip - run: python3 -m pip install -U pip setuptools wheel - - name: Install Python dependencies - run: python3 -m pip install ruamel.yaml scons numpy cython h5py pandas scipy pytest - pytest-github-actions-annotate-failures pytest-cov gcovr - - name: Build Cantera - run: | - python3 `which scons` build blas_lapack_libs=lapack,blas coverage=y \ - optimize=n skip_slow_tests=y no_optimize_flags='-DNDEBUG -O0' \ - FORTRANFLAGS='-O0' env_vars=all -j2 --debug=time - - name: Test Cantera - run: - python3 `which scons` test show_long_tests=yes verbose_tests=yes --debug=time - - name: Process coverage files - run: | - gcovr --root . --exclude-unreachable-branches --exclude-throw-branches \ - --exclude-directories '\.sconf_temp' --exclude-directories 'build/ext$' \ - --exclude '.*ext.*' --exclude '(.+/)?_cantera\.cpp$' --exclude '^test.*' \ - --xml coverage.xml --html-details htmlcoverage.html --txt - - name: Archive C++ coverage results - uses: actions/upload-artifact@v2 - with: - name: cxx-coverage-report - path: htmlcoverage* - retention-days: 5 - - name: Archive Python coverage results - uses: actions/upload-artifact@v2 - with: - name: python-coverage-report - path: build/python-coverage* - retention-days: 5 - - name: Upload Coverage to Codecov - uses: codecov/codecov-action@v3 - with: - verbose: true - files: ./coverage.xml,./build/pycov.xml - fail_ci_if_error: true + # macos-multiple-pythons: + # name: macOS with Python ${{ matrix.python-version }} + # runs-on: macos-11 + # timeout-minutes: 90 + # strategy: + # matrix: + # python-version: [ '3.7', '3.9', '3.10' ] + # fail-fast: false + # steps: + # # Attempt to fix intermittent cloning errors. The error message says something like + # # error: RPC failed; curl 18 transfer closed with outstanding read data remaining + # # The clone is already being done with --depth=1, so the next recommended fix is to + # # increase the buffer size. See also: + # # https://github.com/actions/virtual-environments/issues/2198 + # # https://stackoverflow.com/q/38618885 + # - name: Configure git + # run: /usr/local/bin/git config --global http.postBuffer 1048576000 + # - uses: actions/checkout@v2 + # name: Checkout the repository + # with: + # submodules: recursive + # - name: Install Brew dependencies + # run: | + # brew install boost libomp scons python@${{ matrix.python-version }} + # - name: Upgrade pip + # run: python3 -m pip install -U pip 'setuptools>=47.0.0,<48' wheel + # - name: Install Python dependencies + # run: python3 -m pip install ruamel.yaml numpy cython h5py pandas pytest + # pytest-github-actions-annotate-failures + # - name: Install typing_extensions for Python 3.7 + # if: matrix.python-version == '3.7' + # run: python3 -m pip install typing_extensions + # - name: Build Cantera + # run: scons build env_vars=all -j3 debug=n --debug=time + # - name: Test Cantera + # run: + # scons test show_long_tests=yes verbose_tests=yes --debug=time - example-keywords: - name: Check example keywords - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - uses: actions/checkout@v2 - name: Checkout the repository - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: '3.10' - - name: Check keywords - run: python3 doc/example-keywords.py compare + # # Coverage is its own job because macOS builds of the samples + # # use Homebrew gfortran which is not compatible for coverage + # # with XCode clang. Also, turning off optimization really + # # slows down the tests + # coverage: + # name: Coverage + # runs-on: ubuntu-latest + # timeout-minutes: 90 + # steps: + # - uses: actions/checkout@v2 + # name: Checkout the repository + # with: + # submodules: recursive + # - name: Setup python + # uses: actions/setup-python@v2 + # with: + # python-version: '3.8' + # architecture: x64 + # - name: Install Apt dependencies + # run: | + # sudo apt update + # sudo apt install libboost-dev gfortran liblapack-dev libblas-dev libsundials-dev + # - name: Upgrade pip + # run: python3 -m pip install -U pip setuptools wheel + # - name: Install Python dependencies + # run: python3 -m pip install ruamel.yaml scons numpy cython h5py pandas scipy pytest + # pytest-github-actions-annotate-failures pytest-cov gcovr + # - name: Build Cantera + # run: | + # python3 `which scons` build blas_lapack_libs=lapack,blas coverage=y \ + # optimize=n skip_slow_tests=y no_optimize_flags='-DNDEBUG -O0' \ + # FORTRANFLAGS='-O0' env_vars=all -j2 --debug=time + # - name: Test Cantera + # run: + # python3 `which scons` test show_long_tests=yes verbose_tests=yes --debug=time + # - name: Process coverage files + # run: | + # gcovr --root . --exclude-unreachable-branches --exclude-throw-branches \ + # --exclude-directories '\.sconf_temp' --exclude-directories 'build/ext$' \ + # --exclude '.*ext.*' --exclude '(.+/)?_cantera\.cpp$' --exclude '^test.*' \ + # --xml coverage.xml --html-details htmlcoverage.html --txt + # - name: Archive C++ coverage results + # uses: actions/upload-artifact@v2 + # with: + # name: cxx-coverage-report + # path: htmlcoverage* + # retention-days: 5 + # - name: Archive Python coverage results + # uses: actions/upload-artifact@v2 + # with: + # name: python-coverage-report + # path: build/python-coverage* + # retention-days: 5 + # - name: Upload Coverage to Codecov + # uses: codecov/codecov-action@v3 + # with: + # verbose: true + # files: ./coverage.xml,./build/pycov.xml + # fail_ci_if_error: true - docs: - name: Build docs - runs-on: ubuntu-latest - timeout-minutes: 60 - env: - DEPLOY: ${{ github.event_name == 'push' && github.repository_owner == 'Cantera' && endsWith(github.ref, 'main') }} - steps: - - uses: actions/checkout@v2 - name: Checkout the repository - with: - submodules: recursive - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: '3.8' - architecture: x64 - - name: Install Apt dependencies - run: | - sudo apt update - sudo apt install libboost-dev doxygen graphviz - - name: Upgrade pip - run: python3 -m pip install -U pip setuptools wheel - - name: Install Python dependencies - run: | - python3 -m pip install ruamel.yaml scons numpy cython sphinx\<4.0 jinja2\<3.1.0 \ - sphinxcontrib-katex sphinxcontrib-matlabdomain sphinxcontrib-doxylink - - name: Build Cantera with documentation - run: python3 `which scons` build -j2 doxygen_docs=y sphinx_docs=y debug=n optimize=n use_pch=n - - name: Ensure 'scons help' options work - run: | - python3 `which scons` help --options - python3 `which scons` help --list-options - python3 `which scons` help --option=prefix - - name: Parse configuration options from SConstruct as reST - run: | - python3 `which scons` help --restructured-text --dev --output=config-options-dev.rst - mkdir build/docs/scons - mv config-options-dev.rst build/docs/scons/ - - name: Create archive for docs output - run: | - cd build - tar -czf docs.tar.gz docs - - name: Store archive of docs output - uses: actions/upload-artifact@v2 - with: - path: build/docs.tar.gz - name: docs - retention-days: 2 - # The known_hosts key is generated with `ssh-keygen -F cantera.org` from a - # machine that has previously logged in to cantera.org and trusts - # that it logged in to the right machine - - name: Set up SSH key and host for deploy - if: env.DEPLOY == 'true' - uses: shimataro/ssh-key-action@v2 - with: - key: ${{ secrets.CTDEPLOY_KEY }} - known_hosts: ${{ secrets.CTDEPLOY_HOST }} - - name: Upload the docs - if: env.DEPLOY == 'true' - env: - RSYNC_USER: "ctdeploy" - RSYNC_SERVER: "cantera.org" - RSYNC_DEST: "cantera/documentation/dev" - DOCS_OUTPUT_DIR: "./build/docs/" - run: | - rsync -avzP --checksum --exclude='*.map' --exclude='*.md5' \ - --exclude='/doxygen/xml' --delete --delete-excluded \ - "${DOCS_OUTPUT_DIR}" ${RSYNC_USER}@${RSYNC_SERVER}:${RSYNC_DEST} + # example-keywords: + # name: Check example keywords + # runs-on: ubuntu-latest + # timeout-minutes: 10 + # steps: + # - uses: actions/checkout@v2 + # name: Checkout the repository + # - name: Setup Python + # uses: actions/setup-python@v2 + # with: + # python-version: '3.10' + # - name: Check keywords + # run: python3 doc/example-keywords.py compare - run-examples: - name: Run the Python examples using bash - runs-on: ubuntu-20.04 - timeout-minutes: 60 - strategy: - matrix: - python-version: ['3.7', '3.9', '3.10'] - fail-fast: false - steps: - - uses: actions/checkout@v2 - name: Checkout the repository - with: - submodules: recursive - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - architecture: x64 - - name: Install Apt dependencies - run: | - sudo apt update - sudo apt install libboost-dev gfortran graphviz liblapack-dev libblas-dev gcc-9 g++-9 - - name: Upgrade pip - run: python3 -m pip install -U pip setuptools wheel - - name: Install Python dependencies - run: python3 -m pip install ruamel.yaml scons numpy cython h5py pandas matplotlib scipy - - name: Install typing_extensions for Python 3.7 - if: matrix.python-version == '3.7' - run: python3 -m pip install typing_extensions - - name: Build Cantera - # compile with GCC 9.4.0 on ubuntu-20.04 as an alternative to the default - # (GCC 7.5.0 is both default and oldest supported version) - run: python3 `which scons` build -j2 debug=n CC=gcc-9 CXX=g++-9 - - name: Run the examples - # See https://unix.stackexchange.com/a/392973 for an explanation of the -exec part - run: | - find samples/python -type f -iname "*.py" \ - -exec sh -c 'for n; do echo "$n" | tee -a results.txt && python3 "$n" >> results.txt || exit 1; done' sh {} + - env: - PYTHONPATH: build/python - PYTHONWARNINGS: error - MPLBACKEND: Agg - - name: Save the results file for inspection - uses: actions/upload-artifact@v2 - with: - path: results.txt - retention-days: 2 - name: example-results - # Run this step if the job was successful or failed, but not if it was cancelled - # Using always() would run this step if the job was cancelled as well. - if: failure() || success() + # docs: + # name: Build docs + # runs-on: ubuntu-latest + # timeout-minutes: 60 + # env: + # DEPLOY: ${{ github.event_name == 'push' && github.repository_owner == 'Cantera' && endsWith(github.ref, 'main') }} + # steps: + # - uses: actions/checkout@v2 + # name: Checkout the repository + # with: + # submodules: recursive + # - name: Setup Python + # uses: actions/setup-python@v2 + # with: + # python-version: '3.8' + # architecture: x64 + # - name: Install Apt dependencies + # run: | + # sudo apt update + # sudo apt install libboost-dev doxygen graphviz + # - name: Upgrade pip + # run: python3 -m pip install -U pip setuptools wheel + # - name: Install Python dependencies + # run: | + # python3 -m pip install ruamel.yaml scons numpy cython sphinx\<4.0 jinja2\<3.1.0 \ + # sphinxcontrib-katex sphinxcontrib-matlabdomain sphinxcontrib-doxylink + # - name: Build Cantera with documentation + # run: python3 `which scons` build -j2 doxygen_docs=y sphinx_docs=y debug=n optimize=n use_pch=n + # - name: Ensure 'scons help' options work + # run: | + # python3 `which scons` help --options + # python3 `which scons` help --list-options + # python3 `which scons` help --option=prefix + # - name: Parse configuration options from SConstruct as reST + # run: | + # python3 `which scons` help --restructured-text --dev --output=config-options-dev.rst + # mkdir build/docs/scons + # mv config-options-dev.rst build/docs/scons/ + # - name: Create archive for docs output + # run: | + # cd build + # tar -czf docs.tar.gz docs + # - name: Store archive of docs output + # uses: actions/upload-artifact@v2 + # with: + # path: build/docs.tar.gz + # name: docs + # retention-days: 2 + # # The known_hosts key is generated with `ssh-keygen -F cantera.org` from a + # # machine that has previously logged in to cantera.org and trusts + # # that it logged in to the right machine + # - name: Set up SSH key and host for deploy + # if: env.DEPLOY == 'true' + # uses: shimataro/ssh-key-action@v2 + # with: + # key: ${{ secrets.CTDEPLOY_KEY }} + # known_hosts: ${{ secrets.CTDEPLOY_HOST }} + # - name: Upload the docs + # if: env.DEPLOY == 'true' + # env: + # RSYNC_USER: "ctdeploy" + # RSYNC_SERVER: "cantera.org" + # RSYNC_DEST: "cantera/documentation/dev" + # DOCS_OUTPUT_DIR: "./build/docs/" + # run: | + # rsync -avzP --checksum --exclude='*.map' --exclude='*.md5' \ + # --exclude='/doxygen/xml' --delete --delete-excluded \ + # "${DOCS_OUTPUT_DIR}" ${RSYNC_USER}@${RSYNC_SERVER}:${RSYNC_DEST} - multiple-sundials: - name: Sundials ${{ matrix.sundials-ver }} - runs-on: ubuntu-latest - timeout-minutes: 60 - env: - PYTHON_VERSION: 3.8 - defaults: - run: - shell: bash -l {0} - strategy: - matrix: - sundials-ver: [ 3, 4, 5.8, 6.2 ] - fail-fast: false - steps: - - uses: actions/checkout@v2 - name: Checkout the repository - with: - submodules: recursive - - uses: conda-incubator/setup-miniconda@v2 - with: - auto-update-conda: true - python-version: ${{ env.PYTHON_VERSION }} - miniforge-version: latest - activate-environment: test - name: Set up conda - - name: Install conda dependencies - # See https://github.com/conda-forge/boost-cpp-feedstock/issues/41 for why we - # use boost-cpp rather than boost from conda-forge - run: | - conda install -q sundials=${{ matrix.sundials-ver }} scons numpy ruamel.yaml \ - cython boost-cpp fmt eigen yaml-cpp h5py pandas libgomp openblas pytest - - name: Build Cantera - run: | - scons build system_fmt=y system_eigen=y system_yamlcpp=y system_sundials=y \ - blas_lapack_libs='lapack,blas' -j2 logging=debug debug=n \ - optimize_flags='-O3 -ffast-math -fno-finite-math-only' - - name: Test Cantera - run: scons test show_long_tests=yes verbose_tests=yes - - name: Test Install - # spot-check installation locations - run: | - scons install - test -f ${CONDA_PREFIX}/lib/libcantera_shared.so - test -f ${CONDA_PREFIX}/include/cantera/base/Solution.h - test -f ${CONDA_PREFIX}/bin/ck2yaml - test -f ${CONDA_PREFIX}/share/cantera/data/gri30.yaml - test -d ${CONDA_PREFIX}/share/cantera/samples - test -d ${CONDA_PREFIX}/share/cantera/samples/python - test -d ${CONDA_PREFIX}/lib/python${{ env.PYTHON_VERSION }}/site-packages/cantera - - name: Test Essentials - # ensure that Python package loads and converter scripts work - run: | - python -c 'import cantera as ct; import sys; sys.exit(0) if ct.__version__.startswith("3.0.0") else sys.exit(1)' - ck2yaml --input=test/data/h2o2.inp --output=h2o2-test.yaml - test -f h2o2-test.yaml - cti2yaml test/data/ch4_ion.cti ch4_ion-test.yaml - test -f ch4_ion-test.yaml - yaml2ck data/h2o2.yaml --mechanism=h2o2-test.ck - test -f h2o2-test.ck + # run-examples: + # name: Run the Python examples using bash + # runs-on: ubuntu-20.04 + # timeout-minutes: 60 + # strategy: + # matrix: + # python-version: ['3.7', '3.9', '3.10'] + # fail-fast: false + # steps: + # - uses: actions/checkout@v2 + # name: Checkout the repository + # with: + # submodules: recursive + # - name: Setup Python + # uses: actions/setup-python@v2 + # with: + # python-version: ${{ matrix.python-version }} + # architecture: x64 + # - name: Install Apt dependencies + # run: | + # sudo apt update + # sudo apt install libboost-dev gfortran graphviz liblapack-dev libblas-dev gcc-9 g++-9 + # - name: Upgrade pip + # run: python3 -m pip install -U pip setuptools wheel + # - name: Install Python dependencies + # run: python3 -m pip install ruamel.yaml scons numpy cython h5py pandas matplotlib scipy + # - name: Install typing_extensions for Python 3.7 + # if: matrix.python-version == '3.7' + # run: python3 -m pip install typing_extensions + # - name: Build Cantera + # # compile with GCC 9.4.0 on ubuntu-20.04 as an alternative to the default + # # (GCC 7.5.0 is both default and oldest supported version) + # run: python3 `which scons` build -j2 debug=n CC=gcc-9 CXX=g++-9 + # - name: Run the examples + # # See https://unix.stackexchange.com/a/392973 for an explanation of the -exec part + # run: | + # find samples/python -type f -iname "*.py" \ + # -exec sh -c 'for n; do echo "$n" | tee -a results.txt && python3 "$n" >> results.txt || exit 1; done' sh {} + + # env: + # PYTHONPATH: build/python + # PYTHONWARNINGS: error + # MPLBACKEND: Agg + # - name: Save the results file for inspection + # uses: actions/upload-artifact@v2 + # with: + # path: results.txt + # retention-days: 2 + # name: example-results + # # Run this step if the job was successful or failed, but not if it was cancelled + # # Using always() would run this step if the job was cancelled as well. + # if: failure() || success() - windows-2022: - name: ${{ matrix.os }}, MSVC ${{ matrix.vs-toolset }}, Python ${{ matrix.python-version }} - runs-on: ${{ matrix.os }} - timeout-minutes: 60 - defaults: - run: - shell: bash -l {0} - strategy: - matrix: - os: ["windows-2022"] - vs-toolset: ["14.3"] # 'cl' is not recognized for earlier toolsets - python-version: [ "3.7", "3.9", "3.10" ] - fail-fast: false - steps: - - uses: actions/checkout@v2 - name: Checkout the repository - with: - submodules: recursive - - name: Set up conda - uses: conda-incubator/setup-miniconda@v2 - with: - auto-update-conda: true - python-version: ${{ matrix.python-version }} - mamba-version: "*" - activate-environment: test - channels: conda-forge,defaults - channel-priority: true - - name: Install conda dependencies - # See https://github.com/conda-forge/boost-cpp-feedstock/issues/41 for why we - # use boost-cpp rather than boost from conda-forge - run: mamba install -q scons numpy cython ruamel.yaml boost-cpp eigen yaml-cpp - h5py pandas pytest mkl mkl-devel - shell: pwsh - - name: Install typing_extensions for Python 3.7 - if: matrix.python-version == '3.7' - run: mamba install -q typing_extensions - - name: Build Cantera - run: scons build system_eigen=y system_yamlcpp=y logging=debug - msvc_version=${{ matrix.vs-toolset }} f90_interface=n debug=n --debug=time -j2 - shell: pwsh - - name: Test Cantera - run: scons test show_long_tests=yes verbose_tests=yes --debug=time - shell: pwsh - - name: Test Install - # spot-check installation locations - run: | - scons install - test -f ${CONDA_PREFIX}/Library/lib/cantera_shared.dll - test -f ${CONDA_PREFIX}/Library/include/cantera/base/Solution.h - test -f ${CONDA_PREFIX}/Scripts/ck2yaml - test -f ${CONDA_PREFIX}/share/cantera/data/gri30.yaml - test -d ${CONDA_PREFIX}/share/cantera/samples - test -d ${CONDA_PREFIX}/share/cantera/samples/python - test -d ${CONDA_PREFIX}/Lib/site-packages/cantera - - name: Test Essentials - # ensure that Python package loads and converter scripts work - run: | - python -c 'import cantera as ct; import sys; sys.exit(0) if ct.__version__.startswith("3.0.0") else sys.exit(1)' - ck2yaml --input=test/data/h2o2.inp --output=h2o2-test.yaml - test -f h2o2-test.yaml - cti2yaml test/data/ch4_ion.cti ch4_ion-test.yaml - test -f ch4_ion-test.yaml - yaml2ck data/h2o2.yaml --mechanism=h2o2-test.ck - test -f h2o2-test.ck + # multiple-sundials: + # name: Sundials ${{ matrix.sundials-ver }} + # runs-on: ubuntu-latest + # timeout-minutes: 60 + # env: + # PYTHON_VERSION: 3.8 + # defaults: + # run: + # shell: bash -l {0} + # strategy: + # matrix: + # sundials-ver: [ 3, 4, 5.8, 6.2 ] + # fail-fast: false + # steps: + # - uses: actions/checkout@v2 + # name: Checkout the repository + # with: + # submodules: recursive + # - uses: conda-incubator/setup-miniconda@v2 + # with: + # auto-update-conda: true + # python-version: ${{ env.PYTHON_VERSION }} + # miniforge-version: latest + # activate-environment: test + # name: Set up conda + # - name: Install conda dependencies + # # See https://github.com/conda-forge/boost-cpp-feedstock/issues/41 for why we + # # use boost-cpp rather than boost from conda-forge + # run: | + # conda install -q sundials=${{ matrix.sundials-ver }} scons numpy ruamel.yaml \ + # cython boost-cpp fmt eigen yaml-cpp h5py pandas libgomp openblas pytest + # - name: Build Cantera + # run: | + # scons build system_fmt=y system_eigen=y system_yamlcpp=y system_sundials=y \ + # blas_lapack_libs='lapack,blas' -j2 logging=debug debug=n \ + # optimize_flags='-O3 -ffast-math -fno-finite-math-only' + # - name: Test Cantera + # run: scons test show_long_tests=yes verbose_tests=yes + # - name: Test Install + # # spot-check installation locations + # run: | + # scons install + # test -f ${CONDA_PREFIX}/lib/libcantera_shared.so + # test -f ${CONDA_PREFIX}/include/cantera/base/Solution.h + # test -f ${CONDA_PREFIX}/bin/ck2yaml + # test -f ${CONDA_PREFIX}/share/cantera/data/gri30.yaml + # test -d ${CONDA_PREFIX}/share/cantera/samples + # test -d ${CONDA_PREFIX}/share/cantera/samples/python + # test -d ${CONDA_PREFIX}/lib/python${{ env.PYTHON_VERSION }}/site-packages/cantera + # - name: Test Essentials + # # ensure that Python package loads and converter scripts work + # run: | + # python -c 'import cantera as ct; import sys; sys.exit(0) if ct.__version__.startswith("3.0.0") else sys.exit(1)' + # ck2yaml --input=test/data/h2o2.inp --output=h2o2-test.yaml + # test -f h2o2-test.yaml + # cti2yaml test/data/ch4_ion.cti ch4_ion-test.yaml + # test -f ch4_ion-test.yaml + # yaml2ck data/h2o2.yaml --mechanism=h2o2-test.ck + # test -f h2o2-test.ck - windows: - name: "Windows 2019, MSVC ${{ matrix.vs-toolset }}, Python ${{ matrix.python-version }}" - runs-on: windows-2019 - timeout-minutes: 60 - env: - BOOST_ROOT: ${{github.workspace}}/3rdparty/boost - BOOST_URL: https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.7z - strategy: - matrix: - vs-toolset: ['14.2'] - python-version: [ "3.7", "3.9", "3.10" ] - fail-fast: false - steps: - - uses: actions/checkout@v2 - name: Checkout the repository - with: - submodules: recursive - - name: Set Up Python - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - architecture: x64 - - name: Install Python dependencies - run: | - python -m pip install -U pip setuptools wheel - python -m pip install scons pypiwin32 numpy ruamel.yaml cython h5py pandas pytest pytest-github-actions-annotate-failures - - name: Install typing_extensions for Python 3.7 - if: matrix.python-version == '3.7' - run: python -m pip install typing_extensions - - name: Restore Boost cache - uses: actions/cache@v2 - id: cache-boost - with: - path: ${{env.BOOST_ROOT}} - key: boost + # windows-2022: + # name: ${{ matrix.os }}, MSVC ${{ matrix.vs-toolset }}, Python ${{ matrix.python-version }} + # runs-on: ${{ matrix.os }} + # timeout-minutes: 60 + # defaults: + # run: + # shell: bash -l {0} + # strategy: + # matrix: + # os: ["windows-2022"] + # vs-toolset: ["14.3"] # 'cl' is not recognized for earlier toolsets + # python-version: [ "3.7", "3.9", "3.10" ] + # fail-fast: false + # steps: + # - uses: actions/checkout@v2 + # name: Checkout the repository + # with: + # submodules: recursive + # - name: Set up conda + # uses: conda-incubator/setup-miniconda@v2 + # with: + # auto-update-conda: true + # python-version: ${{ matrix.python-version }} + # mamba-version: "*" + # activate-environment: test + # channels: conda-forge,defaults + # channel-priority: true + # - name: Install conda dependencies + # # See https://github.com/conda-forge/boost-cpp-feedstock/issues/41 for why we + # # use boost-cpp rather than boost from conda-forge + # run: mamba install -q scons numpy cython ruamel.yaml boost-cpp eigen yaml-cpp + # h5py pandas pytest mkl mkl-devel + # shell: pwsh + # - name: Install typing_extensions for Python 3.7 + # if: matrix.python-version == '3.7' + # run: mamba install -q typing_extensions + # - name: Build Cantera + # run: scons build system_eigen=y system_yamlcpp=y logging=debug + # msvc_version=${{ matrix.vs-toolset }} f90_interface=n debug=n --debug=time -j2 + # shell: pwsh + # - name: Test Cantera + # run: scons test show_long_tests=yes verbose_tests=yes --debug=time + # shell: pwsh + # - name: Test Install + # # spot-check installation locations + # run: | + # scons install + # test -f ${CONDA_PREFIX}/Library/lib/cantera_shared.dll + # test -f ${CONDA_PREFIX}/Library/include/cantera/base/Solution.h + # test -f ${CONDA_PREFIX}/Scripts/ck2yaml + # test -f ${CONDA_PREFIX}/share/cantera/data/gri30.yaml + # test -d ${CONDA_PREFIX}/share/cantera/samples + # test -d ${CONDA_PREFIX}/share/cantera/samples/python + # test -d ${CONDA_PREFIX}/Lib/site-packages/cantera + # - name: Test Essentials + # # ensure that Python package loads and converter scripts work + # run: | + # python -c 'import cantera as ct; import sys; sys.exit(0) if ct.__version__.startswith("3.0.0") else sys.exit(1)' + # ck2yaml --input=test/data/h2o2.inp --output=h2o2-test.yaml + # test -f h2o2-test.yaml + # cti2yaml test/data/ch4_ion.cti ch4_ion-test.yaml + # test -f ch4_ion-test.yaml + # yaml2ck data/h2o2.yaml --mechanism=h2o2-test.ck + # test -f h2o2-test.ck - - name: Install Boost Headers - if: steps.cache-boost.outputs.cache-hit != 'true' - run: | - BOOST_ROOT=$(echo $BOOST_ROOT | sed 's/\\/\//g') - mkdir -p $BOOST_ROOT - curl --progress-bar --location --output $BOOST_ROOT/download.7z $BOOST_URL - 7z -o$BOOST_ROOT x $BOOST_ROOT/download.7z -y -bd boost_1_78_0/boost - mv $BOOST_ROOT/boost_1_78_0/boost $BOOST_ROOT/boost - rm $BOOST_ROOT/download.7z - shell: bash - - name: Build Cantera - run: scons build -j2 boost_inc_dir=%BOOST_ROOT% debug=n logging=debug - python_package=full env_vars=USERPROFILE,GITHUB_ACTIONS - msvc_version=${{ matrix.vs-toolset }} f90_interface=n --debug=time - shell: cmd - - name: Test Cantera - run: scons test show_long_tests=yes verbose_tests=yes --debug=time + # windows: + # name: "Windows 2019, MSVC ${{ matrix.vs-toolset }}, Python ${{ matrix.python-version }}" + # runs-on: windows-2019 + # timeout-minutes: 60 + # env: + # BOOST_ROOT: ${{github.workspace}}/3rdparty/boost + # BOOST_URL: https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.7z + # strategy: + # matrix: + # vs-toolset: ['14.2'] + # python-version: [ "3.7", "3.9", "3.10" ] + # fail-fast: false + # steps: + # - uses: actions/checkout@v2 + # name: Checkout the repository + # with: + # submodules: recursive + # - name: Set Up Python + # uses: actions/setup-python@v2 + # with: + # python-version: ${{ matrix.python-version }} + # architecture: x64 + # - name: Install Python dependencies + # run: | + # python -m pip install -U pip setuptools wheel + # python -m pip install scons pypiwin32 numpy ruamel.yaml cython h5py pandas pytest pytest-github-actions-annotate-failures + # - name: Install typing_extensions for Python 3.7 + # if: matrix.python-version == '3.7' + # run: python -m pip install typing_extensions + # - name: Restore Boost cache + # uses: actions/cache@v2 + # id: cache-boost + # with: + # path: ${{env.BOOST_ROOT}} + # key: boost - # Adapted from https://www.scivision.dev/intel-oneapi-github-actions/ - linux-intel-oneapi: - name: intel-oneAPI on Ubuntu, Python 3.8 - runs-on: ubuntu-latest - timeout-minutes: 60 - env: - INTEL_REPO: https://apt.repos.intel.com - INTEL_KEY: GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB - steps: - - name: Intel Apt repository - timeout-minutes: 1 - run: | - wget ${INTEL_REPO}/intel-gpg-keys/${INTEL_KEY} - sudo apt-key add ${INTEL_KEY} - rm ${INTEL_KEY} - echo "deb ${INTEL_REPO}/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list - sudo apt-get update - - name: Install Intel oneAPI - timeout-minutes: 5 - run: | - sudo apt-get install intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic \ - intel-oneapi-mpi intel-oneapi-mpi-devel intel-oneapi-mkl ninja-build libboost-dev - - uses: actions/checkout@v2 - name: Checkout the repository - with: - submodules: recursive - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: 3.8 - architecture: x64 - - name: Upgrade pip - run: python3 -m pip install -U pip setuptools wheel - - name: Install Python dependencies - run: python3 -m pip install ruamel.yaml scons numpy cython h5py pandas pytest - pytest-github-actions-annotate-failures - - name: Setup Intel oneAPI environment - run: | - source /opt/intel/oneapi/setvars.sh - printenv >> $GITHUB_ENV - - name: Build Cantera - run: python3 `which scons` build env_vars=all CC=icx CXX=icpx -j2 debug=n - --debug=time f90_interface=n # FORTRAN=ifx - - name: Test Cantera - run: - python3 `which scons` test show_long_tests=yes verbose_tests=yes --debug=time + # - name: Install Boost Headers + # if: steps.cache-boost.outputs.cache-hit != 'true' + # run: | + # BOOST_ROOT=$(echo $BOOST_ROOT | sed 's/\\/\//g') + # mkdir -p $BOOST_ROOT + # curl --progress-bar --location --output $BOOST_ROOT/download.7z $BOOST_URL + # 7z -o$BOOST_ROOT x $BOOST_ROOT/download.7z -y -bd boost_1_78_0/boost + # mv $BOOST_ROOT/boost_1_78_0/boost $BOOST_ROOT/boost + # rm $BOOST_ROOT/download.7z + # shell: bash + # - name: Build Cantera + # run: scons build -j2 boost_inc_dir=%BOOST_ROOT% debug=n logging=debug + # python_package=full env_vars=USERPROFILE,GITHUB_ACTIONS + # msvc_version=${{ matrix.vs-toolset }} f90_interface=n --debug=time + # shell: cmd + # - name: Test Cantera + # run: scons test show_long_tests=yes verbose_tests=yes --debug=time + + # # Adapted from https://www.scivision.dev/intel-oneapi-github-actions/ + # linux-intel-oneapi: + # name: intel-oneAPI on Ubuntu, Python 3.8 + # runs-on: ubuntu-latest + # timeout-minutes: 60 + # env: + # INTEL_REPO: https://apt.repos.intel.com + # INTEL_KEY: GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB + # steps: + # - name: Intel Apt repository + # timeout-minutes: 1 + # run: | + # wget ${INTEL_REPO}/intel-gpg-keys/${INTEL_KEY} + # sudo apt-key add ${INTEL_KEY} + # rm ${INTEL_KEY} + # echo "deb ${INTEL_REPO}/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list + # sudo apt-get update + # - name: Install Intel oneAPI + # timeout-minutes: 5 + # run: | + # sudo apt-get install intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic \ + # intel-oneapi-mpi intel-oneapi-mpi-devel intel-oneapi-mkl ninja-build libboost-dev + # - uses: actions/checkout@v2 + # name: Checkout the repository + # with: + # submodules: recursive + # - name: Setup Python + # uses: actions/setup-python@v2 + # with: + # python-version: 3.8 + # architecture: x64 + # - name: Upgrade pip + # run: python3 -m pip install -U pip setuptools wheel + # - name: Install Python dependencies + # run: python3 -m pip install ruamel.yaml scons numpy cython h5py pandas pytest + # pytest-github-actions-annotate-failures + # - name: Setup Intel oneAPI environment + # run: | + # source /opt/intel/oneapi/setvars.sh + # printenv >> $GITHUB_ENV + # - name: Build Cantera + # run: python3 `which scons` build env_vars=all CC=icx CXX=icpx -j2 debug=n + # --debug=time f90_interface=n # FORTRAN=ifx + # - name: Test Cantera + # run: + # python3 `which scons` test show_long_tests=yes verbose_tests=yes --debug=time + + # linux-intel-oneapi-classic: + # name: intel-oneAPI classic on Ubuntu, Python 3.8 + # runs-on: ubuntu-latest + # timeout-minutes: 60 + # env: + # INTEL_REPO: https://apt.repos.intel.com + # INTEL_KEY: GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB + # steps: + # - name: Intel Apt repository + # timeout-minutes: 1 + # run: | + # wget ${INTEL_REPO}/intel-gpg-keys/${INTEL_KEY} + # sudo apt-key add ${INTEL_KEY} + # rm ${INTEL_KEY} + # echo "deb ${INTEL_REPO}/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list + # sudo apt-get update + # - name: Install Intel oneAPI + # timeout-minutes: 5 + # run: | + # sudo apt-get install intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic \ + # intel-oneapi-mpi intel-oneapi-mpi-devel intel-oneapi-mkl ninja-build libboost-dev + # - uses: actions/checkout@v2 + # name: Checkout the repository + # with: + # submodules: recursive + # - name: Setup Python + # uses: actions/setup-python@v2 + # with: + # python-version: 3.8 + # architecture: x64 + # - name: Upgrade pip + # run: python3 -m pip install -U pip setuptools wheel + # - name: Install Python dependencies + # run: python3 -m pip install ruamel.yaml scons numpy cython h5py pandas pytest + # pytest-github-actions-annotate-failures + # - name: Setup Intel oneAPI environment + # run: | + # source /opt/intel/oneapi/setvars.sh + # printenv >> $GITHUB_ENV + # - name: Build Cantera + # run: python3 `which scons` build env_vars=all CC=icc CXX=icpc -j2 debug=n + # --debug=time f90_interface=n # FORTRAN=ifort + # - name: Test Cantera + # run: + # python3 `which scons` test show_long_tests=yes verbose_tests=yes --debug=time - linux-intel-oneapi-classic: - name: intel-oneAPI classic on Ubuntu, Python 3.8 - runs-on: ubuntu-latest + # windows-mingw: + # name: mingw on Windows, Python 3.8 + # runs-on: windows-2019 + # timeout-minutes: 60 + # env: + # BOOST_ROOT: ${{github.workspace}}/3rdparty/boost + # BOOST_URL: https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.7z + # steps: + # - uses: actions/checkout@v2 + # name: Checkout the repository + # with: + # submodules: recursive + # - name: Set Up Python + # uses: actions/setup-python@v2 + # with: + # python-version: 3.8 + # architecture: x64 + # - name: Install Python dependencies + # run: | + # python -m pip install -U pip 'setuptools>=47.0.0,<48' wheel + # python -m pip install scons pypiwin32 numpy ruamel.yaml cython h5py pandas pytest pytest-github-actions-annotate-failures + # - name: Restore Boost cache + # uses: actions/cache@v2 + # id: cache-boost + # with: + # path: ${{env.BOOST_ROOT}} + # key: boost + # - name: Set up MinGW + # uses: egor-tensin/setup-mingw@v2 + # with: + # platform: x64 + # - name: Install Boost Headers + # if: steps.cache-boost.outputs.cache-hit != 'true' + # run: | + # BOOST_ROOT=$(echo $BOOST_ROOT | sed 's/\\/\//g') + # mkdir -p $BOOST_ROOT + # curl --progress-bar --location --output $BOOST_ROOT/download.7z $BOOST_URL + # 7z -o$BOOST_ROOT x $BOOST_ROOT/download.7z -y -bd boost_1_78_0/boost + # mv $BOOST_ROOT/boost_1_78_0/boost $BOOST_ROOT/boost + # rm $BOOST_ROOT/download.7z + # shell: bash + # - name: Build Cantera + # run: scons build -j2 boost_inc_dir=%BOOST_ROOT% debug=n logging=debug + # python_package=full env_vars=PYTHONPATH,GITHUB_ACTIONS + # toolchain=mingw f90_interface=n --debug=time + # shell: cmd + # - name: Test Cantera + # run: scons test show_long_tests=yes verbose_tests=yes --debug=time + + dotnet-ubuntu: + name: .NET on Linux + runs-on: ubuntu-22.04 + needs: ["ubuntu-multiple-pythons"] timeout-minutes: 60 - env: - INTEL_REPO: https://apt.repos.intel.com - INTEL_KEY: GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB steps: - - name: Intel Apt repository - timeout-minutes: 1 - run: | - wget ${INTEL_REPO}/intel-gpg-keys/${INTEL_KEY} - sudo apt-key add ${INTEL_KEY} - rm ${INTEL_KEY} - echo "deb ${INTEL_REPO}/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list - sudo apt-get update - - name: Install Intel oneAPI - timeout-minutes: 5 - run: | - sudo apt-get install intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic \ - intel-oneapi-mpi intel-oneapi-mpi-devel intel-oneapi-mkl ninja-build libboost-dev - uses: actions/checkout@v2 name: Checkout the repository - with: - submodules: recursive - name: Setup Python uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: '3.10' architecture: x64 - - name: Upgrade pip - run: python3 -m pip install -U pip setuptools wheel - - name: Install Python dependencies - run: python3 -m pip install ruamel.yaml scons numpy cython h5py pandas pytest - pytest-github-actions-annotate-failures - - name: Setup Intel oneAPI environment + - name: Install Apt dependencies run: | - source /opt/intel/oneapi/setvars.sh - printenv >> $GITHUB_ENV - - name: Build Cantera - run: python3 `which scons` build env_vars=all CC=icc CXX=icpc -j2 debug=n - --debug=time f90_interface=n # FORTRAN=ifort - - name: Test Cantera - run: - python3 `which scons` test show_long_tests=yes verbose_tests=yes --debug=time - - windows-mingw: - name: mingw on Windows, Python 3.8 - runs-on: windows-2019 - timeout-minutes: 60 - env: - BOOST_ROOT: ${{github.workspace}}/3rdparty/boost - BOOST_URL: https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.7z - steps: - - uses: actions/checkout@v2 - name: Checkout the repository - with: - submodules: recursive - - name: Set Up Python - uses: actions/setup-python@v2 - with: - python-version: 3.8 - architecture: x64 + sudo apt update + sudo apt install libblas3 liblapack3 + - name: Upgrade pip + run: python3 -m pip install -U pip setuptools - name: Install Python dependencies - run: | - python -m pip install -U pip 'setuptools>=47.0.0,<48' wheel - python -m pip install scons pypiwin32 numpy ruamel.yaml cython h5py pandas pytest pytest-github-actions-annotate-failures - - name: Restore Boost cache - uses: actions/cache@v2 - id: cache-boost + run: python3 -m pip install ruamel.yaml + - name: Setup .NET Core SDK + uses: actions/setup-dotnet@v2 with: - path: ${{env.BOOST_ROOT}} - key: boost - - name: Set up MinGW - uses: egor-tensin/setup-mingw@v2 + dotnet-version: '6.x' + - name: Download the Cantera shared library + uses: actions/download-artifact@v3 with: - platform: x64 - - name: Install Boost Headers - if: steps.cache-boost.outputs.cache-hit != 'true' + name: libcantera_shared.so + path: build/lib + - name: Build the .NET interface + run: dotnet build + working-directory: interfaces/dotnet + - name: Test the .NET interface + run: dotnet test + working-directory: interfaces/dotnet + - name: Run the .NET samples run: | - BOOST_ROOT=$(echo $BOOST_ROOT | sed 's/\\/\//g') - mkdir -p $BOOST_ROOT - curl --progress-bar --location --output $BOOST_ROOT/download.7z $BOOST_URL - 7z -o$BOOST_ROOT x $BOOST_ROOT/download.7z -y -bd boost_1_78_0/boost - mv $BOOST_ROOT/boost_1_78_0/boost $BOOST_ROOT/boost - rm $BOOST_ROOT/download.7z - shell: bash - - name: Build Cantera - run: scons build -j2 boost_inc_dir=%BOOST_ROOT% debug=n logging=debug - python_package=full env_vars=PYTHONPATH,GITHUB_ACTIONS - toolchain=mingw f90_interface=n --debug=time - shell: cmd - - name: Test Cantera - run: scons test show_long_tests=yes verbose_tests=yes --debug=time + dotnet run --project examples/Application + dotnet run --project examples/SoundSpeed + working-directory: interfaces/dotnet