Only run flaky tests if flaky-tests label is applied to PR (#7048)

* Add label

* trigger ci
This commit is contained in:
Freddy Boulton 2024-01-18 21:03:32 +05:30 committed by GitHub
parent 3f139c7c99
commit 8e5ab31d75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View File

@ -55,6 +55,7 @@ jobs:
python-version: ["3.8"]
exclude:
- os: ${{ github.event_name == 'pull_request' && contains( github.event.pull_request.labels.*.name, 'windows-tests') && 'dummy' || 'windows-latest' }}
- test-type: ${{ github.event_name == 'pull_request' && contains( github.event.pull_request.labels.*.name, 'flaky-tests') && 'dummy' || 'flaky' }}
runs-on: ${{ matrix.os }}
continue-on-error: true
steps:
@ -149,6 +150,7 @@ jobs:
python-version: ["3.8"]
exclude:
- os: ${{ github.event_name == 'pull_request' && contains( github.event.pull_request.labels.*.name, 'windows-tests') && 'dummy' || 'windows-latest' }}
- test-type: ${{ github.event_name == 'pull_request' && contains( github.event.pull_request.labels.*.name, 'flaky-tests') && 'dummy' || 'flaky' }}
runs-on: ${{ matrix.os }}
continue-on-error: true
steps:

View File

@ -47,6 +47,12 @@ jobs:
env:
PR_NUMBER: ${{ steps.changesets.outputs.pullRequestNumber }}
GITHUB_TOKEN: ${{ secrets.GRADIO_PAT }}
- name: add label to run flaky tests
if: ${{ steps.changesets.outputs.pullRequestNumber != '' && steps.changesets.outputs.pullRequestNumber != 'undefined' }}
run: gh pr edit "$PR_NUMBER" --add-label "flaky-tests"
env:
PR_NUMBER: ${{ steps.changesets.outputs.pullRequestNumber }}
GITHUB_TOKEN: ${{ secrets.GRADIO_PAT }}
- name: add label to run backend tests on Windows
if: ${{ steps.changesets.outputs.pullRequestNumber != '' && steps.changesets.outputs.pullRequestNumber != 'undefined' }}
run: gh pr edit "$PR_NUMBER" --add-label "windows-tests"