test ci label #1309
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Doctests | |
on: | |
push: | |
branches: | |
- fix_doctest_after_merge | |
repository_dispatch: | |
schedule: | |
- cron: "17 2 * * *" | |
env: | |
NUM_SLICES: 3 | |
jobs: | |
setup: | |
name: Setup | |
runs-on: [single-gpu, nvidia-gpu, t4, ci-test] | |
container: | |
image: huggingface/transformers-all-latest-gpu | |
options: --gpus 0 --shm-size "16gb" --ipc host -v /mnt/cache/.cache/huggingface:/mnt/cache/ | |
outputs: | |
job_splits: ${{ steps.set-matrix.outputs.job_splits }} | |
split_keys: ${{ steps.set-matrix.outputs.split_keys }} | |
steps: | |
- name: check system | |
working-directory: /transformers | |
run: | | |
ls -la /mnt/cache | |
df -h --total | |
free -g | |
- name: Update clone | |
working-directory: /transformers | |
run: | | |
git fetch && git checkout ${{ github.sha }} | |
- name: Reinstall transformers in edit mode (remove the one installed during docker image build) | |
working-directory: /transformers | |
run: python3 -m pip uninstall -y transformers && python3 -m pip install -e . | |
- name: Show installed libraries and their versions | |
working-directory: /transformers | |
run: pip freeze | |
- name: Check values for matrix | |
working-directory: /transformers | |
run: | | |
python3 utils/split_doctest_jobs.py | |
python3 utils/split_doctest_jobs.py --only_return_keys --num_splits ${{ env.NUM_SLICES }} | |
- id: set-matrix | |
working-directory: /transformers | |
name: Set values for matrix | |
run: | | |
echo "job_splits=$(python3 utils/split_doctest_jobs.py)" >> $GITHUB_OUTPUT | |
echo "split_keys=$(python3 utils/split_doctest_jobs.py --only_return_keys --num_splits ${{ env.NUM_SLICES }})" >> $GITHUB_OUTPUT | |
call_doctest_job: | |
name: "Call doctest jobs" | |
needs: setup | |
strategy: | |
fail-fast: false | |
matrix: | |
split_keys: ${{ fromJson(needs.setup.outputs.split_keys) }} | |
uses: ./.github/workflows/doctest_job.yml | |
with: | |
job_splits: ${{ needs.setup.outputs.job_splits }} | |
split_keys: ${{ toJson(matrix.split_keys) }} | |
secrets: inherit | |
send_results: | |
name: Send results to webhook | |
runs-on: ubuntu-22.04 | |
if: always() | |
needs: [call_doctest_job] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
- name: Send message to Slack | |
env: | |
CI_SLACK_BOT_TOKEN: ${{ secrets.CI_SLACK_BOT_TOKEN }} | |
ACCESS_REPO_INFO_TOKEN: ${{ secrets.ACCESS_REPO_INFO_TOKEN }} | |
# Use `CI_SLACK_CHANNEL_DUMMY_TESTS` when doing experimentation | |
SLACK_REPORT_CHANNEL: ${{ secrets.CI_SLACK_CHANNEL_ID_DAILY_DOCS }} | |
run: | | |
pip install slack_sdk | |
python utils/notification_service_doc_tests.py | |
- name: "Upload results" | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: doc_test_results | |
path: doc_test_results |