-
Notifications
You must be signed in to change notification settings - Fork 73
Add post-release smoke tests to release workflow #760
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
base: main
Are you sure you want to change the base?
Changes from all commits
8ecd321
baa35da
8039762
27bbed9
71d26b3
cf5b0f8
971d52d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -423,3 +423,112 @@ jobs: | |
| echo "zipping debug symbols" | ||
| zip -r dbg-symbols.zip dbg-symbols | ||
| gh release create "$RELEASE_TAG" wheels-*/* dbg-symbols.zip --generate-notes --prerelease --target ${{github.sha}} | ||
|
|
||
| wait-for-pypi: | ||
| name: Wait for PyPI availability | ||
| runs-on: ubuntu-latest | ||
| if: ${{ github.event_name == 'workflow_dispatch' }} | ||
| needs: [release-pypi] | ||
| outputs: | ||
| version: ${{ steps.version.outputs.version }} | ||
| steps: | ||
| - name: Strip version prefix | ||
| id: version | ||
| run: | | ||
| VERSION="${{ github.event.inputs.tag }}" | ||
| VERSION="${VERSION#v}" | ||
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Wait for PyPI availability | ||
| run: | | ||
| VERSION="${{ steps.version.outputs.version }}" | ||
| for i in $(seq 1 30); do | ||
| if curl -sf "https://pypi.org/pypi/hf_xet/$VERSION/json" > /dev/null; then | ||
| echo "hf_xet==$VERSION available on PyPI" | ||
| exit 0 | ||
| fi | ||
| echo "Waiting for hf_xet==$VERSION on PyPI... (attempt $i/30)" | ||
| sleep 30 | ||
| done | ||
| echo "ERROR: hf_xet==$VERSION not found on PyPI after 15 minutes" | ||
| exit 1 | ||
|
|
||
| smoke-test: | ||
| name: Smoke test released version | ||
| runs-on: ${{ matrix.os }} | ||
| needs: [wait-for-pypi] | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest, macos-latest, windows-latest] | ||
| steps: | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6 | ||
|
|
||
| - name: Install hf CLI | ||
| run: uv tool install huggingface_hub | ||
|
|
||
| - name: Run smoke tests | ||
| env: | ||
| HF_TOKEN: ${{ secrets.HF_SMOKE_TEST_TOKEN }} | ||
| shell: bash | ||
| run: | | ||
| ./scripts/smoke_tests/run.sh --hf-xet-version "${{ needs.wait-for-pypi.outputs.version }}" --namespace xet-team | ||
|
|
||
| smoke-test-notify: | ||
| name: Notify smoke test results | ||
| runs-on: ubuntu-latest | ||
| if: ${{ always() && github.event_name == 'workflow_dispatch' }} | ||
| needs: [smoke-test] | ||
| steps: | ||
| - name: Determine failed platforms | ||
| if: ${{ needs.smoke-test.result == 'failure' }} | ||
| id: failures | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| run: | | ||
| failed=$(gh api "repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs" \ | ||
| --paginate -q '[.jobs[] | select(.name | startswith("Smoke test released version")) | select(.conclusion == "failure") | (.name | capture("\\((?<os>[^)]+)\\)")).os] | join(", ")') | ||
| echo "platforms=${failed:-unknown}" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Notify Slack on failure | ||
| if: ${{ needs.smoke-test.result == 'failure' }} | ||
| uses: slackapi/slack-github-action@b0fa283ad8fea605de13dc3f449259339835fc52 # v2.1.0 | ||
| with: | ||
| webhook: ${{ secrets.SLACK_SMOKE_TEST_WEBHOOK_URL }} | ||
| webhook-type: incoming-webhook | ||
| payload: | | ||
| { | ||
| "text": ":red_circle: hf-xet smoke tests failed for ${{ github.event.inputs.tag }}", | ||
| "blocks": [ | ||
| { | ||
| "type": "section", | ||
| "text": { | ||
| "type": "mrkdwn", | ||
| "text": ":red_circle: *hf-xet smoke tests failed*\n*Version:* `${{ github.event.inputs.tag }}`\n*Failed:* ${{ steps.failures.outputs.platforms }}\n*Run:* <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View logs>" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
|
|
||
| - name: Notify Slack on success | ||
| if: ${{ needs.smoke-test.result == 'success' }} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No Slack notification when smoke tests are skippedMedium Severity The Additional Locations (1) |
||
| uses: slackapi/slack-github-action@b0fa283ad8fea605de13dc3f449259339835fc52 # v2.1.0 | ||
| with: | ||
| webhook: ${{ secrets.SLACK_SMOKE_TEST_WEBHOOK_URL }} | ||
| webhook-type: incoming-webhook | ||
| payload: | | ||
| { | ||
| "text": ":large_green_circle: hf-xet smoke tests passed for ${{ github.event.inputs.tag }}", | ||
| "blocks": [ | ||
| { | ||
| "type": "section", | ||
| "text": { | ||
| "type": "mrkdwn", | ||
| "text": ":large_green_circle: *hf-xet smoke tests passed*\n*Version:* `${{ github.event.inputs.tag }}`\n*Platforms:* ubuntu, macos, windows\n*Run:* <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View logs>" | ||
| } | ||
| } | ||
| ] | ||
| } | ||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running "run.sh" in bash on Windows -- worth triggering a test in this PR