Skip to content

armgit / mwmbl

Public Imported from GitHub
0

An open source, non-profit web search engine

CI: run and generate coverage

blueheron7861e0f870ec391
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index b707647..4d2e29d 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -2,7 +2,6 @@ name: CI
on:
push:
- branches: [main]
pull_request:
jobs:
@@ -115,10 +114,19 @@ jobs:
#----------------------------------------------
- name: Check the crawler entry point imports standalone
run: uv run python -c "from mwmbl.crawl import run"
- - name: Run tests
+ - name: Run tests with coverage
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/test_mwmbl
DJANGO_SETTINGS_MODULE: mwmbl.settings_test
TEST_REDIS_URL: redis://localhost:6379/15
run: |
- uv run pytest
+ uv run pytest \
+ --cov=mwmbl \
+ --cov-report=term-missing \
+ --cov-report=xml
+ - name: Upload coverage to Codecov
+ if: github.event_name == 'push' || github.event.pull_request.head.repo.fork == false
+ uses: codecov/codecov-action@v5
+ with:
+ files: ./coverage.xml
+ fail_ci_if_error: false
diff --git a/README.md b/README.md
index 6c02bd1..4403039 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,8 @@
[![Matrix](https://img.shields.io/matrix/mwmbl:matrix.org)](https://matrix.to/#/#mwmbl:matrix.org)
+[![codecov](https://codecov.io/gh/mwmbl/mwmbl/graph/badge.svg)](https://codecov.io/gh/mwmbl/mwmbl)
+
**No ads, no tracking, no profit**
[Mwmbl](https://mwmbl.org) is a non-profit, open source search engine