Run CircleCI with the HEAD sha, not the base (#14625)

* Run CircleCI with the HEAD sha, not the base
* Different solution
This commit is contained in:
Carlos Mocholí 2022-09-12 17:25:54 +02:00 committed by lexierule
parent 3f30de1363
commit 4645587d88
3 changed files with 5 additions and 2 deletions

View File

@ -50,8 +50,8 @@ references:
run:
name: Update jsonnet
command: |
export PR_NUMBER=$(git ls-remote origin "pull/*/head" | grep -F -f <(git rev-parse HEAD) | awk -F'/' '{print $3}')
export SHA=$(git rev-parse --short HEAD)
export PR_NUMBER=$(git ls-remote origin "pull/*/head" | grep -F -f $SHA | awk -F'/' '{print $3}')
python -c "fname = 'dockers/tpu-tests/tpu_test_cases.jsonnet' ; data = open(fname).read().replace('{PYTORCH_VERSION}', '$XLA_VER')
data = data.replace('{PYTHON_VERSION}', '$PYTHON_VER').replace('{PR_NUMBER}', '$PR_NUMBER').replace('{SHA}', '$SHA') ; open(fname, 'w').write(data)"
cat dockers/tpu-tests/tpu_test_cases.jsonnet

View File

@ -23,6 +23,9 @@ jobs:
trigger-circleci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: CircleCI-Public/trigger-circleci-pipeline-action@v1.0.5
env:
CCI_TOKEN: ${{ secrets.CCI_TOKEN }}

View File

@ -28,7 +28,7 @@ local tputests = base.BaseTest {
cd lightning
echo $PWD
git ls-remote --refs origin
git fetch origin "refs/pull/{PR_NUMBER}/head:pr/{PR_NUMBER}" && git checkout "pr/{PR_NUMBER}"
git fetch origin "refs/pull/{PR_NUMBER}/head"
git checkout {SHA}
export PACKAGE_NAME=pytorch
export FREEZE_REQUIREMENTS=1