Skip to content
Snippets Groups Projects
Unverified Commit 8e21fb63 authored by Quoc-Tuan Truong's avatar Quoc-Tuan Truong Committed by GitHub
Browse files

Test all platforms on master branch (#422)

parent 1fdee503
No related branches found
No related tags found
No related merge requests found
...@@ -11,33 +11,42 @@ on: ...@@ -11,33 +11,42 @@ on:
jobs: jobs:
build: build:
name: Building on ${{ matrix.os }}
runs-on: ubuntu-18.04 runs-on: ${{ matrix.os }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-18.04, macos-latest, windows-latest]
python-version: [3.6, 3.7, 3.8, 3.9] python-version: [3.6, 3.7, 3.8, 3.9]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: ${{ matrix.python-version }} 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 - name: Display Python version
run: python -c "import sys; print(sys.version)" run: python -c "import sys; print(sys.version)"
- name: Install dependencies - name: Install dependencies
run: | run: |
python -m pip install --upgrade pip 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] python -m pip install -e .[tests]
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8 - name: Lint with flake8
run: | run: |
# stop the build if there are Python syntax errors or undefined names # stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide # 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 flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest - name: Test with pytest
run: | run: |
python -m pytest --cov=cornac python -m pytest --cov=cornac
...@@ -17,6 +17,7 @@ jobs: ...@@ -17,6 +17,7 @@ jobs:
name: Building on ${{ matrix.os }} name: Building on ${{ matrix.os }}
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
fail-fast: false
matrix: matrix:
os: [ubuntu-18.04, macos-latest, windows-latest] os: [ubuntu-18.04, macos-latest, windows-latest]
python-version: [3.6, 3.7, 3.8, 3.9] python-version: [3.6, 3.7, 3.8, 3.9]
...@@ -28,17 +29,14 @@ jobs: ...@@ -28,17 +29,14 @@ jobs:
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: ${{ matrix.python-version }} 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 - name: Display Python version
run: python -c "import sys; print(sys.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 - name: Install dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
......
...@@ -97,8 +97,8 @@ else: ...@@ -97,8 +97,8 @@ else:
os.environ["CC"] = gcc os.environ["CC"] = gcc
os.environ["CXX"] = gcc os.environ["CXX"] = gcc
else: else:
USE_OPENMP = False USE_OPENMP = False
print("No GCC available. Install gcc from Homebrew " "using brew install gcc.") print("No GCC available. Install gcc from Homebrew using brew install gcc.")
# required arguments for default gcc of OSX # required arguments for default gcc of OSX
compile_args.extend(["-O2", "-stdlib=libc++", "-mmacosx-version-min=10.7"]) compile_args.extend(["-O2", "-stdlib=libc++", "-mmacosx-version-min=10.7"])
link_args.extend(["-O2", "-stdlib=libc++", "-mmacosx-version-min=10.7"]) link_args.extend(["-O2", "-stdlib=libc++", "-mmacosx-version-min=10.7"])
...@@ -305,7 +305,7 @@ setup( ...@@ -305,7 +305,7 @@ setup(
extras_require={"tests": ["pytest", "pytest-pep8", "pytest-xdist", "pytest-cov"]}, extras_require={"tests": ["pytest", "pytest-pep8", "pytest-xdist", "pytest-cov"]},
cmdclass=cmdclass, cmdclass=cmdclass,
packages=find_packages(), packages=find_packages(),
classifiers=( classifiers=[
"Development Status :: 5 - Production/Stable", "Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research", "Intended Audience :: Science/Research",
"Intended Audience :: Education", "Intended Audience :: Education",
...@@ -318,5 +318,5 @@ setup( ...@@ -318,5 +318,5 @@ setup(
"License :: OSI Approved :: Apache Software License", "License :: OSI Approved :: Apache Software License",
"Topic :: Software Development", "Topic :: Software Development",
"Topic :: Scientific/Engineering", "Topic :: Scientific/Engineering",
), ],
) )
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment