-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (63 loc) · 2.07 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
name: Build and Test, and Deploy MkDocs (for develop only)
on:
push:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install Python dependencies
run: |
pip install --upgrade pip
pip install -r requirements.txt
- name: mypy
run: |
python -m mypy --explicit-package-bases --exclude=visualization.py src tests
- name: Test with `pytest`
if: success() || failure()
run: |
python -B -m pytest -sv tests
- name: Ruff check
run: |
ruff check --select=E,W,F,PL --ignore=E501,E701,E731,E402,PLR0911,PLR0912,PLR0913,PLR0915,PLR2004,PLW0603,PLW2901,PLR1714,PLR5501 --exclude=__init__.py --output-format=github .
deploy:
runs-on: ubuntu-latest
needs: build # This ensures that the deployment job runs after the build job
if: github.ref == 'refs/heads/develop' # Only deployed for the develop branch
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
mkdocs-bibtex-
- name: Install Python dependencies
run: |
pip install --upgrade pip
pip install -r requirements.txt
- name: Build MKDocs Documentation
run: mkdocs build --verbose
- name: Deploy MKDocs to GitHub Pages
run: |
if [ -n "$GITHUB_TOKEN" ]; then
mkdocs gh-deploy --force
else
echo "Set the GH_PAGES_TOKEN secret in your repository for deploying to GitHub Pages."
exit 1
fi
env:
GITHUB_TOKEN: ${{ secrets.GH_PAGES_TOKEN }}