-
Notifications
You must be signed in to change notification settings - Fork 207
67 lines (58 loc) · 1.88 KB
/
build_test_template.yml
File metadata and controls
67 lines (58 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Build Template
on:
workflow_call:
secrets:
E2B_API_KEY:
required: true
inputs:
E2B_DOMAIN:
required: false
type: string
outputs:
template_id:
description: "The ID of the built template"
value: ${{ jobs.build.outputs.template_id }}
permissions:
contents: read
jobs:
build:
name: Build E2B Template
runs-on: ubuntu-latest
outputs:
template_id: ${{ steps.build-template.outputs.template_id }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Parse .tool-versions
uses: wistia/parse-tool-versions@v2.1.1
with:
filename: '.tool-versions'
uppercase: 'true'
prefix: 'tool_version_'
- name: Set package version
working-directory: ./template
run: |
VERSION=$(cat ../chart_data_extractor/pyproject.toml | grep version | cut -d '"' -f 2)
echo "Version: $VERSION"
sed -i "s/e2b_charts/e2b_charts==${VERSION}/g" requirements.txt
- uses: actions/setup-python@v6
with:
python-version: '${{ env.TOOL_VERSION_PYTHON }}'
- name: Install development dependencies
working-directory: ./template
run: pip install -r requirements-dev.txt
- name: Generate Template Name
id: generate-template-id
run: |
E2B_TESTS_TEMPLATE=e2b-code-interpreter-ci-$(uuidgen)
echo "Generated Template Name: $E2B_TESTS_TEMPLATE"
echo "template_name=$E2B_TESTS_TEMPLATE" >> $GITHUB_OUTPUT
- name: Build E2B template
id: build-template
working-directory: ./template
run: |
python build_ci.py
env:
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
E2B_DOMAIN: ${{ inputs.E2B_DOMAIN }}
E2B_TESTS_TEMPLATE: ${{ steps.generate-template-id.outputs.template_name }}