-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (64 loc) · 2.02 KB
/
Copy pathtutorials.yml
File metadata and controls
73 lines (64 loc) · 2.02 KB
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
name: Tutorials
on:
workflow_dispatch:
push:
branches:
- main
tags:
- "*"
pull_request:
branches:
- main
# "labeled" is required: without it, adding the `tutorials` label to an
# already-open PR would never trigger a run. Listing types overrides the
# default set, so the other three have to be spelled out too.
types:
- opened
- synchronize
- reopened
- labeled
release:
types:
- published
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Executing the notebooks is the most expensive job in the repo, so on a PR it
# is opt-in via the "tutorials" label. Pushes to main and published releases
# always run it.
notebooks:
name: "Build the notebooks for the docs"
runs-on: ubuntu-latest
if: >-
github.event_name != 'pull_request' ||
contains(github.event.pull_request.labels.*.name, 'tutorials')
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python
run: uv python install
- name: Install dependencies
run: uv sync --no-default-groups --group docs
- name: Execute the notebooks
# TODO: docs/tutorials/astrometry/*.ipynb
run: |
for nb in docs/tutorials/rv/*.ipynb; do
echo "Executing $nb"
uv run --no-sync jupyter nbconvert --to notebook --execute --inplace "$nb"
done
- uses: actions/upload-artifact@v7
with:
name: notebooks-for-${{ github.sha }}
path: docs/tutorials
- name: Trigger RTDs build
if: ${{ github.event_name != 'pull_request' }}
uses: dfm/rtds-action@v1.1.0
with:
webhook_url: ${{ secrets.RTDS_WEBHOOK_URL }}
webhook_token: ${{ secrets.RTDS_WEBHOOK_TOKEN }}
commit_ref: ${{ github.ref }}