docs: Conditional Rendering #2591
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Modified Plugin | |
on: | |
pull_request: | |
branches: | |
- main | |
- 'release/**' | |
push: | |
branches: | |
- main | |
- 'release/**' | |
tags: | |
- 'plotly-express-v*' | |
- 'matplotlib-v*' | |
- 'json-v*' | |
- 'ui-v*' | |
- 'utilities-v*' | |
- 'packaging-v*' | |
jobs: | |
changes: | |
runs-on: ubuntu-22.04 | |
permissions: | |
pull-requests: read | |
outputs: | |
packages: ${{ steps.filter.outputs.changes }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Filter paths | |
uses: dorny/paths-filter@v3 | |
id: filter | |
with: | |
filters: | | |
plotly-express: | |
- plugins/plotly-express/** | |
- .github/workflows/test-*.yml | |
- sphinx_ext/* | |
matplotlib: | |
- plugins/matplotlib/** | |
- .github/workflows/test-*.yml | |
json: | |
- plugins/json/** | |
- .github/workflows/test-*.yml | |
ui: | |
- plugins/ui/** | |
- .github/workflows/test-*.yml | |
- sphinx_ext/* | |
utilities: | |
- plugins/utilities/** | |
- .github/workflows/test-*.yml | |
packaging: | |
- plugins/packaging/** | |
- .github/workflows/test-*.yml | |
# Test all python packages that have been modified individually | |
test-python: | |
needs: changes | |
if: ${{ needs.changes.outputs.packages != '[]' && needs.changes.outputs.packages != '' }} | |
strategy: | |
matrix: | |
package: ${{ fromJSON(needs.changes.outputs.packages) }} | |
uses: ./.github/workflows/test-python-package.yml | |
with: | |
package: ${{ matrix.package }} | |
# Test all JS packages at once. We run jest from the root. | |
test-js: | |
needs: changes | |
if: ${{ needs.changes.outputs.packages != '[]' && needs.changes.outputs.packages != '' }} | |
uses: ./.github/workflows/test-js-packages.yml | |
# Action that outputs success is test-python and test-js are either both successful or both skipped | |
# This action will simply throw if either of the test-js or test-python jobs fail | |
# https://github.com/orgs/community/discussions/26822#discussioncomment-5122101 | |
test-results: | |
if: ${{ always() }} | |
runs-on: ubuntu-22.04 | |
needs: [test-python, test-js] | |
steps: | |
# Only fail if one of the previous tests failed | |
- run: exit 1 | |
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} | |
filter-release: | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Filter tag | |
id: filter-tag | |
run: | | |
echo "package=$(echo ${{ github.ref }} | sed -E 's|^refs/tags/([^/]+)-v[0-9]+\.[0-9]+\.[0-9]+$|\1|')" >> $GITHUB_OUTPUT | |
outputs: | |
package: ${{ steps.filter-tag.outputs.package }} | |
release: | |
needs: filter-release | |
if: ${{ needs.filter-release.outputs.package != '' }} | |
uses: ./.github/workflows/release-python-package.yml | |
secrets: inherit | |
with: | |
package: ${{ needs.filter-release.outputs.package }} | |
# Main docs are built here, whereas release docs are built in release-python-package.yml | |
build-main-docs: | |
needs: changes | |
# Only build main docs for push on main branch and PRs to main | |
if: ${{ needs.changes.outputs.packages != '[]' && needs.changes.outputs.packages != '' && (github.ref == 'refs/heads/main' || github.base_ref == 'main') && (github.event_name == 'push' || github.event_name == 'pull_request')}} | |
strategy: | |
matrix: | |
package: ${{ fromJSON(needs.changes.outputs.packages) }} | |
uses: ./.github/workflows/build-main-docs.yml | |
secrets: inherit | |
with: | |
package: ${{ matrix.package }} | |
event_name: ${{ github.event_name }} |