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

Replaced Travis CI with GitHub Actions #1120

Merged
merged 10 commits into from
Mar 15, 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
96 changes: 96 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: PyTest Ludwig

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
pytest:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
python-version: [ 3.6, 3.7, 3.8 ]
include:
- python-version: 3.6
tensorflow-version: 2.3.1
- python-version: 3.7
tensorflow-version: 2.4.0
- python-version: 3.8
tensorflow-version: nightly
env:
TENSORFLOW: ${{ matrix.tensorflow-version }}

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

- name: Setup Linux
if: runner.os == 'linux'
run: |
sudo apt-get install -y cmake libsndfile1

- name: Setup macOS
if: runner.os == 'macOS'
run: |
brew install libuv

- name: pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-py${{ matrix.python-version }}-tf${{ matrix.tensorflow-version }}-${{ hashFiles('requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-py${{ matrix.python-version }}-tf${{ matrix.tensorflow-version }}-

- name: Install dependencies
env:
HOROVOD_WITH_TENSORFLOW: 1
HOROVOD_WITHOUT_MPI: 1
HOROVOD_WITHOUT_PYTORCH: 1
HOROVOD_WITHOUT_MXNET: 1
run: |
python --version
pip --version
python -m pip install -U pip
if [ $TENSORFLOW == "nightly" ]; then
cat requirements.txt | sed '/^tensorflow[>=<]/d' > requirements-temp && mv requirements-temp requirements.txt
cat requirements_horovod.txt | sed 's/\[tensorflow\]//g' > requirements-temp && mv requirements-temp requirements_horovod.txt
pip install tf-nightly
pip install --no-cache-dir git+https://github.com/horovod/horovod.git@master
else
pip install tensorflow==$TENSORFLOW
fi
pip install --no-build-isolation --no-use-pep517 ConfigSpace # temporary fix: https://github.com/automl/ConfigSpace/issues/173
pip install '.[test]'
pip list
shell: bash

- name: Reinstall Horovod if necessary
env:
HOROVOD_WITH_TENSORFLOW: 1
HOROVOD_WITHOUT_MPI: 1
HOROVOD_WITHOUT_PYTORCH: 1
HOROVOD_WITHOUT_MXNET: 1
run: |
HOROVOD_BUILT=$(python -c "import horovod.tensorflow; horovod.tensorflow.nccl_built(); print('SUCCESS')" || true)
if [[ $HOROVOD_BUILT != "SUCCESS" ]]; then
pip uninstall -y horovod
pip install --no-cache-dir git+https://github.com/horovod/horovod.git@master
fi
horovodrun --check-build
shell: bash

- name: Tests
run: |
pytest -v --timeout 300 --durations 10 tests
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion tests/integration_tests/test_postprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

import os

import mock
import numpy as np
import pandas as pd
import pytest
import tensorflow as tf
from unittest import mock

from ludwig.api import LudwigModel
from ludwig.constants import NAME
Expand Down