Skip to content

Commit

Permalink
Some CI updates (#83)
Browse files Browse the repository at this point in the history
* move conda environment files

* speedup doc build on readthedocs

* add github action lint (flake8 + black)
  • Loading branch information
benbovy committed Dec 18, 2019
1 parent 112d50c commit 4ee4be9
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 9 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: lint

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
name: flake8-black
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings.
flake8 . --count --exit-zero --max-complexity=10 --statistics
- name: Check formatting with black
run: |
pip install black
black --check .
10 changes: 3 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ matrix:
- python: 3.7
env: CONDA_ENV=py37-attrs-dev
- python: 3.7
env: CONDA_ENV=docs
env: CONDA_ENV=doc
allow_failures:
- python: 3.7
env: CONDA_ENV=py37-xarray-dev
Expand All @@ -39,18 +39,14 @@ before_install:
- conda info -a

install:
- if [[ "$CONDA_ENV" == "docs" ]]; then
conda env create -n test_env --file doc/environment.yml;
else
conda env create -n test_env --file ci/requirements-$CONDA_ENV.yml;
fi
- conda env create -n test_env --file ci/requirements/$CONDA_ENV.yml;
- source activate test_env
- conda list
- pip install --no-deps -e .

script:
- python -OO -c "import xsimlab"
- if [[ "$CONDA_ENV" == "docs" ]]; then
- if [[ "$CONDA_ENV" == "doc" ]]; then
conda install -c conda-forge sphinx_rtd_theme;
cd doc;
sphinx-build -n -j auto -b html -d _build/doctrees . _build/html;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 5 additions & 2 deletions readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
build:
image: latest
conda:
file: doc/environment.yml
file: ci/requirements/doc.yml
python:
version: 3.5
version: 3.7
setup_py_install: true
formats: []

0 comments on commit 4ee4be9

Please sign in to comment.