Run Streamlit Folium Tests #261
This file contains hidden or 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: Run Streamlit Folium Tests | |
on: | |
schedule: | |
- cron: "0 13 * * *" | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
run: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Checkout Folium | |
uses: actions/checkout@v4 | |
- name: Checkout Streamlit Folium | |
uses: actions/checkout@v4 | |
with: | |
repository: randyzwitch/streamlit-folium | |
ref: master | |
path: streamlit_folium # Checkout into a subdirectory | |
- name: Build streamlit_folium javascript | |
run: | | |
cd streamlit_folium/streamlit_folium/frontend/ | |
npm install | |
npm run build | |
- name: Install streamlit_folium dev dependencies | |
run: | | |
cd streamlit_folium | |
python -m pip install --upgrade pip | |
pip install -r tests/requirements.txt | |
- name: Install streamlit-folium | |
run: | | |
cd streamlit_folium | |
pip install -e . | |
- name: Install playwright dependencies | |
run: | | |
playwright install --with-deps | |
- name: Install annotate-failures-plugin | |
run: pip install pytest-github-actions-annotate-failures coverage | |
- name: Install folium from source | |
run: | | |
python -m pip install -e . --force-reinstall | |
- name: Test with pytest and retry flaky tests up to 3 times | |
run: | | |
cd streamlit_folium | |
python -m pytest tests/test_frontend.py --browser chromium -s --reruns 3 -k "not test_layer_control_dynamic_update" | |
- name: Surface failing tests | |
if: always() | |
uses: pmeier/pytest-results-action@main | |
with: | |
path: streamlit_folium/test-results.xml | |
fail-on-empty: false | |
- name: Upload coverage | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-test-streamlit-folium | |
path: | | |
.coverage* |