Skip to content

Bump react-scripts to 5.0.1 and streamlit-component-lib to 2.0.0 #46

Bump react-scripts to 5.0.1 and streamlit-component-lib to 2.0.0

Bump react-scripts to 5.0.1 and streamlit-component-lib to 2.0.0 #46

Workflow file for this run

name: CI
on:
push:
branches:
- "master"
pull_request:
branches:
- "master"
jobs:
build-templates:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version:
# For details, see: https://nodejs.dev/en/about/releases/
# Maintance LTS. End Of Life: 2023-09-11
- 16.x
# Active LTS. End Of Life: 2025-04-30
- 18.x
# Current version
- 19.x
cwd:
- ./template
- ./template-reactless
component_lib_version:
- current
- develop
name: Templates / node-version=${{ matrix.node-version }} / cwd=${{ matrix.cwd }} / component_lib_version=${{ matrix.component_lib_version }}
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Checkout streamlit/streamlit
if: matrix.component_lib_version == 'develop'
uses: actions/checkout@v3
with:
persist-credentials: false
repository: streamlit/streamlit
# TODO(kbregula): Before merge, set to develop
ref: component-lib-modernize
path: streamlit
- name: Install node dependencies for streamlit-component-lib
if: matrix.component_lib_version == 'develop'
working-directory: ./streamlit/component-lib/
run: npm install
- name: Build streamlit-component-lib package
if: matrix.component_lib_version == 'develop'
working-directory: ./streamlit/component-lib/
run: npm run build
- name: Link develop version of streamlit-component-lib
if: matrix.component_lib_version == 'develop'
working-directory: ${{ matrix.cwd }}/my_component/frontend
env:
COMPONENT_LIB_DIR: ${{ github.workspace }}/streamlit/component-lib/
run: npm link "${COMPONENT_LIB_DIR}"
- name: Install node dependencies
working-directory: ${{ matrix.cwd }}/my_component/frontend
run: npm install
- name: Build frontend code
working-directory: ${{ matrix.cwd }}//my_component/frontend
run: npm run build
build-examples:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version:
# For details, see: https://nodejs.dev/en/about/releases/
# Maintance 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
name: Examples / node-version=${{ matrix.node-version }}
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Checkout streamlit/streamlit
if: matrix.component_lib_version == 'develop'
uses: actions/checkout@v3
with:
persist-credentials: false
repository: streamlit/streamlit
# TODO(kbregula): Before merge, set to develop
ref: component-lib-modernize
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
npm install -g npm
- name: Build streamlit-component-lib package
if: matrix.component_lib_version == 'develop'
working-directory: ./streamlit/component-lib/
run: yarn run build && npm pack
- uses: actions/setup-python@v4
with:
# Python 2.7 is required to install node-gyp. It is required to install node-sass.
python-version: '2.7'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Check dependencies
run: ./dev.py examples-check-deps
- name: Link develop version of streamlit-component-lib
if: matrix.component_lib_version == 'develop'
env:
COMPONENT_LIB_DIR: ${{ github.workspace }}/streamlit/component-lib/
run: |
set -x;
(
cd "examples/CustomDataframe/frontend";
npm install "${COMPONENT_LIB_DIR}/streamlit-component-lib-1.4.0.tgz";
);
(
cd "examples/MaterialLogin/frontend";
npm install "${COMPONENT_LIB_DIR}/streamlit-component-lib-1.4.0.tgz";
);
(
cd "examples/RadioButton/frontend";
npm install "${COMPONENT_LIB_DIR}/streamlit-component-lib-1.4.0.tgz";
);
(
cd "examples/SelectableDataTable/frontend";
npm install "${COMPONENT_LIB_DIR}/streamlit-component-lib-1.4.0.tgz";
);
- run: git status
- name: Install node dependencies
run: ./dev.py examples-npm-install
- name: Build frontend code
run: ./dev.py examples-npm-build