-
Notifications
You must be signed in to change notification settings - Fork 55
54 lines (52 loc) · 1.42 KB
/
tests.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
name: tests
on:
# Trigger the workflow on push or pull request on main branch
push:
branches:
- main
pull_request:
branches:
- main
schedule:
# Run cron job every month, https://crontab.guru/every-month
- cron: '0 0 1 * *'
workflow_dispatch:
jobs:
# This job tests that the CC works
test-cc-and-jb-build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest] # currently not testing on windows
python-version: [3.9]
steps:
- uses: actions/checkout@v2
# Setup
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -r requirements.txt
# Use the default CC
- name: Check black style
run: |
black ./ --check
# Run tests
- name: Pytest tests
run: |
pytest
# Build the example book
- name: Build default book
run: |
cookiecutter . --no-input --overwrite-if-exists
pip install -r my_book/requirements.txt
jupyter-book build my_book/my_book/
# Push example book to gh-pages-test
- name: GitHub Pages action
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: my_book/my_book/_build/html
publish_branch: gh-pages-test