-
Notifications
You must be signed in to change notification settings - Fork 15
85 lines (70 loc) · 2.01 KB
/
cd-build.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: CD
on:
push:
branches:
- master
- main
jobs:
coverage:
name: Deploy Coverage Results
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Conda with Python 3.8
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: 3.8
auto-activate-base: false
- name: Install dependencies
shell: bash -l {0}
run: |
python -m pip install --upgrade pip
python -m pip install -r develop.txt
python -m pip install twine
python -m pip install .
- name: Run Tests
shell: bash -l {0}
run: |
python setup.py test
- name: Check distribution
shell: bash -l {0}
run: |
python setup.py sdist
twine check dist/*
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
flags: unittests
api:
name: Deploy API Documentation
needs: coverage
runs-on: ubuntu-latest
if: success()
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Conda with Python 3.8
uses: conda-incubator/setup-miniconda@v2
with:
python-version: "3.8"
- name: Install dependencies
shell: bash -l {0}
run: |
conda install -c conda-forge pandoc
python -m pip install --upgrade pip
python -m pip install -r docs/requirements.txt
python -m pip install .
- name: Build API documentation
shell: bash -l {0}
run: |
sphinx-apidoc -t docs/_templates -feTMo docs/source modopt
sphinx-build -E docs/source docs/_build
- name: Deploy API documentation
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build