Introduce an error that should fail unit tests #4
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] | |
paths: | |
- 'plugins/plotly-express/**' | |
- 'plugins/plotly/**' | |
- 'plugins/matplotlib/**' | |
- 'plugins/json/**' | |
- 'plugins/ui/**' | |
push: | |
branches: [main] | |
tags: | |
- 'plotly-express-v*' | |
- 'plotly-v*' | |
- 'matplotlib-v*' | |
- 'json-v*' | |
- 'ui-v*' | |
jobs: | |
changes: | |
runs-on: ubuntu-22.04 | |
permissions: | |
pull-requests: read | |
outputs: | |
packages: ${{ steps.filter.outputs.changes }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Filter paths | |
uses: dorny/paths-filter@v2 | |
id: filter | |
with: | |
filters: | | |
plotly-express: plugins/plotly-express/** | |
plotly: plugins/plotly/** | |
matplotlib: plugins/matplotlib/** | |
json: plugins/json/** | |
ui: plugins/ui/** | |
# 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 | |
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 | |
with: | |
package: ${{ needs.filter-release.outputs.package }} |