Compare commits

...
Author SHA1 Message Date
Stas Bekman 8eacf1ac19 doc fix 2020-12-09 19:07:29 -08:00
Stas Bekman dc775bc915 restore 2020-12-09 19:05:53 -08:00
Stas Bekman 321a6e4eb3 use head's username 2020-12-09 19:05:23 -08:00
Stas Bekman 59ea3e4c52 Merge remote-tracking branch 'origin/master' into stas00-patch-1 2020-12-09 19:04:07 -08:00
Stas Bekman 5e637e6c69 [wip] [ci] doc-job-skip take #4 dry-run (#8980)
* ci-doc-job-skip-take-4

* wip

* wip

* wip

* wip

* skip yaml

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* ready to test

* yet another way

* trying with HEAD

* trying with head.sha

* trying with head.sha fix

* trying with head.sha fix wip

* undo

* try to switch to sha

* current branch

* current branch

* PR number check

* joy ride

* joy ride

* joy ride

* joy ride

* joy ride

* joy ride

* joy ride

* joy ride

* joy ride

* joy ride

* joy ride

* joy ride
2020-12-09 15:36:36 -05:00
Stas Bekman f7296d6559 doc test 2020-12-08 17:09:29 -08:00
Stas Bekman 57323e9e48 [wip] [ci] doc-job-skip take #4.5 dry-run via github direct edit 2020-12-08 16:47:10 -08:00
+24 -5
View File
@@ -11,21 +11,40 @@ commands:
- run:
name: docs-only changes skip check
command: |
# pipeline.git.base_revision is not always defined, so only proceed if all external vars are defined
if test -n "<< pipeline.git.base_revision >>" && test -n "<< pipeline.git.revision >>" && test -n "$(git diff --name-only << pipeline.git.base_revision >>...<< pipeline.git.revision >>)"
if test -n "$CIRCLE_PR_NUMBER"
then
if git diff --name-only << pipeline.git.base_revision >>...<< pipeline.git.revision >> | egrep -qv '\.(md|rst)$'
echo $CIRCLE_PR_NUMBER
resp=$(curl -Ls https://api.github.com/repos/huggingface/transformers/pulls/${CIRCLE_PR_NUMBER})
user=$(jq -r .head.user.login \<<< $resp) # PR head username
head_ref=$(jq -r .head.ref \<<< $resp) # PR head branch name
echo head_ref=$head_ref, user=$user
fi
if test -n "$user" && test -n "$head_ref"
then
git clone https://github.com/$user/transformers user-clone
cd user-clone
git checkout $head_ref
fork_point_sha=$(git merge-base --fork-point master)
cd -
fi
if test -n "$fork_point_sha" && test -n "$(git diff --name-only $fork_point_sha)"
then
git --no-pager diff --name-only $fork_point_sha
if git diff --name-only $fork_point_sha | egrep -qv '\.(md|rst)$'
then
echo "Non-docs were modified in this PR, proceeding normally"
else
echo "Only docs were modified in this PR, quitting this job"
# disable skipping for now, as circleCI's base_revision is inconsistent leading to invalid ranges
# enable skipping once we get this sorted out
# circleci step halt
fi
else
echo "Can't perform skipping check w/o base_revision defined, continuing the job"
echo "Not enough data to perform a skipping check - continuing the job"
fi
# TPU REFERENCES
references:
checkout_ml_testing: &checkout_ml_testing