Set Streamlit Ecosystem and Streamlit Open Source teams as code owner… #297
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |