Skip to content

Commit 40ac0e2

Browse files
authored
viable strict: dedup two scripts, remove checkout of test-infra (#5750)
I discovered that you don't actually have to check out the test-infra repository because it's already there? Docs: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables Only available for composite actions unfortunately Testing: https://github.com/pytorch/pytorch/actions/runs/11225822033?pr=137454 (actual pushing is commented out) There are also two fetch_latest_green_commit.py scripts in test-infra so I merged them and chose the location in tools/scripts. The logic between the two is pretty much the same. gitutils was copied from .github/scripts (but we don't need much of it) There's also a reusable workflow update-viablestrict and a composite action update-viablestrict. The composite action is usually used, but there are some differences between the two, and vision uses the reusable workflow so I can't get rid of it just yet. (idk how much they care tho, I don't vision has succeeded updating viable/strict in a while). I also can't just make the reusable action call the composite action since the workflow uses an ssh key to check out but the action uses a token --- If pytorch/vision#8676 gets merged, I'll remove the reusable workflow
1 parent 3a3aa50 commit 40ac0e2

File tree

8 files changed

+488
-811
lines changed

8 files changed

+488
-811
lines changed

.github/actions/update-viablestrict/action.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,6 @@ runs:
5555
with:
5656
python-version: '3.11'
5757

58-
- name: Checkout test-infra for the fetch_latest_green_commit scripts
59-
uses: actions/checkout@v3
60-
with:
61-
repository: ${{ inputs.test-infra-repository }}
62-
ref: ${{ inputs.test-infra-ref }}
63-
path: test-infra
64-
6558
- uses: actions/checkout@v3
6659
with:
6760
repository: ${{ inputs.repository }}
@@ -85,8 +78,14 @@ runs:
8578
run: |
8679
set -ex
8780
88-
output=$(python ${GITHUB_WORKSPACE}/test-infra/.github/scripts/fetch_latest_green_commit.py --requires "${{ inputs.requires }}")
81+
TEST_INFRA_PATH="${GITHUB_ACTION_PATH}/../../.."
82+
83+
output=$(python ${TEST_INFRA_PATH}/tools/scripts/fetch_latest_green_commit.py \
84+
--required-checks "${{ inputs.requires }}" \
85+
--viable-strict-branch "viable/strict" \
86+
--main-branch "master")
8987
echo "latest_viable_sha=$output" >> "${GITHUB_OUTPUT}"
88+
echo $output
9089
9190
- name: Push SHA to viable/strict branch
9291
if: steps.get-latest-commit.outputs.latest_viable_sha != 'None'

.github/scripts/fetch_latest_green_commit.py

Lines changed: 0 additions & 156 deletions
This file was deleted.

0 commit comments

Comments
 (0)