Skip to content

Commit f304bd5

Browse files
carmoccakrshrimali
authored andcommitted
Run CircleCI with the HEAD sha, not the base (#14625)
* Run CircleCI with the HEAD sha, not the base * Different solution
1 parent f6106fa commit f304bd5

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ references:
5050
run:
5151
name: Update jsonnet
5252
command: |
53-
export PR_NUMBER=$(git ls-remote origin "pull/*/head" | grep -F -f <(git rev-parse HEAD) | awk -F'/' '{print $3}')
5453
export SHA=$(git rev-parse --short HEAD)
54+
export PR_NUMBER=$(git ls-remote origin "pull/*/head" | grep -F -f $SHA | awk -F'/' '{print $3}')
5555
python -c "fname = 'dockers/tpu-tests/tpu_test_cases.jsonnet' ; data = open(fname).read().replace('{PYTORCH_VERSION}', '$XLA_VER')
5656
data = data.replace('{PYTHON_VERSION}', '$PYTHON_VER').replace('{PR_NUMBER}', '$PR_NUMBER').replace('{SHA}', '$SHA') ; open(fname, 'w').write(data)"
5757
cat dockers/tpu-tests/tpu_test_cases.jsonnet

.github/workflows/ci-circleci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jobs:
2323
trigger-circleci:
2424
runs-on: ubuntu-latest
2525
steps:
26+
- uses: actions/checkout@v3
27+
with:
28+
ref: ${{ github.event.pull_request.head.sha }}
2629
- uses: CircleCI-Public/[email protected]
2730
env:
2831
CCI_TOKEN: ${{ secrets.CCI_TOKEN }}

dockers/tpu-tests/tpu_test_cases.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ local tputests = base.BaseTest {
2828
cd lightning
2929
echo $PWD
3030
git ls-remote --refs origin
31-
git fetch origin "refs/pull/{PR_NUMBER}/head:pr/{PR_NUMBER}" && git checkout "pr/{PR_NUMBER}"
31+
git fetch origin "refs/pull/{PR_NUMBER}/head"
3232
git checkout {SHA}
3333
export PACKAGE_NAME=pytorch
3434
export FREEZE_REQUIREMENTS=1

0 commit comments

Comments
 (0)