-
-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added installation for clang-format in docker file * moved pydp folver under src * moved pydp folver under src * moved pydp folver under src * moved pydp folder under src * moved pydp folder under src * moved pydp folder under src * moved pydp folder under src * moved pydp folder under src * moved pydp folder under src * moved pydp folder under src * moved pydp folder under src * moved pydp folder under src * moved pydp folder under src * moved pydp folder under src * Explicitly tell pybind which python to use * Fix CI tests * removed bin files * Install and test wheel in a different job * Split py35 tests * Include package from src * Add macos wheel fix Co-authored-by: Alejandro Sánchez Medina <[email protected]>
- Loading branch information
1 parent
dbf75ee
commit b423675
Showing
27 changed files
with
416 additions
and
91 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,169 @@ | ||
name: Tests-py35 | ||
|
||
on: | ||
push: | ||
branches: | ||
- master, dev | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
# max-parallel: 6 | ||
matrix: | ||
os: [ubuntu-20.04, macOS-10.15, windows-2019] | ||
python-version: [3.5] | ||
|
||
# Timeout: https://stackoverflow.com/a/59076067/4521646 | ||
timeout-minutes: 35 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Setup Bazel | ||
uses: abhinavsingh/setup-bazel@v3 | ||
|
||
- name: Set up packages | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install setuptools wheel pytest gcovr coverage twine==1.15.0 | ||
- name: Build PyDP with coverage (Unix) | ||
if: runner.os != 'Windows' | ||
# --expunge is needed as there is an intermittent error on macOS for which this seems to be the solution | ||
# Ref: https://github.com/bazelbuild/rules_go/issues/2221 | ||
run: | | ||
bazel clean --expunge | ||
./build_PyDP.sh | ||
- name: Build PyDP with coverage (Windows) | ||
if: runner.os == 'Windows' | ||
run: | | ||
bazel clean --expunge | ||
$PYTHONHOME=$(python -c 'import sys; print(sys.executable);').Replace('\', '/') | ||
$PYTHONPATH=$(python -c "import sys; print([x for x in sys.path if 'site-packages' in x][0]);").Replace('\', '/') | ||
echo "PYTHONHOME=$PYTHONHOME" | ||
echo "PYTHONPATH=$PYTHONPATH" | ||
bazel build src/python:bindings_test ` | ||
--config Windows ` | ||
--verbose_failures ` | ||
--action_env=PYTHON_BIN_PATH=$PYTHONHOME ` | ||
--action_env=PYTHON_LIB_PATH=$PYTHONPATH | ||
copy bazel-bin\src\bindings\_pydp.so src\pydp\_pydp.pyd | ||
- name: Make wheel (linux and windows) | ||
if: runner.os != 'macOS' | ||
run: | | ||
python setup.py sdist | ||
python setup.py bdist_wheel | ||
- name: Make wheel (macOS) | ||
if: runner.os == 'macOS' | ||
run: | | ||
python setup.py sdist | ||
python setup.py bdist_wheel --plat-name macosx_10_15_x86_64 | ||
- name: Upload dist folder as artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: dist-${{matrix.os}}-${{matrix.python-version}} | ||
path: dist | ||
retention-days: 3 | ||
|
||
- name: Upload test folder as artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: tests-${{matrix.os}}-${{matrix.python-version}} | ||
path: tests | ||
retention-days: 3 | ||
|
||
- name: Mypy test | ||
run: | | ||
python -m pip install mypy | ||
mypy tests/ src/pydp/ | ||
mypy examples/Tutorial_1-carrots_demo | ||
mypy examples/Tutorial_2-restaurant_demo | ||
#################################################################### | ||
##### | ||
#################################################################### | ||
|
||
# Currently failing | ||
# poetry run mypy examples/Tutorial_3-Titanic_demo | ||
|
||
# Need to see how to run the c++ code coverage | ||
# - name: Check C++ code coverage | ||
# if: runner.os == 'Linux' # Coverage will be the same on all systems so only running the check on Linux | ||
# run: | | ||
# make check-coverage-cpp | ||
|
||
fresh-wheel-install: | ||
needs: build | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-20.04, macOS-10.15, windows-2019] | ||
python-version: [3.5] | ||
timeout-minutes: 35 | ||
|
||
steps: | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install needed packages | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install setuptools wheel pytest gcovr coverage twine==1.15.0 | ||
python -m pip install matplotlib | ||
python -m pip install seaborn | ||
python -m pip install coverage | ||
- name: Download dist folder as artifact | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: dist-${{matrix.os}}-${{matrix.python-version}} | ||
path: dist | ||
|
||
- name: Download test folder as artifact | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: tests-${{matrix.os}}-${{matrix.python-version}} | ||
path: tests | ||
|
||
- name: Install PyDP wheel (Unix) | ||
if: runner.os != 'Windows' | ||
run: | | ||
python -m pip install --upgrade --force-reinstall ./dist/*.whl | ||
- name: Install PyDP wheel (Windows) | ||
if: runner.os == 'Windows' | ||
run: | | ||
python -m pip install --upgrade --force-reinstall (get-item .\dist\*.whl) | ||
- name: Run tests | ||
run: | | ||
coverage run -m pytest tests | ||
- name: Check Python code coverage | ||
if: runner.os == 'Linux' # Coverage will be the same on all systems so only running the check on Linux | ||
run: | | ||
coverage report --fail-under ${MIN_COVERAGE} | ||
env: | ||
MIN_COVERAGE: 75 |
Oops, something went wrong.