Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

chore: add codecov on main

Myles Scolnick2077f3b6841e
diff --git a/.github/workflows/test_be.yaml b/.github/workflows/test_be.yaml
index 402a10844b..4a6912f911 100644
--- a/.github/workflows/test_be.yaml
+++ b/.github/workflows/test_be.yaml
@@ -117,3 +117,38 @@ jobs:
if: ${{ matrix.dependencies == 'core,optional' }}
run: |
hatch run +py=${{ matrix.python-version }} test-optional:test -v tests/ -k "not test_cli" --durations=10
+
+ # 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: 15
+ 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
+
+ # 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
+ uses: codecov/codecov-action@v5
+ env:
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}