-
Notifications
You must be signed in to change notification settings - Fork 65
ci: Enable GH Actions testing for forked PRs #462
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e326815
Add smoke test to check that all modules are importable without optio…
vishal-bala 3b537c8
Update to latest versions of actions
vishal-bala 025afb8
Test on latest versions of `redis/redis-stack-server` and `redis` images
vishal-bala 8a8e650
RAAE-1337: Skip steps requiring secrets for forked code
vishal-bala 2b4b9e3
RAAE-1337: Introduce a manual workflow for running service tests on f…
vishal-bala 323b677
Slightly cleaner name for matrix tests [skip ci]
vishal-bala File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| name: 'Run Service Tests' | ||
| description: 'Run the full RedisVL service test suite with all API integrations' | ||
|
|
||
| inputs: | ||
| python-version: | ||
| description: 'Python version to use' | ||
| required: true | ||
| uv-version: | ||
| description: 'uv version to use' | ||
| required: true | ||
|
|
||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - name: Cache HuggingFace Models | ||
| uses: actions/cache@v5 | ||
| with: | ||
| path: hf_cache | ||
| key: ${{ runner.os }}-hf-cache | ||
|
|
||
| - name: Set HuggingFace token | ||
| shell: bash | ||
| run: | | ||
| mkdir -p ~/.huggingface | ||
| echo '{"token":"$HF_TOKEN"}' > ~/.huggingface/token | ||
|
|
||
| - name: Install Python | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: ${{ inputs.python-version }} | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v6 | ||
| with: | ||
| version: ${{ inputs.uv-version }} | ||
| enable-cache: true | ||
| python-version: ${{ inputs.python-version }} | ||
| cache-dependency-glob: | | ||
| pyproject.toml | ||
| uv.lock | ||
|
|
||
| - name: Install required dependencies | ||
| shell: bash | ||
| run: | | ||
| uv sync | ||
|
|
||
| - name: Test module imports | ||
| shell: bash | ||
| run: | | ||
| uv run python -m tests.test_imports redisvl | ||
|
|
||
| - name: Install all dependencies | ||
| shell: bash | ||
| run: | | ||
| uv sync --all-extras | ||
|
|
||
| - name: Authenticate to Google Cloud | ||
| uses: google-github-actions/auth@v1 | ||
| with: | ||
| credentials_json: ${{ env.GOOGLE_CREDENTIALS }} | ||
|
|
||
| - name: Run full test suite | ||
| shell: bash | ||
| run: | | ||
| make test-all |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,136 @@ | ||
| name: Test Fork PR | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| pr_number: | ||
| description: 'Pull Request number to test' | ||
| required: true | ||
| type: number | ||
|
|
||
| permissions: | ||
| contents: read | ||
| checks: write | ||
| pull-requests: read | ||
|
|
||
| env: | ||
| PYTHON_VERSION: "3.11" | ||
| UV_VERSION: "0.7.13" | ||
|
|
||
| jobs: | ||
| setup: | ||
| name: Validate PR | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| head_sha: ${{ steps.pr-info.outputs.head_sha }} | ||
| head_repo: ${{ steps.pr-info.outputs.head_repo }} | ||
| steps: | ||
| - name: Get PR information | ||
| id: pr-info | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const pr = await github.rest.pulls.get({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| pull_number: ${{ inputs.pr_number }} | ||
| }); | ||
|
|
||
| if (pr.data.state !== 'open') { | ||
| core.setFailed(`PR #${{ inputs.pr_number }} is not open`); | ||
| return; | ||
| } | ||
|
|
||
| if (pr.data.head.repo.full_name === `${context.repo.owner}/${context.repo.repo}`) { | ||
| core.setFailed(`PR #${{ inputs.pr_number }} is not from a fork. Use the regular workflow.`); | ||
| return; | ||
| } | ||
|
|
||
| core.setOutput('head_sha', pr.data.head.sha); | ||
| core.setOutput('head_repo', pr.data.head.repo.full_name); | ||
|
|
||
| console.log(`Testing PR #${{ inputs.pr_number }}`); | ||
| console.log(` Head SHA: ${pr.data.head.sha}`); | ||
| console.log(` Head Repo: ${pr.data.head.repo.full_name}`); | ||
|
|
||
| service-tests: | ||
| name: Service Tests | ||
| runs-on: ubuntu-latest | ||
| needs: setup | ||
| steps: | ||
| - name: Create check run | ||
| id: check | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const check = await github.rest.checks.create({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| name: 'Service Tests', | ||
| head_sha: '${{ needs.setup.outputs.head_sha }}', | ||
| status: 'in_progress', | ||
| started_at: new Date().toISOString() | ||
| }); | ||
| core.setOutput('check_id', check.data.id); | ||
|
|
||
| - name: Check out fork PR code | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| repository: ${{ needs.setup.outputs.head_repo }} | ||
| ref: ${{ needs.setup.outputs.head_sha }} | ||
|
|
||
| - name: Run service tests | ||
| uses: ./.github/actions/run-service-tests | ||
| with: | ||
| python-version: ${{ env.PYTHON_VERSION }} | ||
| uv-version: ${{ env.UV_VERSION }} | ||
| env: | ||
| HF_HOME: ${{ github.workspace }}/hf_cache | ||
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | ||
| GOOGLE_CREDENTIALS: ${{ secrets.GOOGLE_CREDENTIALS }} | ||
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | ||
| GCP_LOCATION: ${{ secrets.GCP_LOCATION }} | ||
| GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} | ||
| COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }} | ||
| MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }} | ||
| VOYAGE_API_KEY: ${{ secrets.VOYAGE_API_KEY }} | ||
| AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }} | ||
| AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }} | ||
| AZURE_OPENAI_DEPLOYMENT_NAME: ${{ secrets.AZURE_OPENAI_DEPLOYMENT_NAME }} | ||
| OPENAI_API_VERSION: ${{ secrets.OPENAI_API_VERSION }} | ||
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
| LANGCACHE_WITH_ATTRIBUTES_API_KEY: ${{ secrets.LANGCACHE_WITH_ATTRIBUTES_API_KEY }} | ||
| LANGCACHE_WITH_ATTRIBUTES_CACHE_ID: ${{ secrets.LANGCACHE_WITH_ATTRIBUTES_CACHE_ID }} | ||
| LANGCACHE_WITH_ATTRIBUTES_URL: ${{ secrets.LANGCACHE_WITH_ATTRIBUTES_URL }} | ||
| LANGCACHE_NO_ATTRIBUTES_API_KEY: ${{ secrets.LANGCACHE_NO_ATTRIBUTES_API_KEY }} | ||
| LANGCACHE_NO_ATTRIBUTES_CACHE_ID: ${{ secrets.LANGCACHE_NO_ATTRIBUTES_CACHE_ID }} | ||
| LANGCACHE_NO_ATTRIBUTES_URL: ${{ secrets.LANGCACHE_NO_ATTRIBUTES_URL }} | ||
|
|
||
| - name: Update check run (success) | ||
| if: success() | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| await github.rest.checks.update({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| check_run_id: ${{ steps.check.outputs.check_id }}, | ||
| status: 'completed', | ||
| conclusion: 'success', | ||
| completed_at: new Date().toISOString() | ||
| }); | ||
|
|
||
| - name: Update check run (failure) | ||
| if: failure() | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| await github.rest.checks.update({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| check_run_id: ${{ steps.check.outputs.check_id }}, | ||
| status: 'completed', | ||
| conclusion: 'failure', | ||
| completed_at: new Date().toISOString() | ||
| }); |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
If I understand right, this triggers on @ in comment? Like you did for this one?
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.
Yup, that's right 👍