-
Notifications
You must be signed in to change notification settings - Fork 151
122 lines (122 loc) · 3.94 KB
/
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
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
name: graspologic Build
on:
push:
paths-ignore:
- '.all-contributorsrc'
- 'CONTRIBUTORS.md'
branches-ignore:
- 'dev'
- 'main'
pull_request:
paths-ignore:
- '.all-contributorsrc'
- 'CONTRIBUTORS.md'
workflow_call:
jobs:
static-code-analysis:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: 'python'
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
build-reference-documentation:
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: "Run Reference Documentation Generation"
run: |
sudo apt install pandoc
pip install -U pip setuptools wheel
pip install -r requirements.txt
pip install pipdeptree
echo "documentation" > dependencies_documentation.txt
pipdeptree >> dependencies_documentation.txt
sphinx-build -W -t build_tutorials -a docs/ docs/_build/html
- name: Archive documentation version artifact
uses: actions/upload-artifact@v2
with:
name: dependencies
path: |
dependencies_documentation.txt
- name: Archive documentation artifacts
uses: actions/upload-artifact@v2
with:
name: documentation-site
path: |
docs/_build/html
code-format-check:
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: Run Format Check
run: |
pip install -U pip setuptools wheel
pip install -r requirements.txt
black --check --diff ./graspologic ./tests
isort --check-only ./graspologic ./tests
test-coverage:
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: Run Test Coverage
run: |
pip install -U pip setuptools wheel
pip install -r requirements.txt
python -m pytest --co --cov=graspologic graspologic tests
unit-and-doc-test:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python_version: ["3.8", "3.9", "3.10", "3.11"]
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{matrix.python_version}} ${{matrix.os}}
uses: actions/setup-python@v2
with:
python-version: ${{matrix.python_version}}
- name: Install dependencies Python ${{matrix.python_version}} ${{matrix.os}}
run: |
pip install -U pip setuptools wheel
pip install -r requirements.txt
- name: Run Unit Tests and Doctests Python ${{matrix.python_version}} ${{matrix.os}}
run: |
pytest tests # note: should be pytest graspologic tests, but we're skipping doctests for now and re-enabling them in another PR
- name: Run mypy type check Python ${{matrix.python_version}} ${{matrix.os}}
run: |
mypy ./graspologic
- name: Generate dependency tree
run: |
pip install pipdeptree
export DEPS='dependencies_${{matrix.python_version}}_${{matrix.os}}.txt'
echo "${{matrix.python_version}} ${{matrix.os}}" > $DEPS
pipdeptree >> $DEPS
shell: bash
- name: Archive dependency tree
uses: actions/upload-artifact@v2
with:
name: dependencies
path: |
dependencies_${{matrix.python_version}}_${{matrix.os}}.txt