Update disabled tests #110301
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: Update disabled tests | |
on: | |
schedule: | |
# Every 15 minutes | |
- cron: "*/15 * * * *" | |
# Have the ability to trigger this job manually through the API | |
workflow_dispatch: | |
pull_request: | |
paths: | |
- .github/workflows/update_disabled_tests.yml | |
- .github/scripts/update_disabled_issues.py | |
permissions: | |
contents: write | |
jobs: | |
update-disabled-tests: | |
runs-on: ubuntu-latest | |
environment: trigger-nightly | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Generate new disabled tests and jobs jsons | |
env: | |
# The token is used to confirm issue creator's write permission before | |
# allowing them to disable jobs. Note that the token needs to have access | |
# to the target repo, i.e. pytorch/pytorch instead of test-infra. Using | |
# PyTorch bot token is the most obvious choice. | |
GH_PYTORCHBOT_TOKEN: ${{ secrets.GH_PYTORCHBOT_TOKEN }} | |
run: | | |
python3 .github/scripts/update_disabled_issues.py | |
- name: Print the list of disabled tests | |
run: | | |
cat disabled-tests-condensed.json | |
- name: Print the list of disabled and unstable jobs | |
run: | | |
echo "Disabled jobs:" | |
cat disabled-jobs.json | |
echo | |
echo "Unstable jobs:" | |
cat unstable-jobs.json | |
- name: Push disable tests to test-infra repository | |
if: github.event_name != 'pull_request' | |
uses: dmnemec/copy_file_to_another_repo_action@eebb594efdf52bc12e1b461988d7254322dac131 | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
source_file: "disabled-tests-condensed.json" | |
destination_repo: "pytorch/test-infra" | |
destination_folder: "stats" | |
destination_branch: generated-stats | |
user_email: "[email protected]" | |
user_name: "Pytorch Test Infra" | |
commit_message: "Updating condensed disabled tests stats" | |
- name: Push disable jobs to test-infra repository | |
if: github.event_name != 'pull_request' | |
uses: dmnemec/copy_file_to_another_repo_action@eebb594efdf52bc12e1b461988d7254322dac131 | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
source_file: "disabled-jobs.json" | |
destination_repo: "pytorch/test-infra" | |
destination_folder: "stats" | |
destination_branch: generated-stats | |
user_email: "[email protected]" | |
user_name: "Pytorch Test Infra" | |
commit_message: "Updating disabled jobs" | |
- name: Push unstable jobs to test-infra repository | |
if: github.event_name != 'pull_request' | |
uses: dmnemec/copy_file_to_another_repo_action@eebb594efdf52bc12e1b461988d7254322dac131 | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
source_file: "unstable-jobs.json" | |
destination_repo: "pytorch/test-infra" | |
destination_folder: "stats" | |
destination_branch: generated-stats | |
user_email: "[email protected]" | |
user_name: "Pytorch Test Infra" | |
commit_message: "Updating unstable jobs" | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: disabled-artifacts | |
if-no-files-found: error | |
path: | | |
disabled-tests-condensed.json | |
disabled-jobs.json | |
unstable-jobs.json | |
# NB: Use our self-hosted runner to upload the files to S3, the runners already | |
# have access to the bucket | |
upload-disabled-tests-s3: | |
runs-on: linux.large | |
needs: update-disabled-tests | |
steps: | |
- name: Download disabled artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: disabled-artifacts | |
- name: Upload files to s3 | |
if: github.event_name != 'pull_request' | |
run: | | |
python3 -mpip install awscli==1.27.69 | |
aws s3 cp disabled-tests-condensed.json s3://ossci-metrics/disabled-tests-condensed.json | |
aws s3 cp disabled-jobs.json s3://ossci-metrics/disabled-jobs.json | |
aws s3 cp unstable-jobs.json s3://ossci-metrics/unstable-jobs.json |