-
Notifications
You must be signed in to change notification settings - Fork 3
143 lines (136 loc) · 3.58 KB
/
pipeline.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
135
136
137
138
139
140
141
142
143
name: Pipeline
on: [push, pull_request, workflow_dispatch]
jobs:
lint_black:
name: Lint (black)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install Black
run: |
pip install black
- name: Run Black
run: |
black --check --diff momba tests
lint_flake8:
name: Lint (flake8)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install Flake8
run: |
pip install flake8 flake8-bugbear pep8-naming
- name: Run Flake8
run: |
flake8 momba tests
build:
name: Build
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 Poetry and Maturin
run: |
pip install poetry maturin
- name: Build Momba
run: |
mkdir artifacts
poetry build
mv dist/* artifacts
- name: Export development requirements
run: |
poetry export --without-hashes --extras all --dev -f requirements.txt --output artifacts/dev-requirements.txt
- name: Build Engine
run: |
cd engine
maturin build --manylinux=off --out ../artifacts -i $(which python)
- uses: actions/upload-artifact@v2
with:
name: artifacts
path: artifacts
test:
name: Tests
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: artifacts
path: artifacts
- name: Install packages
run: |
pip install -r artifacts/dev-requirements.txt
pip install --ignore-installed artifacts/*.whl
- name: Run tests
run: |
pytest tests
type_check:
name: Type Check
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: artifacts
path: artifacts
- name: Install packages
run: |
pip install -r artifacts/dev-requirements.txt
pip install --ignore-installed artifacts/*.whl
- name: Run MypPy
run: |
mypy momba
documentation:
name: Documentation
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: artifacts
path: artifacts
- name: Install packages
run: |
pip install -r artifacts/dev-requirements.txt
pip install --ignore-installed artifacts/*.whl
- name: Build documentation
run: |
sphinx-build -b dirhtml docs build/docs
- name: Create CNAME file
run: |
echo "momba.dev" > build/docs/CNAME
- name: Deploy documentation
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/docs