Skip to content
Merged
Show file tree
Hide file tree
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
63 changes: 63 additions & 0 deletions .github/workflows/performance_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Performance tests

on:
workflow_call:
secrets:
E2B_API_KEY:
required: true
inputs:
E2B_DOMAIN:
required: false
type: string
E2B_TESTS_TEMPLATE:
required: false
type: string
E2B_TESTS_BENCHMARK_ITERATIONS_COUNT:
required: false
type: number
default: 20

permissions:
contents: read

jobs:
performance-tests:
defaults:
run:
working-directory: ./python
name: Performance tests
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.5.1
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Install dependencies
run: poetry install

- name: Run performance tests
run: poetry run python tests/performance.py
env:
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
E2B_DOMAIN: ${{ inputs.E2B_DOMAIN }}
E2B_TESTS_TEMPLATE: ${{ inputs.E2B_TESTS_TEMPLATE }}
E2B_TESTS_BENCHMARK_ITERATIONS_COUNT: ${{ inputs.E2B_TESTS_BENCHMARK_ITERATIONS_COUNT }}
- name: Upload performance plot artifact
uses: actions/upload-artifact@v4
if: always()
with:
name: performance-plot-${{ github.run_number }}
path: ./python/performance_plot.png
retention-days: 30
10 changes: 9 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,17 @@ jobs:
with:
E2B_DOMAIN: ${{ vars.E2B_DOMAIN }}
E2B_TESTS_TEMPLATE: ${{ needs.build-template.outputs.template_id }}
performance-tests:
uses: ./.github/workflows/performance_tests.yml
needs: build-template
secrets:
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
with:
E2B_DOMAIN: ${{ vars.E2B_DOMAIN }}
E2B_TESTS_TEMPLATE: ${{ needs.build-template.outputs.template_id }}
cleanup-build-template:
uses: ./.github/workflows/cleanup_build_template.yml
needs: [build-template, js-sdk, python-sdk]
needs: [build-template, js-sdk, python-sdk, performance-tests]
if: always() && !contains(needs.build-template.result, 'failure') && !contains(needs.build-template.result, 'cancelled')
secrets:
E2B_TESTS_ACCESS_TOKEN: ${{ secrets.E2B_TESTS_ACCESS_TOKEN }}
Expand Down
Loading