Skip to content

Merge pull request #2254 from python-visualization/dependabot/pre_com… #300

Merge pull request #2254 from python-visualization/dependabot/pre_com…

Merge pull request #2254 from python-visualization/dependabot/pre_com… #300

name: Run Snapshot Tests
# no permissions by default
permissions: {}
on:
pull_request:
push:
branches:
- main
jobs:
run:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
permissions:
actions: write
steps:
- name: Checkout Folium
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Micromamba env
uses: mamba-org/setup-micromamba@d7c9bd84e824b79d2af72a2d4196c7f4300d3476 # v3.0.0
with:
environment-name: TEST
create-args: >-
python=3
--file requirements.txt
--file requirements-dev.txt
- name: Install pytest plugins and pixelmatch
run: |
pip install pixelmatch pytest-github-actions-annotate-failures pytest-rerunfailures
- name: Install folium from source
run: |
python -m pip install -e . --no-deps --force-reinstall
- name: Test with pytest
run: |
coverage run -p -m pytest tests/snapshots -s --junit-xml=test-results.xml
- name: Surface failing tests
if: always()
uses: pmeier/pytest-results-action@fdc7f18d9934e38aca411ca9557e6577bd25ca9c # v0.9.0
with:
path: test-results.xml
fail-on-empty: false
- name: Upload screenshots
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: screenshots
path: |
/tmp/screenshot_*_*.png
/tmp/folium_map_*.html
- name: Upload coverage
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: coverage-test-snapshots
path: |
.coverage*
include-hidden-files: true