Skip tests if prerelease branch #252
Workflow file for this run
This file contains hidden or 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 package | |
| on: | |
| push: | |
| branches-ignore: | |
| - main | |
| jobs: | |
| changes: | |
| name: Repository changes | |
| runs-on: ubuntu-latest | |
| outputs: | |
| python: ${{ steps.filter.outputs.python }} | |
| js: ${{ steps.filter.outputs.js }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get the last release | |
| id: last_release | |
| uses: cardinalby/git-get-release-action@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| with: | |
| latest: true | |
| prerelease: false | |
| draft: false | |
| - name: Find changes since the last release | |
| uses: dorny/paths-filter@v2 | |
| id: filter | |
| with: | |
| base: ${{ steps.last_release.outputs.tag_name }} | |
| filters: | | |
| python: | |
| - 'python/**' | |
| js: | |
| - 'js/**' | |
| python-tests: | |
| needs: [ changes ] | |
| name: Tests Python package | |
| # If the PR does not have the label 'python-rc', the code is already tested in the prerelease workflow | |
| if: needs.changes.outputs.python == 'true' && !contains( github.event.pull_request.labels.*.name, 'python-rc') | |
| uses: ./.github/workflows/python_tests.yml | |
| secrets: inherit | |
| js-tests: | |
| needs: [ changes ] | |
| name: Tests JS package | |
| # If the PR does not have the label 'js-rc', the code is already tested in the prerelease workflow | |
| if: needs.changes.outputs.js == 'true' && !contains( github.event.pull_request.labels.*.name, 'js-rc') | |
| uses: ./.github/workflows/js_tests.yml | |
| secrets: inherit |