-
Notifications
You must be signed in to change notification settings - Fork 214
145 lines (118 loc) · 4.45 KB
/
ci.yaml
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: CI
on:
push:
branches:
- "master"
pull_request:
branches:
- "master"
jobs:
build-examples-templates-and-run-dockerized-e2e-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node_version:
# For details, see: https://nodejs.dev/en/about/releases/
# Maintenance LTS. End Of Life: 2023-09-11
- 16.x
# Active LTS. End Of Life: 2025-04-30
- 18.x
# Current version
- 19.x
component_lib_version:
- current
- develop
streamlit_version:
- latest
- nightly
env:
NODE_VERSION: ${{ matrix.node_version }}
PYTHON_VERSION: 3.8 # Oldest version supported by Streamlit
STREAMLIT_VERSION: ${{ matrix.streamlit_version }}
COMPONENT_LIB_VERSION: ${{ matrix.component_lib_version }}
name: Examples + Templates / node_version=${{ matrix.node_version }} / streamlit_version=${{ matrix.streamlit_version }} / component_lib_version=${{ matrix.component_lib_version }}
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Check dependencies for examples
run: ./dev.py examples-check-deps
- name: Check e2e utils files
run: ./dev.py e2e-utils-check
- name: Checkout streamlit/streamlit
if: matrix.component_lib_version == 'develop'
uses: actions/checkout@v3
with:
persist-credentials: false
repository: streamlit/streamlit
ref: develop
path: streamlit
- name: Install node dependencies for streamlit-component-lib
if: matrix.component_lib_version == 'develop'
working-directory: ./streamlit/component-lib/
run: |
npm install -g yarn
yarn install
- name: Build streamlit-component-lib package
if: matrix.component_lib_version == 'develop'
working-directory: ./streamlit/component-lib/
run: yarn run build && npm pack
- name: Link develop version of streamlit-component-lib
if: matrix.component_lib_version == 'develop'
env:
COMPONENT_LIB_DIR: ${{ github.workspace }}/streamlit/component-lib/
run: |
component_lib_tar_gz=$(find "${COMPONENT_LIB_DIR}" -maxdepth 1 -name 'streamlit-component-lib-*.tgz')
component_lib_tar_gz=$(readlink -e "${component_lib_tar_gz}")
find examples template template-reactless -name frontend -maxdepth 3 | while IFS= read -r line; do
(
cd "${line}";
npm install "${component_lib_tar_gz}"
)
done
- name: Install node dependencies
run: ./dev.py all-npm-install
- name: Build frontend code
run: ./dev.py all-npm-build
- name: Build wheel packages
run: |
find examples template template-reactless -maxdepth 3 -name '__init__.py' |\
xargs -n 1 sed -i 's/_RELEASE = False/_RELEASE = True/';
./dev.py all-python-build-package
- name: Upload wheel packages
uses: actions/upload-artifact@v3
with:
name: all-wheel
path: dist/*.whl
if-no-files-found: error
- name: Set up Docker Buildx
if: matrix.node_version == '19.x'
uses: docker/setup-buildx-action@7703e82fbced3d0c9eec08dff4429c023a5fd9a9 # v2.9.1
- name: Build docker images
if: matrix.node_version == '19.x'
run: ./dev.py e2e-build-images "--streamlit-version=${{ env.STREAMLIT_VERSION }}" "--python-version=${{ env.PYTHON_VERSION }}"
- name: Run e2e tests
if: matrix.node_version == '19.x'
run: ./dev.py e2e-run-tests "--streamlit-version=${{ env.STREAMLIT_VERSION }}" "--python-version=${{ env.PYTHON_VERSION }}"
build-cookiecutter:
runs-on: ubuntu-latest
name: Cookiecutter
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Install cookiecutter
run: |
pip install pipx
# Cookiecutter 2.2.3 has broken replay file support used in our regression check.
# It should still works for end-user.
# See: https://github.com/cookiecutter/cookiecutter/issues/1900
pipx install 'cookiecutter==2.2.2'
- name: Checks that templates have been generated by cookiecutter and have no unwanted changes.
run: |
./dev.py templates-check-not-modified