Skip to content

Commit

Permalink
Add the Coveralls step to the Github Actions workflow (#272)
Browse files Browse the repository at this point in the history
  • Loading branch information
izeigerman committed Jul 24, 2020
1 parent 02a453e commit 591ce95
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 47 deletions.
3 changes: 3 additions & 0 deletions .ci/setup.sh
Expand Up @@ -2,6 +2,9 @@

set -e

pip install Cython numpy
pip install -r $BUILD_DIRECTORY/requirements-test.txt

# Install .NET Core SDK.
if [[ $LANG == *"c_sharp"* ]] || [[ $LANG == *"f_sharp"* ]] || [[ $LANG == *"visual_basic"* ]]; then
wget -q https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb
Expand Down
4 changes: 1 addition & 3 deletions .ci/test.sh
Expand Up @@ -7,9 +7,7 @@ cd $BUILD_DIRECTORY
if [[ $TEST == "API" ]]; then
flake8 .
pytest -v tests/ --cov=m2cgen/ --ignore=tests/e2e/
if [[ $TRAVIS == "true" ]]; then
coveralls
fi
coveralls
fi

if [[ $TEST == "E2E" ]]; then
Expand Down
56 changes: 40 additions & 16 deletions .github/workflows/main.yml
Expand Up @@ -10,7 +10,36 @@ on:

jobs:
test:
name: "Python ${{ matrix.python }}, Test: ${{ matrix.lang }}"
name: "Python ${{ matrix.python }} API tests"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python:
- 3.6
- 3.7
- 3.8
steps:
- name: Checkout repository
uses: actions/checkout@v1
with:
fetch-depth: 5
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Setup dependencies and run API tests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TEST: API
PYTHON: ${{ matrix.python }}
BUILD_DIRECTORY: ${{ github.workspace }}
run: |
bash $GITHUB_WORKSPACE/.ci/setup.sh
bash $GITHUB_WORKSPACE/.ci/test.sh
e2e-test:
name: "Python ${{ matrix.python }} E2E tests"
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -20,7 +49,6 @@ jobs:
- 3.7
- 3.8
lang:
- "API"
- "c_lang or python or java or go_lang or javascript or php or haskell or ruby"
- "c_sharp or visual_basic or f_sharp"
- "r_lang or dart"
Expand All @@ -34,20 +62,16 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Setup dependencies and run tests
- name: Setup dependencies and run E2E tests
env:
TEST: E2E
LANG: ${{ matrix.lang }}
PYTHON: ${{ matrix.python }}
BUILD_DIRECTORY: ${{ github.workspace }}
LC_ALL: en_US.UTF-8
run: |
if [[ "${{ matrix.lang }}" == "API" ]]; then
export TEST="API";
else
export TEST="E2E";
export LC_ALL="en_US.UTF-8";
sudo locale-gen $LC_ALL;
sudo update-locale;
fi
export PYTHON="${{ matrix.python }}"
export LANG="${{ matrix.lang }}"
export BUILD_DIRECTORY=$GITHUB_WORKSPACE
sudo locale-gen $LC_ALL
sudo update-locale
bash $GITHUB_WORKSPACE/.ci/setup.sh
pip install Cython numpy
pip install -r $GITHUB_WORKSPACE/requirements-test.txt
bash $GITHUB_WORKSPACE/.ci/test.sh
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion requirements-test.txt
Expand Up @@ -9,7 +9,7 @@ git+git://github.com/scikit-learn-contrib/lightning.git@782c18c12961e509099ae84c
flake8==3.8.3
pytest==5.4.3
pytest-mock==3.2.0
coveralls==2.1.0
coveralls==2.1.1
pytest-cov==2.10.0

# Other stuff
Expand Down

0 comments on commit 591ce95

Please sign in to comment.