-
Notifications
You must be signed in to change notification settings - Fork 53
134 lines (122 loc) · 3.68 KB
/
main.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Test and build docs
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
jobs:
test:
name: Run Unittest
runs-on: ubuntu-20.04
strategy:
matrix:
python: ['3.6', '3.7', '3.8', '3.9', '3.10']
steps:
- name: Checkout
uses: actions/checkout@master
- name: Install Python ${{ matrix.python }}
uses: actions/setup-python@master
with:
python-version: ${{ matrix.python }}
- name: Install SciKit-GStat
run: |
pip3 install -r requirements.txt
python3 setup.py install
- name: Install PyTest requirements
run: pip3 install -r "requirements.unittest.${{ matrix.python }}.txt"
- name: Run tests
run: pytest --cov-config=.coveragerc --cov=./ --cov-report=xml
- name: Upload coverage to codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
env_vars: OS, PYTHON
docs:
name: Build and deploy documentation
runs-on: ubuntu-20.04
needs: test
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@master
- name: Install Python
uses: actions/setup-python@master
with:
python-version: '3.8'
- name: Install SciKit-GStat
run: |
pip3 install -r requirements.txt
python3 setup.py install
- name: Install Sphinx requirements
run: pip3 install -r requirements.rtd.txt
# - name: Upgrade
# run: sudo apt update && sudo apt -y upgrade
- name: Install pdflatex
run: sudo apt install texlive-latex-extra texlive-latex-recommended texlive-fonts-recommended pandoc
- name: make HTML & LaTeX docs
run: |
cd docs
make html
make latex
continue-on-error: true
- name: compile LaTeX
run: |
cd docs/_build/latex
pdflatex -interaction=nonstopmode -halt-on-error SciKitGStat.tex
cd ../..
cp _build/latex/SciKitGStat.pdf _build/html
continue-on-error: true
- name: deploy to gh pages
uses: crazy-max/ghaction-github-pages@v1
with:
target_branch: gh-pages
build_dir: docs/_build/html
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
name: Create Github release
runs-on: ubuntu-20.04
needs: test
if: startsWith(github.event.ref, 'refs/tags/v') && endsWith(github.event.ref, '.0')
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: RELEASE.md
generate_release_notes: true
publish:
name: Publish to PyPi
runs-on: ubuntu-20.04
needs: test
if: startsWith(github.event.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
ci_develop:
name: Print Github Context for Development
runs-on: ubuntu-20.04
if: true
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: |
echo "$GITHUB_CONTEXT"