import this #11029
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: Test BE | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| env: | |
| MARIMO_SKIP_UPDATE_CHECK: 1 | |
| jobs: | |
| changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| backend: ${{ steps.filter.outputs.backend }} | |
| docs: ${{ steps.filter.outputs.docs }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| backend: | |
| - 'marimo/**' | |
| - 'tests/**' | |
| - 'pyproject.toml' | |
| docs: | |
| - 'docs/**' | |
| test_docs: | |
| needs: changes | |
| if: ${{ needs.changes.outputs.docs == 'true' }} | |
| name: Test docs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: 🛑 Cancel Previous Runs | |
| uses: styfle/[email protected] | |
| - name: ⬇️ Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: ⬇️ Install Hatch | |
| uses: pypa/hatch@install | |
| - name: 📚 Build docs | |
| run: hatch run docs:build --strict | |
| test_python: | |
| needs: changes | |
| if: ${{ needs.changes.outputs.backend == 'true' }} | |
| name: ${{ matrix.os }} / Py ${{ matrix.python-version }} / ${{ matrix.dependencies }} deps | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 20 | |
| defaults: | |
| run: | |
| shell: bash | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| dependencies: ["core", "core,optional"] | |
| python-version: ["3.10"] | |
| include: | |
| - os: ubuntu-latest | |
| python-version: "3.10" | |
| dependencies: "minimal" | |
| - os: ubuntu-latest | |
| python-version: "3.11" | |
| dependencies: "core" | |
| - os: ubuntu-latest | |
| python-version: "3.12" | |
| dependencies: "core" | |
| - os: ubuntu-latest | |
| python-version: "3.13" | |
| dependencies: "core" | |
| - os: ubuntu-latest | |
| python-version: "3.14" | |
| dependencies: "core" | |
| - os: ubuntu-latest | |
| python-version: "3.10" | |
| dependencies: "core,optional" | |
| - os: ubuntu-latest | |
| python-version: "3.11" | |
| dependencies: "core,optional" | |
| - os: ubuntu-latest | |
| python-version: "3.12" | |
| dependencies: "core,optional" | |
| - os: ubuntu-latest | |
| python-version: "3.13" | |
| dependencies: "core,optional" | |
| # TODO: Add in 3.14 optional once there is broader wheel support | |
| steps: | |
| - name: 🛑 Cancel Previous Runs | |
| uses: styfle/[email protected] | |
| - uses: actions/checkout@v4 | |
| - name: 🥚 Install Hatch | |
| uses: pypa/hatch@install | |
| # This step is needed since some of our tests rely on the index.html file | |
| - name: Create assets directory, copy over index.html | |
| run: | | |
| mkdir -p marimo/_static/assets | |
| cp frontend/index.html marimo/_static/index.html | |
| cp frontend/public/favicon.ico marimo/_static/favicon.ico | |
| - name: Lint | |
| if: ${{ matrix.python-version == '3.12' }} | |
| run: hatch run lint | |
| - name: Typecheck | |
| if: ${{ matrix.python-version == '3.12' }} | |
| run: hatch run typecheck:check | |
| # Required since python3.14 not pulled automatically for now. | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| # Test with base dependencies | |
| - name: Test with base dependencies | |
| if: ${{ matrix.dependencies == 'core' }} | |
| run: | | |
| hatch run +py=${{ matrix.python-version }} test:test tests/ \ | |
| -v \ | |
| -k "not test_cli" \ | |
| --durations=10 \ | |
| --picked=first | |
| # Test with optional dependencies | |
| - name: Test with optional dependencies | |
| if: ${{ matrix.dependencies == 'core,optional' }} | |
| run: | | |
| hatch run +py=${{ matrix.python-version }} test-optional:test tests/ \ | |
| -v \ | |
| -k "not test_cli" \ | |
| --durations=10 \ | |
| --picked=first | |
| # Test with minimal dependencies using lowest resolution | |
| # https://docs.astral.sh/uv/concepts/resolution/#lowest-resolution | |
| # https://docs.astral.sh/uv/reference/environment/#uv_resolution | |
| - name: Test with minimal dependencies (lowest resolution) | |
| if: ${{ matrix.dependencies == 'minimal' }} | |
| run: | | |
| hatch run +py=${{ matrix.python-version }} test:test tests/ \ | |
| -v \ | |
| -k "not test_cli" \ | |
| --durations=10 \ | |
| --picked=first | |
| env: | |
| UV_RESOLUTION: lowest | |
| # Only run coverage on `main` so it is not blocking | |
| test_coverage: | |
| needs: changes | |
| if: ${{ needs.changes.outputs.backend == 'true' && github.ref == 'refs/heads/main' && github.event_name == 'push' }} | |
| name: Test coverage | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 25 | |
| steps: | |
| - name: 🛑 Cancel Previous Runs | |
| uses: styfle/[email protected] | |
| - uses: actions/checkout@v4 | |
| - name: 🥚 Install Hatch | |
| uses: pypa/hatch@install | |
| # This step is needed since some of our tests rely on the index.html file | |
| - name: Create assets directory, copy over index.html | |
| run: | | |
| mkdir -p marimo/_static/assets | |
| cp frontend/index.html marimo/_static/index.html | |
| cp frontend/public/favicon.ico marimo/_static/favicon.ico | |
| - name: Test with optional dependencies | |
| run: | | |
| hatch run +py=3.12 test-optional:test -v tests/ -k "not test_cli" --durations=10 \ | |
| --cov=marimo --cov-report=xml --junitxml=junit.xml -o junit_family=legacy | |
| # Only upload coverage on `main` so it is not blocking | |
| # and only on `3.12`, `ubuntu-latest`, with optional deps since it is mostly duplicate | |
| # coverage from the other matrix jobs. | |
| - name: Upload coverage reports to Codecov | |
| if: ${{ !cancelled() }} | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: ./coverage.xml | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Upload test results to Codecov | |
| if: ${{ !cancelled() }} | |
| uses: codecov/test-results-action@v1 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |