[BE?] Move torchci pythons scripts to tools #134
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: Update test file ratings for TD Heuristics | |
on: | |
pull_request: | |
paths: | |
- ".github/workflows/update_test_file_ratings.yml" | |
- "torchci/scripts/td/**" | |
schedule: | |
- cron: 5 11 * * * # At 11:05 UTC every day or about 4am PT | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} | |
cancel-in-progress: true | |
jobs: | |
update-test-file-ratings: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout pytorch/test-infra | |
uses: actions/checkout@v3 | |
with: | |
path: test-infra | |
- name: Checkout pytorch/pytorch | |
uses: actions/checkout@v3 | |
with: | |
repository: pytorch/pytorch | |
path: pytorch | |
fetch-depth: 0 | |
- name: Install Dependencies | |
run: | | |
pip3 install --upgrade pip | |
pip3 install boto3==1.19.12 rockset==1.0.3 | |
cd test-infra/tools/torchci | |
pip3 install -e . | |
- name: Get merge base info | |
run: | | |
python3 test-infra/tools/torchci/torchci/td/get_merge_base_info.py | |
env: | |
ROCKSET_API_KEY: ${{ secrets.ROCKSET_API_KEY }} | |
- name: Generate file test ratings | |
run: | | |
python3 test-infra/tools/torchci/td/calculate_file_test_rating.py | |
python3 test-infra/tools/torchci/td/td_heuristic_historical_edited_files.py | |
# Do not run this one, it won't change | |
# python3 test-infra/tools/torchci/td/td_heuristic_profiling.py | |
env: | |
ROCKSET_API_KEY: ${{ secrets.ROCKSET_API_KEY }} | |
- name: Push file to test file correlations 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: "file_test_rating.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 file to test file correlations" | |
- name: Push file to test class correlations 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: "file_test_class_rating.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 file to test class correlations" | |
- name: Push historical edited files heuristic 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: "td_heuristic_historical_edited_files.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 TD heuristic: historical edited files" |