Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add Python 3.10 to the CI runners #1145

Merged
merged 7 commits into from
Dec 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 59 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [ '3.6', '3.7', '3.8', '3.9' ]
python-version: [ '3.6', '3.9', '3.10' ]
os: ['ubuntu-18.04', 'ubuntu-20.04']
fail-fast: false
steps:
Expand All @@ -36,7 +36,7 @@ jobs:
- name: Install Apt dependencies
run: |
sudo apt update
sudo apt install libboost-dev gfortran
sudo apt install libboost-dev gfortran libopenmpi-dev
- name: Upgrade pip
run: python3 -m pip install -U pip setuptools wheel
- name: Install Python dependencies
Expand All @@ -47,15 +47,43 @@ jobs:
- name: Test Cantera
run:
python3 `which scons` test show_long_tests=yes verbose_tests=yes --debug=time
env:
GITHUB_ACTIONS: "true"

clang-compiler:
name: LLVM/Clang with Python 3.8
runs-on: ubuntu-20.04
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
- 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

macos-multiple-pythons:
name: macOS with Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [ '3.7', '3.8', '3.9' ]
python-version: [ '3.7', '3.9', '3.10' ]
os: ['macos-10.15']
fail-fast: false
steps:
Expand Down Expand Up @@ -88,8 +116,6 @@ jobs:
- name: Test Cantera
run:
python3 `which scons` test show_long_tests=yes verbose_tests=yes --debug=time
env:
GITHUB_ACTIONS: "true"

# Coverage is its own job because macOS builds of the samples
# use Homebrew gfortran which is not compatible for coverage
Expand All @@ -116,20 +142,33 @@ jobs:
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-github-actions-annotate-failures 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 env_vars=all -j2 --debug=time
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
env:
GITHUB_ACTIONS: "true"
- 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 code coverage results
uses: actions/upload-artifact@v2
with:
name: code-coverage-report
path: htmlcoverage*
retention-days: 5
- name: Upload Coverage to Codecov
run: bash <(curl -s https://codecov.io/bash)
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
uses: codecov/codecov-action@v2
with:
verbose: true
files: ./coverage.xml
fail_ci_if_error: true

docs:
name: Build docs
Expand Down Expand Up @@ -176,6 +215,7 @@ jobs:
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
Expand Down Expand Up @@ -203,7 +243,7 @@ jobs:
runs-on: ubuntu-18.04
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9']
python-version: ['3.6', '3.9', '3.10']
fail-fast: false
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -238,6 +278,8 @@ jobs:
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()
Expand All @@ -250,7 +292,7 @@ jobs:
shell: bash -l {0}
strategy:
matrix:
sundials-ver: [ 2, 3, 4, 5.7 ]
sundials-ver: [ 2, 3, 4, 5.8 ]
fail-fast: false
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -315,7 +357,7 @@ jobs:
matrix:
os: ['windows-2019']
vs-toolset: ['14.0', '14.2']
python-version: [ '3.6', '3.7', '3.8', '3.9' ]
python-version: [ '3.6', '3.9', '3.10' ]
# Must use windows-2016 image because it installs VS2017 (MSVC 14.1)
# Scons cannot find MSVC 14.1 when VS2019 is installed
include:
Expand Down Expand Up @@ -370,8 +412,6 @@ jobs:
shell: cmd
- name: Test Cantera
run: scons test show_long_tests=yes verbose_tests=yes --debug=time
env:
GITHUB_ACTIONS: "true"

# Adapted from https://www.scivision.dev/intel-oneapi-github-actions/
linux-intel-oneapi:
Expand Down
14 changes: 12 additions & 2 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ config_options = [
scripts).""",
{
"cl": "/openmp",
"icc": "openmp",
"icc": "-qopenmp",
"icx": "-qopenmp",
"apple-clang": "-Xpreprocessor -fopenmp",
"default": "-fopenmp",
Expand Down Expand Up @@ -1177,7 +1177,17 @@ else:
env['cxx_stdlib'] = []

env['HAS_CLANG'] = conf.CheckDeclaration('__clang__', '', 'C++')
env['HAS_OPENMP'] = conf.CheckLibWithHeader("omp", "omp.h", language="C++")
if not env["using_apple_clang"]:
# This checks for these three libraries in order and stops when it finds the
# first success. Intel = iomp5, LLVM/clang = omp, GCC = gomp. Since gomp is
# likely to be installed on the system even if other compilers are installed
# or in use, it needs to go last in the check.
env['HAS_OPENMP'] = conf.CheckLibWithHeader(
["iomp5", "omp", "gomp"], "omp.h", language="C++"
)
else:
env["HAS_OPENMP"] = False
logger.info("Not checking for OpenMP support due to using XCode compiler.")

boost_version_source = get_expression_value(['<boost/version.hpp>'], 'BOOST_LIB_VERSION')
retcode, boost_lib_version = conf.TryRun(boost_version_source, '.cpp')
Expand Down
4 changes: 2 additions & 2 deletions ext/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,12 @@ def generate_license(target, source, env):


localenv["license_files"] = license_files
license = build(localenv.Command("LICENSE.txt", license_files.values(),
license = build(localenv.Command("LICENSE.txt", list(license_files.values()),
generate_license))
env["license_target"] = license
install('$inst_docdir', license)

if env['OS'] == 'Windows':
# RTF version is required for Windows installer
build(localenv.Command("LICENSE.rtf", license_files.values(),
build(localenv.Command("LICENSE.rtf", list(license_files.values()),
generate_license))