Skip to content

Commit

Permalink
Use GitHub workflow as CI/CD (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
anders-kiaer authored Apr 5, 2020
1 parent 5139c30 commit e5255ce
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 71 deletions.
98 changes: 98 additions & 0 deletions .github/workflows/webviz-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: webviz-config

on:
push:
branches:
- master
pull_request:
branches:
- master
release:
types:
- published
schedule:
# Run CI daily and check that tests are working with latest dependencies
- cron: '0 0 * * *'

jobs:

webviz-config:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8']
pandas-version: ['0.24.2', '1.*'] # Necessary as long as RHEL6 is used internally

steps:
- name: Checkout commit locally
uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Install webviz-config with dependencies
run: |
pip install 'pandas==${{ matrix.pandas-version }}'
pip install --upgrade pip
pip install .
- name: Install test dependencies
run: |
pip install .[tests]
pip install dash[testing]
wget https://chromedriver.storage.googleapis.com/$(wget https://chromedriver.storage.googleapis.com/LATEST_RELEASE -q -O -)/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
- name: List all installed packages
run: pip freeze

- name: Check code style & linting
run: |
black --check webviz_config tests setup.py
pylint webviz_config tests setup.py
bandit -r -c ./bandit.yml webviz_config tests setup.py
mypy --package webviz_config --ignore-missing-imports --disallow-untyped-defs --show-error-codes
- name: Run tests
run: |
webviz certificate
webviz preferences --theme default
pytest ./tests --headless --forked
pushd ./docs
python build_docs.py
popd
- name: Build and deploy Python package
if: github.event_name == 'release' && matrix.python-version == '3.6'
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.pypi_webviz_token }}
run: |
python -m pip install --upgrade setuptools wheel twine
python setup.py sdist bdist_wheel
twine upload dist/*
- name: Update GitHub pages
if: github.ref == 'refs/heads/master' && matrix.python-version == '3.6'
run: |
cp -R ./docs/_build ../_build
git config --local user.email "webviz-github-action"
git config --local user.name "webviz-github-action"
git fetch origin gh-pages
git checkout --track origin/gh-pages
git clean -f -f -d -x
git rm -r *
cp -R ../_build/* .
git add .
if git diff-index --quiet HEAD; then
echo "No changes in documentation. Skip documentation deploy."
else
git commit -m "Update Github Pages"
git push "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" gh-pages
fi
59 changes: 0 additions & 59 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

<p align="center">
<a href="https://badge.fury.io/py/webviz-config"><img src="https://badge.fury.io/py/webviz-config.svg"></a>
<a href="https://equinor.github.io/webviz-config"><img src="https://img.shields.io/badge/docs-passing-brightgreen"></a>
<a href="https://equinor.github.io/webviz-config"><img src="https://img.shields.io/badge/docs-passing-brightgreen"></a>
<a href="https://github.com/equinor/webviz-config/blob/master/LICENSE"><img src="https://img.shields.io/github/license/equinor/webviz-config.svg?color=dark-green"></a>
<a href="https://travis-ci.org/equinor/webviz-config"><img src="https://travis-ci.org/equinor/webviz-config.svg?branch=master"></a>
<a href="https://github.com/equinor/webviz-config/actions?query=branch%3Amaster"><img src="https://github.com/equinor/webviz-config/workflows/webviz-config/badge.svg"></a>
<a href="https://lgtm.com/projects/g/equinor/webviz-config/alerts/"><img alt="Total alerts" src="https://img.shields.io/lgtm/alerts/g/equinor/webviz-config.svg?logo=lgtm&logoWidth=18"/></a>
<a href="https://lgtm.com/projects/g/equinor/webviz-config/context:python"><img alt="Language grade: Python" src="https://img.shields.io/lgtm/grade/python/g/equinor/webviz-config.svg?logo=lgtm&logoWidth=18"/></a>
<a href="https://www.python.org/"><img src="https://img.shields.io/badge/python-3.6%20|%203.7%20|%203.8-blue.svg"></a>
Expand Down
20 changes: 10 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@
install_requires=[
# Pinning dash to the 1.7-series as long as
# https://github.com/plotly/dash-core-components/issues/746 is open
"dash~=1.7.0",
"bleach~=3.1",
"cryptography~=2.4",
"flask-caching~=1.4",
"flask-talisman~=0.6",
"jinja2~=2.10",
"markdown~=3.0",
"pandas~=0.24",
"pyarrow~=0.16",
"pyyaml~=5.1",
"dash==1.7",
"bleach>=3.1",
"cryptography>=2.4",
"flask-caching>=1.4",
"flask-talisman>=0.6",
"jinja2>=2.10",
"markdown>=3.0",
"pandas>=0.24",
"pyarrow>=0.16",
"pyyaml>=5.1",
"webviz-core-components>=0.0.16",
],
tests_require=TESTS_REQUIRES,
Expand Down

0 comments on commit e5255ce

Please sign in to comment.