Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Run tests for PRs (#133)

Jakub Nováke8a6510e3b09
diff --git a/.github/workflows/cli_tests.yml b/.github/workflows/cli_tests.yml
new file mode 100644
index 000000000..c625a164f
--- /dev/null
+++ b/.github/workflows/cli_tests.yml
@@ -0,0 +1,35 @@
+name: Test CLI
+
+on:
+ push:
+ paths:
+ - packages/cli/**/*
+ - .github/workflows/cli_tests.yml
+
+permissions:
+ contents: read
+
+jobs:
+ publish:
+ defaults:
+ run:
+ working-directory: ./packages/cli
+ name: Build CLI
+ runs-on: ubuntu-20.04
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v3
+
+ - name: Setup Node
+ uses: actions/setup-node@v3
+ with:
+ node-version: '16.x'
+ registry-url: 'https://registry.npmjs.org'
+ cache: npm
+ cache-dependency-path: package-lock.json
+
+ - name: Install dependencies
+ run: npm ci
+
+ - name: Test build
+ run: npm run build
diff --git a/.github/workflows/js_tests.yml b/.github/workflows/js_tests.yml
new file mode 100644
index 000000000..d7448970e
--- /dev/null
+++ b/.github/workflows/js_tests.yml
@@ -0,0 +1,38 @@
+name: Test JS SDK
+
+on:
+ push:
+ paths:
+ - packages/js-sdk/**/*
+ - .github/workflows/js_tests.yml
+
+permissions:
+ contents: read
+
+jobs:
+ publish:
+ defaults:
+ run:
+ working-directory: ./packages/js-sdk
+ name: Build and test SDK
+ runs-on: ubuntu-20.04
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v3
+
+ - name: Setup Node
+ uses: actions/setup-node@v3
+ with:
+ node-version: '16.x'
+ registry-url: 'https://registry.npmjs.org'
+ cache: npm
+ cache-dependency-path: package-lock.json
+
+ - name: Install dependencies
+ run: npm ci
+
+ - name: Test build
+ run: npm run build
+
+ - name: Run tests
+ run: npm run test
diff --git a/.github/workflows/python_tests.yml b/.github/workflows/python_tests.yml
new file mode 100644
index 000000000..1bfb41a61
--- /dev/null
+++ b/.github/workflows/python_tests.yml
@@ -0,0 +1,46 @@
+name: Test Python SDK
+
+on:
+ push:
+ paths:
+ - packages/python-sdk/**/*
+ - .github/workflows/python_tests.yml
+
+permissions:
+ contents: read
+
+jobs:
+ publish:
+ defaults:
+ run:
+ working-directory: ./packages/python-sdk
+ name: Build and test SDK
+ runs-on: ubuntu-20.04
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v3
+
+ - name: Set up Python
+ uses: actions/setup-python@v4
+ with:
+ python-version: '3.10'
+
+ - 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: Build Package
+ run: poetry install
+
+
+ - name: Build Package
+ run: poetry build
+
+ - name: Run tests
+ run: poetry run pytest -n auto
+ env:
+ E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 5a6b3f09e..30a1b2fe0 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -101,3 +101,13 @@ jobs:
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+ - name: Release Failed - Slack Notification
+ if: failure()
+ uses: rtCamp/action-slack-notify@v2
+ env:
+ SLACK_COLOR: '#ff0000'
+ SLACK_MESSAGE: ':bob-the-destroyer: See more in here:\n
+ ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}'
+ SLACK_TITLE: Release Failed
+ SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
\ No newline at end of file