Skip to content

Commit fabc538

Browse files
committed
Adding ignore paths to stop tests triggering when documentation changed
Signed-off-by: Eric Kerfoot <[email protected]>
1 parent f990178 commit fabc538

File tree

2 files changed

+63
-34
lines changed

2 files changed

+63
-34
lines changed

.github/workflows/build_docs.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: build_docs
2+
3+
on:
4+
# build docs test for pull requests and the releasing branches
5+
push:
6+
branches:
7+
- dev
8+
- main
9+
- releasing/*
10+
pull_request:
11+
head_ref-ignore:
12+
- dev
13+
14+
concurrency:
15+
# automatically cancel the previously triggered workflows when there's a newer version
16+
group: cicd-tests-${{ github.event.pull_request.number || github.ref }}
17+
cancel-in-progress: true
18+
19+
# This test is for building documentation on any relevant push or PR. This ensures that any changes to docs or source
20+
# files is tested for correct doc building, whereas functional tests can be deferred if only docs were modified.
21+
22+
jobs:
23+
build-docs:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v5
27+
- name: Set up Python 3.10
28+
uses: actions/setup-python@v6
29+
with:
30+
python-version: '3.10'
31+
- name: cache weekly timestamp
32+
id: pip-cache
33+
run: |
34+
echo "datew=$(date '+%Y-%V')" >> $GITHUB_OUTPUT
35+
- name: cache for pip
36+
uses: actions/cache@v4
37+
id: cache
38+
with:
39+
path: |
40+
~/.cache/pip
41+
~/.cache/torch
42+
key: ${{ runner.os }}-pip-${{ steps.pip-cache.outputs.datew }}
43+
- name: Install dependencies
44+
run: |
45+
python -m pip install --upgrade pip wheel
46+
python -m pip install -r docs/requirements.txt
47+
- name: Make html
48+
run: |
49+
cd docs/
50+
make clean
51+
make html 2>&1 | tee tmp_log
52+
if [[ $(grep -c "ERROR:" tmp_log) != 0 ]]; then echo "Found errors:"; grep "ERROR:" tmp_log; exit 1; fi
53+
sed '/WARNING.*pip/d' tmp_log > tmp_log1; mv tmp_log1 tmp_log # monai#7133
54+
if [[ $(grep -c "WARNING:" tmp_log) != 0 ]]; then echo "Found warnings:"; grep "WARNING:" tmp_log; exit 1; fi
55+
shell: bash

.github/workflows/cicd_tests.yml

Lines changed: 8 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,17 @@ on:
77
- dev
88
- main
99
- releasing/*
10+
paths-ignore: # skip if only docs are modified
11+
- '**.md'
12+
- '**.rst'
13+
- 'docs/**'
1014
pull_request:
1115
head_ref-ignore:
1216
- dev
17+
paths-ignore: # skip if only docs are modified
18+
- '**.md'
19+
- '**.rst'
20+
- 'docs/**'
1321

1422
concurrency:
1523
# automatically cancel the previously triggered workflows when there's a newer version
@@ -290,37 +298,3 @@ jobs:
290298
python -m unittest -v
291299
env:
292300
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION: python # https://github.com/Project-MONAI/MONAI/issues/4354
293-
294-
build-docs: # Test building documentation
295-
runs-on: ubuntu-latest
296-
steps:
297-
- uses: actions/checkout@v5
298-
- name: Set up Python 3.10
299-
uses: actions/setup-python@v6
300-
with:
301-
python-version: '3.10'
302-
- name: cache weekly timestamp
303-
id: pip-cache
304-
run: |
305-
echo "datew=$(date '+%Y-%V')" >> $GITHUB_OUTPUT
306-
- name: cache for pip
307-
uses: actions/cache@v4
308-
id: cache
309-
with:
310-
path: |
311-
~/.cache/pip
312-
~/.cache/torch
313-
key: ${{ runner.os }}-pip-${{ steps.pip-cache.outputs.datew }}
314-
- name: Install dependencies
315-
run: |
316-
python -m pip install --upgrade pip wheel
317-
python -m pip install -r docs/requirements.txt
318-
- name: Make html
319-
run: |
320-
cd docs/
321-
make clean
322-
make html 2>&1 | tee tmp_log
323-
if [[ $(grep -c "ERROR:" tmp_log) != 0 ]]; then echo "Found errors:"; grep "ERROR:" tmp_log; exit 1; fi
324-
sed '/WARNING.*pip/d' tmp_log > tmp_log1; mv tmp_log1 tmp_log # monai#7133
325-
if [[ $(grep -c "WARNING:" tmp_log) != 0 ]]; then echo "Found warnings:"; grep "WARNING:" tmp_log; exit 1; fi
326-
shell: bash

0 commit comments

Comments
 (0)