Skip to content
This repository was archived by the owner on Aug 28, 2025. It is now read-only.

Commit 4c9a890

Browse files
authored
ci/docs: split building html | linkcheck (#281)
1 parent 9334a3e commit 4c9a890

4 files changed

Lines changed: 50 additions & 26 deletions

File tree

.github/workflows/ci_docs.yml

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,19 @@ on: # Trigger the workflow on push or pull request
1010

1111
concurrency:
1212
group: ${{ github.workflow }}-${{ github.head_ref }}
13-
cancel-in-progress: true
13+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
14+
15+
defaults:
16+
run:
17+
shell: bash
1418

1519
jobs:
16-
build-docs:
20+
make-docs:
1721
runs-on: ubuntu-latest
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
check: ["html", "linkcheck"]
1826
env:
1927
PUB_BRANCH: publication
2028
PATH_DATASETS: ${{ github.workspace }}/.datasets
@@ -35,16 +43,17 @@ jobs:
3543
key: pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('_requirements/docs.txt') }}
3644
restore-keys: pip-
3745

38-
- name: Install dependencies
46+
- name: Install Texlive & tree
3947
run: |
4048
sudo apt-get update --fix-missing
41-
sudo apt-get install -y tree
4249
# install Texlive, see https://linuxconfig.org/how-to-install-latex-on-ubuntu-20-04-focal-fossa-linux
43-
sudo apt-get install -y cmake pandoc texlive-latex-extra dvipng texlive-pictures
50+
sudo apt-get install -y cmake tree pandoc texlive-latex-extra dvipng texlive-pictures
51+
52+
- name: Install dependencies
53+
run: |
4454
pip --version
4555
pip install -q -r requirements.txt -r _requirements/docs.txt
4656
pip list
47-
shell: bash
4857
4958
- name: Process folders
5059
run: |
@@ -54,21 +63,21 @@ jobs:
5463
python .actions/assistant.py group-folders master-diff.txt
5564
printf "Changed folders:\n"
5665
cat changed-folders.txt
57-
shell: bash
5866
59-
- name: ">> output"
60-
id: changed
61-
run: python -c "lines = open('changed-folders.txt').readlines(); print(f'::set-output name=nb_dirs::{len(lines)}')"
67+
- name: Count changed notebooks
68+
run: python -c "lines = open('changed-folders.txt').readlines(); print(f'NB_DIRS={len(lines)}')" >> $GITHUB_ENV
6269

6370
- uses: oleksiyrudenko/gha-git-credentials@v2.1
6471
with:
65-
token: "${{ secrets.GITHUB_TOKEN }}"
72+
token: ${{ secrets.GITHUB_TOKEN }}
6673
global: true
6774
- name: Sync to pub
6875
run: git merge -s resolve origin/$PUB_BRANCH
6976

7077
- name: Generate notebooks
71-
if: steps.changed.outputs.nb_dirs != 0
78+
if: ${{ env.NB_DIRS != 0 }}
79+
env:
80+
DRY_RUN: 1
7281
run: |
7382
# second half with || [...] is needed for reading the last line
7483
while read -r line || [ -n "$line" ]; do
@@ -77,12 +86,9 @@ jobs:
7786
cat .actions/_ipynb-render.sh
7887
bash .actions/_ipynb-render.sh
7988
done <<< $(cat changed-folders.txt)
80-
env:
81-
DRY_RUN: 1
82-
shell: bash
8389
8490
- name: Copy notebooks
85-
if: steps.changed.outputs.nb_dirs != 0
91+
if: ${{ env.NB_DIRS != 0 }}
8692
run: |
8793
# second half with || [...] is needed for reading the last line
8894
while read -r line || [ -n "$line" ]; do
@@ -91,22 +97,26 @@ jobs:
9197
cp .notebooks/${line}.ipynb changed-notebooks/${dir}/
9298
done <<< $(cat changed-folders.txt)
9399
tree changed-notebooks
94-
shell: bash
95100
96101
- uses: actions/upload-artifact@v3
97-
if: steps.changed.outputs.nb_dirs != 0
102+
if: ${{ matrix.check == 'html' && env.NB_DIRS != 0 }}
98103
with:
99104
name: notebooks-${{ github.sha }}
100105
path: changed-notebooks/
101106

107+
- name: Link check
108+
working-directory: ./_docs
109+
if: ${{ matrix.check == 'linkcheck' }}
110+
run: make linkcheck --jobs $(nproc) --debug SPHINXOPTS="--keep-going"
111+
102112
- name: Make Documentation
103113
working-directory: ./_docs
104-
run: make html --jobs $(nproc) --debug SPHINXOPTS="-W --keep-going" linkcheck
114+
if: ${{ matrix.check == 'html' }}
115+
run: make html --jobs $(nproc) --debug SPHINXOPTS="-W --keep-going"
105116

106117
- name: Upload built docs
118+
if: ${{ matrix.check == 'html' }}
107119
uses: actions/upload-artifact@v3
108120
with:
109121
name: docs-html-${{ github.sha }}
110122
path: _docs/build/html/
111-
# Use always() to always run this step to publish test results when there are test failures
112-
if: success()

.github/workflows/ci_schema.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Check Schema
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
check:
11+
uses: Lightning-AI/utilities/.github/workflows/check-schema.yml@main
12+
with:
13+
# skip azure due to the wrong schema file by MSFT
14+
# https://github.com/Lightning-AI/lightning-flash/pull/1455#issuecomment-1244793607
15+
azure-dir: ".azure"

.github/workflows/ci_test-acts.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: CI internal
22

33
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
44
on: # Trigger the workflow on push or pull request, but only for the main branch
5-
push: {}
5+
push:
6+
branches: [main]
67
pull_request:
78
branches: [main]
89

course_UvA-DL/07-deep-energy-based-generative-models/Deep_Energy_Models.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,7 @@
172172
# The trick is that we approximate $Z_{\theta}$ by a single Monte-Carlo sample.
173173
# This gives us the exact same objective as written above.
174174
#
175-
# Visually, we can look at the objective as follows (figure credit
176-
# - [Stefano Ermon and Aditya Grover](https://deepgenerativemodels.github.io/assets/slides/cs236_lecture11.pdf)):
175+
# Visually, we can look at the objective as follows (figure credit - Stefano Ermon and Aditya Grover: lecture cs236/11):
177176
#
178177
# <center width="100%"><img src="contrastive_divergence.svg" width="700px"></center>
179178
#
@@ -206,8 +205,7 @@
206205
# Modeling the probability distribution for sampling new data is not the only application of energy-based models.
207206
# Any application which requires us to compare two elements is much simpler to learn
208207
# because we just need to go for the higher energy.
209-
# A couple of examples are shown below (figure credit
210-
# - [Stefano Ermon and Aditya Grover](https://deepgenerativemodels.github.io/assets/slides/cs236_lecture11.pdf)).
208+
# A couple of examples are shown below (figure credit - Stefano Ermon and Aditya Grover: lecture cs236/11).
211209
# A classification setup like object recognition or sequence labeling can be considered as an energy-based
212210
# task as we just need to find the $Y$ input that minimizes the output $E(X, Y)$ (hence maximizes probability).
213211
# Similarly, a popular application of energy-based models is denoising of images.

0 commit comments

Comments
 (0)