-
Notifications
You must be signed in to change notification settings - Fork 127
85 lines (69 loc) · 1.99 KB
/
testing.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
name: testing
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-testing.txt
- name: Lint with pycodestyle
run: pycodestyle python_module
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 --count --show-source --statistics python_module
# exit-zero treats all errors as warnings.
flake8 --count --exit-zero --max-complexity=20 --statistics python_module
test_and_deploy:
services:
local_mongodb:
image: mongo:4.0
ports:
- 27017:27017
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
mamba-version: "*"
activate-environment: workshop
environment-file: binder/environment.yml
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-docs.txt
- name: Install workshop package
run: pip install -e .
- name: Install workshop data
run: python ./binder/populate_nobel_database.py
- name: Run Notebooks
env:
PMG_MAPI_KEY: ${{ secrets.MAPI_KEY }}
MP_API_KEY: ${{ secrets.MP_API_KEY }}
PR: ${{ github.event.pull_request.number }}
run: python .github/run_notebooks.py
- name: Build
run: mkdocs build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/master'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site