Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add datasets and diffusers to prerelease tests #2834

Merged
merged 1 commit into from
Feb 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 28 additions & 11 deletions .github/workflows/python-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,46 +8,63 @@ on:
jobs:
test_on_transformers:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
target-repo: ["transformers", "datasets", "diffusers"]

steps:
- name: Extract version from tag
id: get-version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Checkout transformers
- name: Checkout target repo
uses: actions/checkout@v4
with:
repository: huggingface/transformers
path: transformers
repository: huggingface/${{ matrix.target-repo }}
path: ${{ matrix.target-repo }}
token: ${{ secrets.HUGGINGFACE_HUB_AUTOMATIC_RC_TESTING }}

- name: Configure Git
run: |
cd transformers
cd ${{ matrix.target-repo }}
git config user.name "Hugging Face Bot (RC Testing)"
git config user.email "[email protected]"

- name: Create test branch and update dependencies
id: create-pr
run: |
cd transformers
cd ${{ matrix.target-repo }}
VERSION=${{ steps.get-version.outputs.VERSION }}
BRANCH_NAME="ci-test-huggingface-hub-${VERSION}"

# Create and checkout new branch
git checkout -b $BRANCH_NAME

# Update dependencies using sed
sed -i -E 's/"huggingface-hub>=0.*"/"huggingface-hub=='${VERSION}'"/' setup.py
sed -i -E 's/"huggingface-hub>=0.*"/"huggingface-hub=='${VERSION}'"/' src/transformers/dependency_versions_table.py
sed -i -E 's/"huggingface-hub>=0.*"/"huggingface-hub==${VERSION}"/' setup.py
git add setup.py

# Only if the target repo is transformers
if [ "${{ matrix.target-repo }}" = "transformers" ]; then
sed -i -E 's/"huggingface-hub>=0.*"/"huggingface-hub==${VERSION}"/' src/transformers/dependency_versions_table.py
git add src/transformers/dependency_versions_table.py
fi

# Only if the target repo is diffusers
if [ "${{ matrix.target-repo }}" = "diffusers" ]; then
sed -i -E 's/"huggingface-hub":.*/"huggingface-hub": "huggingface-hub==${VERSION}",/' src/diffusers/dependency_versions_table.py
git add src/diffusers/dependency_versions_table.py
fi

# Commit and push changes
git --no-pager diff
git add setup.py src/transformers/dependency_versions_table.py
git --no-pager diff --staged
git commit -m "Test hfh ${VERSION}"
git push --set-upstream origin $BRANCH_NAME

- name: Print URLs for manual check
run: |
VERSION=${{ steps.get-version.outputs.VERSION }}
echo "https://github.com/huggingface/transformers/actions"
echo "https://github.com/huggingface/transformers/compare/main...ci-test-huggingface-hub-${VERSION}"
echo "https://github.com/huggingface/${{ matrix.target-repo }}/actions"
echo "https://github.com/huggingface/${{ matrix.target-repo }}/compare/main...ci-test-huggingface-hub-${VERSION}"
Loading