Skip to content

Commit 7eaca3f

Browse files
author
ShaharNaveh
committed
CI: skip tests when only files in doc/web changes (github)
1 parent a740748 commit 7eaca3f

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

.github/workflows/ci.yml

+18-2
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,29 @@ jobs:
9999
- name: Set up pandas
100100
uses: ./.github/actions/setup
101101

102+
# Github workflows built-in path filters
103+
# don't work on a level of individual jobs or steps.
104+
# So, we use this.
105+
- uses: dorny/paths-filter@v2
106+
id: changes
107+
with:
108+
filters: |
109+
doc:
110+
- 'doc/**'
111+
web:
112+
- 'web/**'
113+
102114
- name: Build website
103115
run: |
104116
source activate pandas-dev
105117
python web/pandas_web.py web/pandas --target-path=web/build
118+
if: steps.changes.outputs.web == 'true'
119+
106120
- name: Build documentation
107121
run: |
108122
source activate pandas-dev
109123
doc/make.py --warnings-are-errors | tee sphinx.log ; exit ${PIPESTATUS[0]}
124+
if: steps.changes.outputs.doc == 'true'
110125

111126
# This can be removed when the ipython directive fails when there are errors,
112127
# including the `tee sphinx.log` in te previous step (https://github.com/ipython/ipython/issues/11547)
@@ -123,14 +138,15 @@ jobs:
123138

124139
- name: Upload web
125140
run: rsync -az --delete --exclude='pandas-docs' --exclude='docs' --exclude='Pandas_Cheat_Sheet*' web/build/ docs@${{ secrets.server_ip }}:/usr/share/nginx/pandas
126-
if: github.event_name == 'push'
141+
if: ${{ github.event_name == 'push' && steps.changes.outputs.web == 'true' }}
127142

128143
- name: Upload dev docs
129144
run: rsync -az --delete doc/build/html/ docs@${{ secrets.server_ip }}:/usr/share/nginx/pandas/pandas-docs/dev
130-
if: github.event_name == 'push'
145+
if: ${{ github.event_name == 'push' && steps.changes.outputs.doc == 'true' }}
131146

132147
- name: Move docs into site directory
133148
run: mv doc/build/html web/build/docs
149+
134150
- name: Save website as an artifact
135151
uses: actions/upload-artifact@v2
136152
with:

0 commit comments

Comments
 (0)