mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-13 17:48:22 +06:00
Avoid CI runs under users' own CircleCI personal account (#20981)
* Avoid null CI * Avoid null CI * rename * more clear error message * Update .circleci/config.yml Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com> * clean up Co-authored-by: ydshieh <ydshieh@users.noreply.github.com> Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
This commit is contained in:
parent
7b0727a401
commit
8f09dd89f6
@ -9,6 +9,19 @@ parameters:
|
|||||||
default: false
|
default: false
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
# Ensure running with CircleCI/huggingface
|
||||||
|
check_circleci_user:
|
||||||
|
docker:
|
||||||
|
- image: cimg/python:3.7.12
|
||||||
|
parallelism: 1
|
||||||
|
steps:
|
||||||
|
- run: echo $CIRCLE_PROJECT_USERNAME
|
||||||
|
- run: |
|
||||||
|
if [ "$CIRCLE_PROJECT_USERNAME" = "huggingface" ]; then
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo "The CI is running under $CIRCLE_PROJECT_USERNAME personal account. Please follow https://support.circleci.com/hc/en-us/articles/360008097173-Troubleshooting-why-pull-requests-are-not-triggering-jobs-on-my-organization- to fix it."; exit -1
|
||||||
|
fi
|
||||||
# Fetch the tests to run
|
# Fetch the tests to run
|
||||||
fetch_tests:
|
fetch_tests:
|
||||||
working_directory: ~/transformers
|
working_directory: ~/transformers
|
||||||
@ -171,6 +184,7 @@ workflows:
|
|||||||
when:
|
when:
|
||||||
not: <<pipeline.parameters.nightly>>
|
not: <<pipeline.parameters.nightly>>
|
||||||
jobs:
|
jobs:
|
||||||
|
- check_circleci_user
|
||||||
- check_code_quality
|
- check_code_quality
|
||||||
- check_repository_consistency
|
- check_repository_consistency
|
||||||
- fetch_tests
|
- fetch_tests
|
||||||
@ -178,6 +192,7 @@ workflows:
|
|||||||
nightly:
|
nightly:
|
||||||
when: <<pipeline.parameters.nightly>>
|
when: <<pipeline.parameters.nightly>>
|
||||||
jobs:
|
jobs:
|
||||||
|
- check_circleci_user
|
||||||
- check_code_quality
|
- check_code_quality
|
||||||
- check_repository_consistency
|
- check_repository_consistency
|
||||||
- fetch_all_tests
|
- fetch_all_tests
|
Loading…
Reference in New Issue
Block a user