Skip to content

Commit c8e2a59

Browse files
committed
added GitHub workflows
1 parent 85cac91 commit c8e2a59

File tree

4 files changed

+77
-0
lines changed

4 files changed

+77
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Build Template
2+
3+
on:
4+
workflow_call:
5+
secrets:
6+
E2B_API_KEY:
7+
required: true
8+
E2B_DOMAIN:
9+
required: true
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
build-docker-image:
16+
name: Build Docker Image
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v3
21+
with:
22+
fetch-depth: 0
23+
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v3
26+
27+
- name: Set package version
28+
working-directory: ./template
29+
run: |
30+
VERSION=$(cat ../chart_data_extractor/pyproject.toml | grep version | cut -d '"' -f 2)
31+
echo "Version: $VERSION"
32+
sed -i "s/e2b_charts/e2b_charts==${VERSION}/g" requirements.txt
33+
34+
- name: Build Docker image
35+
uses: docker/build-push-action@v6
36+
with:
37+
context: ./template
38+
push: false
39+
platforms: linux/amd64
40+
tags: ${{ secrets.DOCKERHUB_USERNAME }}/code-interpreter:latest
41+
42+
build-template:
43+
name: Build E2B template
44+
runs-on: ubuntu-latest
45+
needs: [build-docker-image]
46+
if: always() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
47+
steps:
48+
- name: Checkout repository
49+
uses: actions/checkout@v3
50+
with:
51+
fetch-depth: 0
52+
53+
- name: Install E2B CLI
54+
run: npm install -g @e2b/cli
55+
56+
- name: Build e2b
57+
run: e2b template build
58+
working-directory: ./template
59+
env:
60+
E2B_ACCESS_TOKEN: ${{ secrets.E2B_ACCESS_TOKEN }}
61+
E2B_DOMAIN: ${{ secrets.E2B_DOMAIN }}

.github/workflows/js_tests.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
secrets:
66
E2B_API_KEY:
77
required: true
8+
E2B_DOMAIN:
9+
required: true
810

911
permissions:
1012
contents: read
@@ -49,6 +51,7 @@ jobs:
4951
run: pnpm test
5052
env:
5153
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
54+
E2B_DOMAIN: ${{ secrets.E2B_DOMAIN }}
5255

5356
- name: Install Bun
5457
uses: oven-sh/setup-bun@v2
@@ -59,6 +62,7 @@ jobs:
5962
run: pnpm test:bun
6063
env:
6164
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
65+
E2B_DOMAIN: ${{ secrets.E2B_DOMAIN }}
6266

6367
- name: Install Deno
6468
uses: denoland/setup-deno@v1
@@ -69,3 +73,4 @@ jobs:
6973
run: pnpm test:deno
7074
env:
7175
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
76+
E2B_DOMAIN: ${{ secrets.E2B_DOMAIN }}

.github/workflows/pull_request.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,23 @@ on:
1414
- main
1515

1616
jobs:
17+
build-template:
18+
uses: ./.github/workflows/build_template.yml
19+
secrets:
20+
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
21+
E2B_DOMAIN: ${{ secrets.E2B_DOMAIN }}
1722
js-sdk:
1823
uses: ./.github/workflows/js_tests.yml
1924
secrets:
2025
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
26+
E2B_DOMAIN: ${{ secrets.E2B_DOMAIN }}
2127
python-sdk:
2228
uses: ./.github/workflows/python_tests.yml
2329
secrets:
2430
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
31+
E2B_DOMAIN: ${{ secrets.E2B_DOMAIN }}
2532
charts-tests:
2633
uses: ./.github/workflows/charts_tests.yml
34+
secrets:
35+
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
36+
E2B_DOMAIN: ${{ secrets.E2B_DOMAIN }}

.github/workflows/python_tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,4 @@ jobs:
4343
run: poetry run pytest --verbose -x
4444
env:
4545
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
46+
E2B_DOMAIN: ${{ secrets.E2B_DOMAIN }}

0 commit comments

Comments
 (0)