-
Notifications
You must be signed in to change notification settings - Fork 38
114 lines (96 loc) · 3.91 KB
/
webviz-config.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
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
env:
PYTHONWARNINGS: default # We want to see e.g. DeprecationWarnings
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8']
pandas-version: ['0.24.2', '1.*'] # Necessary as long as RHEL6 is used internally
exclude:
# Skip Python 3.8 and Pandas 0.24.2 combination due to missing 3.8 wheel for that specific pandas version
- python-version: '3.8'
pandas-version: '0.24.2'
steps:
- name: 📖 Checkout commit locally
uses: actions/checkout@v2
- name: Set setuptools_scm version
if: github.event_name == 'release'
# Need to instruct setuptools_scm to use the GitHub provided tag, despite local git changes (due to build step)
run: echo '::set-env name=SETUPTOOLS_SCM_PRETEND_VERSION::${{ github.event.release.tag_name }}'
- name: 🐍 Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: 📦 Install npm dependencies
run: |
npm ci --ignore-scripts
npm run postinstall
- 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
if: matrix.pandas-version == '1.*' && matrix.python-version == '3.8'
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
webviz docs --portable ./docs_build --skip-open
webviz schema
- name: 🚢 Build and deploy Python package
if: github.event_name == 'release' && matrix.python-version == '3.6' && matrix.pandas-version == '1.*'
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.event_name == 'release' && matrix.python-version == '3.6' && matrix.pandas-version == '1.*'
run: |
cp -R ./docs_build ../docs_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 ../docs_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