134 lines
4.4 KiB
YAML
134 lines
4.4 KiB
YAML
name: SDK Tests
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
changes:
|
|
name: Detect changes
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
pull-requests: read
|
|
outputs:
|
|
js: ${{ steps.filter.outputs.js }}
|
|
python: ${{ steps.filter.outputs.python }}
|
|
cli: ${{ steps.filter.outputs.cli }}
|
|
steps:
|
|
- name: Filter changed paths
|
|
# On workflow_dispatch there is no PR diff and paths-filter would fall
|
|
# back to git (failing without a checkout); the job-level `if`s below
|
|
# force a full run for that event instead, so we only filter on pull_request.
|
|
if: github.event_name == 'pull_request'
|
|
uses: dorny/paths-filter@v3
|
|
id: filter
|
|
with:
|
|
# `**/!(*.md)` excludes Markdown so docs-only changes don't trigger the suites.
|
|
filters: |
|
|
shared: &shared
|
|
- '.github/workflows/sdk_tests.yml'
|
|
- 'spec/**/!(*.md)'
|
|
- 'pnpm-lock.yaml'
|
|
- 'pnpm-workspace.yaml'
|
|
- 'package.json'
|
|
- '.tool-versions'
|
|
js:
|
|
- *shared
|
|
- '.github/workflows/js_sdk_tests.yml'
|
|
- 'packages/js-sdk/**/!(*.md)'
|
|
python:
|
|
- *shared
|
|
- '.github/workflows/python_sdk_tests.yml'
|
|
- 'packages/python-sdk/**/!(*.md)'
|
|
- 'packages/connect-python/**/!(*.md)'
|
|
cli:
|
|
- *shared
|
|
- '.github/workflows/cli_tests.yml'
|
|
- 'packages/cli/**/!(*.md)'
|
|
- 'packages/js-sdk/**/!(*.md)'
|
|
|
|
js-tests:
|
|
name: Production / JS SDK Tests
|
|
needs: changes
|
|
if: ${{ needs.changes.outputs.js == 'true' || github.event_name == 'workflow_dispatch' }}
|
|
uses: ./.github/workflows/js_sdk_tests.yml
|
|
secrets:
|
|
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
|
|
|
|
python-tests:
|
|
name: Production / Python SDK Tests
|
|
needs: changes
|
|
if: ${{ needs.changes.outputs.python == 'true' || github.event_name == 'workflow_dispatch' }}
|
|
uses: ./.github/workflows/python_sdk_tests.yml
|
|
secrets:
|
|
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
|
|
|
|
cli-tests:
|
|
name: Production / CLI Tests
|
|
needs: changes
|
|
if: ${{ needs.changes.outputs.cli == 'true' || github.event_name == 'workflow_dispatch' }}
|
|
uses: ./.github/workflows/cli_tests.yml
|
|
secrets:
|
|
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
|
|
|
|
js-tests-staging:
|
|
name: Staging / JS SDK Tests
|
|
needs: changes
|
|
if: ${{ needs.changes.outputs.js == 'true' || github.event_name == 'workflow_dispatch' }}
|
|
uses: ./.github/workflows/js_sdk_tests.yml
|
|
with:
|
|
E2B_DOMAIN: ${{ vars.E2B_DOMAIN_STAGING }}
|
|
secrets:
|
|
E2B_API_KEY: ${{ secrets.E2B_API_KEY_STAGING }}
|
|
|
|
python-tests-staging:
|
|
name: Staging / Python SDK Tests
|
|
needs: changes
|
|
if: ${{ needs.changes.outputs.python == 'true' || github.event_name == 'workflow_dispatch' }}
|
|
uses: ./.github/workflows/python_sdk_tests.yml
|
|
with:
|
|
E2B_DOMAIN: ${{ vars.E2B_DOMAIN_STAGING }}
|
|
secrets:
|
|
E2B_API_KEY: ${{ secrets.E2B_API_KEY_STAGING }}
|
|
|
|
cli-tests-staging:
|
|
name: Staging / CLI Tests
|
|
needs: changes
|
|
if: ${{ needs.changes.outputs.cli == 'true' || github.event_name == 'workflow_dispatch' }}
|
|
uses: ./.github/workflows/cli_tests.yml
|
|
with:
|
|
E2B_DOMAIN: ${{ vars.E2B_DOMAIN_STAGING }}
|
|
secrets:
|
|
E2B_API_KEY: ${{ secrets.E2B_API_KEY_STAGING }}
|
|
|
|
status:
|
|
name: SDK Tests Status
|
|
# `changes` is included so a failure in change-detection (which would skip the
|
|
# suites) surfaces as a failed required check instead of a false green.
|
|
needs:
|
|
- changes
|
|
- js-tests
|
|
- python-tests
|
|
- cli-tests
|
|
if: ${{ always() }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Report aggregate result
|
|
run: |
|
|
echo "Job results: ${{ join(needs.*.result, ', ') }}"
|
|
if ${{ contains(needs.*.result, 'failure') }}; then
|
|
echo "::error::Change detection or a Production SDK test suite failed."
|
|
exit 1
|
|
fi
|
|
if ${{ contains(needs.*.result, 'cancelled') }}; then
|
|
echo "::error::Change detection or a Production SDK test suite was cancelled; tests were not verified — re-run before merging."
|
|
exit 1
|
|
fi
|
|
echo "All Production SDK test suites passed or were skipped."
|