-
-
Notifications
You must be signed in to change notification settings - Fork 557
130 lines (110 loc) · 3.61 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# 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: Yellowbrick CI
on:
# Trigger on push to the primary branches and all versioned tags
push:
branches:
- develop
- main
tags:
- 'v*'
# Trigger on pull request always (note the trailing colon)
pull_request:
jobs:
# Test Vanilla Python (using PyPI for dependencies) as a matrix.
test_pypi:
runs-on: ${{ matrix.os }}
name: PyPi (${{ matrix.python-version }}, ${{ matrix.os }})
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout Code
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 nltk.downloader popular
- name: Run Unit Tests
run: |
make test
- name: Upload Coverage
uses: codecov/codecov-action@v1
with:
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false
# Test Anaconda Python (using conda-forge for dependencies)
test_conda:
runs-on: ${{ matrix.os }}
name: Conda (${{ matrix.python-version }}, ${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.8", "3.9"]
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Conda ${{ matrix.python-version }}
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 }}
conda activate yellowbrick
python -m nltk.downloader popular
- name: Run Unit Tests
shell: bash -l {0}
run: |
conda activate yellowbrick
make test
- name: Upload Coverage
uses: codecov/codecov-action@v1
with:
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false
# Test building docs using Sphinx since this also runs a lot of Yellowbrick code
test_docs:
runs-on: ubuntu-latest
name: Build Docs
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r docs/requirements.txt
- name: Run Sphinx
uses: ammaraskar/sphinx-action@master
with:
docs-folder: "docs/"