-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (40 loc) · 1.15 KB
/
ci.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
name: ci
on: [push]
jobs:
ci:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached virtual environment
id: cached-venv
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-venv.output.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Run tests
run: |
source .venv/bin/activate
python3 -m pytest tests
- name: Build documentation
run: |
source .venv/bin/activate
cd docs
make html
touch _build/html/.nojekyll
- name: Deploy documentation
uses: JamesIves/github-pages-deploy-action@v4.2.3
with:
branch: gh-pages
folder: "docs/_build/html"