-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (56 loc) · 2 KB
/
test_and_render.yaml
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
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test_and_render:
runs-on: ubuntu-latest
container:
image: europe-west3-docker.pkg.dev/tfl-prod-ea3b/tfl-docker/tfl-training-probabilistic-model-checking:latest
options: --user root
credentials:
username: _json_key
password: ${{ secrets.GAR_JSON_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
lfs: true
persist-credentials: false
# lfs=true is not enough, see https://stackoverflow.com/questions/61463578/github-actions-actions-checkoutv2-lfs-true-flag-not-converting-pointers-to-act
# config tweak is needed b/c of annoying bugs in actions/checkout, see https://github.com/actions/checkout/issues/766
- name: Pull LFS Objects
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git lfs pull
- name: Install package
run: pip install -e .
- name: Run tests
run: pytest
- name: Build docs
# NOTE: feel free to delete the if-else and just keep the else line. It's simply a special case to make the
# automatically generated thesan_output fully representative. In normal cases, the notebooks are rendered
# locally and html is committed
run: |
if [ $(basename "$PWD") = "thesan_output" ]; then
bash build_scripts/build_docs.sh --execute
else
bash build_scripts/build_docs.sh --skip-nbconvert --skip-jupyter-book
fi
- name: Prepare Pages
if: github.ref == 'refs/heads/master'
run: mv docs/_build/html/* public/
- name: Deploy Pages
uses: JamesIves/[email protected]
if: github.ref == 'refs/heads/master'
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: public
TARGET_FOLDER: .
CLEAN: true
SINGLE_COMMIT: true