Skip to content

Commit

Permalink
Test all platforms on master branch (#422)
Browse files Browse the repository at this point in the history
  • Loading branch information
tqtg authored Jul 13, 2021
1 parent 1fdee50 commit 8e21fb6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,42 @@ on:

jobs:
build:

runs-on: ubuntu-18.04
name: Building on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, macos-latest, windows-latest]
python-version: [3.6, 3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Brew unlink gcc@9 to avoid build error with OpenMP on MacOS
if: matrix.os == 'macos-latest'
run: brew unlink gcc@9

- name: Display Python version
run: python -c "import sys; print(sys.version)"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --only-binary=numpy,scipy numpy~=1.19.0 scipy Cython pytest pytest-cov codecov flake8
python -m pip install --only-binary=numpy,scipy numpy~=1.19.0 scipy Cython pytest pytest-cov flake8
python -m pip install -e .[tests]
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
python -m pytest --cov=cornac
14 changes: 6 additions & 8 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
name: Building on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, macos-latest, windows-latest]
python-version: [3.6, 3.7, 3.8, 3.9]
Expand All @@ -28,17 +29,14 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}


- name: Brew unlink gcc@9 to avoid build error with OpenMP on MacOS
if: matrix.os == 'macos-latest'
run: brew unlink gcc@9

- name: Display Python version
run: python -c "import sys; print(sys.version)"

- name: Install GCC with OpenMP support for MacOS
if: matrix.os == 'macos-latest'
run: |
brew reinstall gcc@9
brew unlink gcc
brew link gcc
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ def extract_gcc_binaries():
os.environ["CC"] = gcc
os.environ["CXX"] = gcc
else:
USE_OPENMP = False
print("No GCC available. Install gcc from Homebrew " "using brew install gcc.")
USE_OPENMP = False
print("No GCC available. Install gcc from Homebrew using brew install gcc.")
# required arguments for default gcc of OSX
compile_args.extend(["-O2", "-stdlib=libc++", "-mmacosx-version-min=10.7"])
link_args.extend(["-O2", "-stdlib=libc++", "-mmacosx-version-min=10.7"])
Expand Down Expand Up @@ -305,7 +305,7 @@ def extract_gcc_binaries():
extras_require={"tests": ["pytest", "pytest-pep8", "pytest-xdist", "pytest-cov"]},
cmdclass=cmdclass,
packages=find_packages(),
classifiers=(
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"Intended Audience :: Education",
Expand All @@ -318,5 +318,5 @@ def extract_gcc_binaries():
"License :: OSI Approved :: Apache Software License",
"Topic :: Software Development",
"Topic :: Scientific/Engineering",
),
],
)

0 comments on commit 8e21fb6

Please sign in to comment.