Repository navigation
Expand file tree
/
Copy pathcomponent-template-e2e-tests.yml
More file actions
105 lines (89 loc) · 3.61 KB
/
Copy pathcomponent-template-e2e-tests.yml
File metadata and controls
105 lines (89 loc) · 3.61 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Component-template Repo E2E Tests
on:
push:
branches:
- "develop"
pull_request:
types: [opened, synchronize, reopened]
paths-ignore:
# Don't run CI if changes are only in documentation/spec folders:
- "specs/**"
- "wiki/**"
jobs:
component-template-e2e-tests:
runs-on: ubuntu-latest-8-cores
steps:
- name: Checkout Streamlit code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
submodules: "recursive"
fetch-depth: 2
- name: Enable Corepack
run: corepack enable
- name: Setup Node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version-file: ".nvmrc"
cache: "yarn"
cache-dependency-path: "frontend/yarn.lock"
- name: Set Python version vars
uses: ./.github/actions/build_info
- name: Set up Python ${{ env.PYTHON_MAX_VERSION }}
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: "${{ env.PYTHON_MAX_VERSION }}"
- name: Setup virtual env
uses: ./.github/actions/make_init
with:
python_version: ${{ env.PYTHON_MAX_VERSION }}
- name: Build Package
timeout-minutes: 120
run: make package
- name: Return path to Streamlit wheel
id: streamlit_wheel
shell: bash
run: |
streamlit_wheel=$(find "./lib/dist" -maxdepth 1 -name '*.whl')
streamlit_wheel=$(readlink -e "${streamlit_wheel}")
echo "output_file=${streamlit_wheel}" >> $GITHUB_OUTPUT
- name: Install node dependencies for streamlit-component-lib
working-directory: frontend/component-lib
shell: bash
run: yarn install --immutable
- name: Build streamlit-component-lib package
working-directory: frontend/component-lib
shell: bash
run: yarn run build && npm pack
- name: Return path to Component Library
working-directory: frontend/component-lib
id: component_library
shell: bash
run: |
component_lib_tar_gz=$(find "./" -maxdepth 1 -name 'streamlit-component-lib-*.tgz')
component_lib_tar_gz=$(readlink -e "${component_lib_tar_gz}")
echo "output_file=${component_lib_tar_gz}" >> $GITHUB_OUTPUT
- name: Checkout streamlit/component-template
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
repository: streamlit/component-template
path: ./component-template
# The component-template repo uses `python -m build` which requires pip.
# uv venvs don't include pip by default, and build 1.4.1+ requires pip
# to be available via `python -m pip` for isolated builds.
# This must be placed AFTER `make package` because uv sync removes pip.
# See: https://github.com/pypa/build/issues/1004
- name: Install pip in venv for build compatibility
run: python -m ensurepip --upgrade
- name: Build components wheels
uses: ./component-template/.github/actions/build_component_wheels
id: component_wheels
with:
custom_streamlit_component_lib_file: >-
${{ steps.component_library.outputs.output_file }}
- name: Run E2E tests
uses: ./component-template/.github/actions/run_e2e
with:
python_version: ${{ env.PYTHON_MAX_VERSION }}
streamlit_wheel_file: ${{ steps.streamlit_wheel.outputs.output_file }}