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

Replace Travis with Github Actions #1158

Merged
merged 31 commits into from
Mar 10, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
97 changes: 97 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# 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: Python package

on: [pull_request]

jobs:
test_conda:
name: Conda (${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.7", "3.8"]
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
channels: conda-forge,spyder-ide
channel-priority: flexible

- name: Conda info
shell: bash -l {0}
run: conda info
- name: Add conda to system path
shell: bash -l {0}
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Install dependencies
shell: bash -l {0}
run: |
conda config --set always_yes yes --set changeps1 no
conda update -n base conda --yes
conda env create -f tests/requirements.txt -n yellowbrick python=${{ matrix.python-version }}
- name: Test with pytest
shell: bash -l {0}
run: |
conda activate yellowbrick
python -m nltk.downloader popular
make test

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false


test_pypi:
name: PyPi (${{ matrix.python-version }}, ${{ matrix.os }})
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8]
os: [ubuntu-latest, macos-latest, windows-latest]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r tests/requirements.txt
python -m pip install coveralls
- name: Test with pytest
run: |
python -m nltk.downloader popular
make test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false


slackNotification:
name: Slack Notification
needs: [test_pypi, test_conda]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
53 changes: 0 additions & 53 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ tests = True
test=pytest

[tool:pytest]
addopts = --verbose --cov=yellowbrick --flakes --spec
addopts = --verbose --cov=yellowbrick --flakes --spec --cov-report=xml --cov-report term
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allow codecov integration to work

python_files = tests/*
flakes-ignore =
__init__.py UnusedImport
Expand Down
2 changes: 1 addition & 1 deletion tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ cycler==0.10.0
pytest==6.1.1
pytest-cov==2.10.1
pytest-flakes==4.0.2
pytest-spec==3.0.4
pytest-spec>=2.0.0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

downgrade to allow conda to work

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for making this fix!

coverage==5.3

# Optional Testing Dependencies
Expand Down