Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(CI): Report coverage as a PR comment #787

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
3830c25
chore(CI): Coverage report as a PR comment
rouk1 Nov 21, 2024
33dc849
Merge branch 'main' into 361-add-a-comment-in-prs-that-prints-the-bac…
rouk1 Nov 21, 2024
3bacba0
wip
rouk1 Nov 21, 2024
af3369b
wip
rouk1 Nov 21, 2024
47df562
wip
rouk1 Nov 21, 2024
7311557
wip
rouk1 Nov 21, 2024
518f90b
wip
rouk1 Nov 21, 2024
4acdb54
wip
rouk1 Nov 21, 2024
281ec97
wip
rouk1 Nov 21, 2024
34af7b9
wip
rouk1 Nov 21, 2024
7302e5e
yet another attempt
rouk1 Nov 21, 2024
3a3648a
again
rouk1 Nov 21, 2024
c721087
reenable matrix
rouk1 Nov 21, 2024
f3532b3
split
rouk1 Nov 21, 2024
6b647f4
wip
rouk1 Nov 21, 2024
50719f3
wip
rouk1 Nov 21, 2024
24eeb1b
wip
rouk1 Nov 21, 2024
b13ad71
wip
rouk1 Nov 21, 2024
d94d494
??
rouk1 Nov 21, 2024
9a93e4a
wip
rouk1 Nov 22, 2024
9c41222
wip
rouk1 Nov 22, 2024
24c6d79
wip
rouk1 Nov 22, 2024
605b758
wip
rouk1 Nov 22, 2024
edff7ae
wip
rouk1 Nov 22, 2024
e6ce642
wip
rouk1 Nov 22, 2024
e376f92
wip
rouk1 Nov 22, 2024
1069205
wip
rouk1 Nov 22, 2024
db46b3b
wip
rouk1 Nov 22, 2024
2c9e68c
wip
rouk1 Nov 22, 2024
574cf92
cleanup
rouk1 Nov 22, 2024
b0e8aad
wip
rouk1 Nov 22, 2024
cf70140
Merge branch 'main' into 361-add-a-comment-in-prs-that-prints-the-bac…
rouk1 Nov 22, 2024
c224e43
Merge branch 'main' into 361-add-a-comment-in-prs-that-prints-the-bac…
rouk1 Nov 25, 2024
79c429e
omit tests folder from coverage report
rouk1 Nov 25, 2024
c8d3e52
Merge branch 'main' into 361-add-a-comment-in-prs-that-prints-the-bac…
rouk1 Nov 26, 2024
9d894a5
Merge branch 'main' into 361-add-a-comment-in-prs-that-prints-the-bac…
augustebaum Nov 27, 2024
3e50a8e
feat: Add support for skrub's TableReport (#810)
rouk1 Nov 27, 2024
82c0e78
docs: Build documentation triggered by 9a31ff37f8329c95b68f634e8e7507…
github-actions[bot] Nov 27, 2024
8b83d0b
Merge branch 'main' into 361-add-a-comment-in-prs-that-prints-the-bac…
rouk1 Nov 27, 2024
ff6ceaf
wip
rouk1 Nov 28, 2024
2517a9c
Merge branch 'main' into 361-add-a-comment-in-prs-that-prints-the-bac…
rouk1 Nov 28, 2024
1f39c16
Merge branch 'main' into 361-add-a-comment-in-prs-that-prints-the-bac…
thomass-dev Nov 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
uses: ./.github/workflows/skore.yml
permissions:
contents: read
pull-requests: write

lint-and-test-skore-ui:
needs: [lint-all-files, changes]
Expand Down
72 changes: 31 additions & 41 deletions .github/workflows/skore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,29 @@ name: Reusable skore workflow

on: [workflow_call]

jobs:
build-skore-ui:
runs-on: ubuntu-latest
defaults:
run:
shell: 'bash'
working-directory: './skore-ui'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: skore-ui/package-lock.json
- shell: bash
run: |
npm install
npm run build
- uses: actions/upload-artifact@v4
with:
name: skore-ui-package-distributions
path: skore-ui/dist
defaults:
run:
shell: "bash"
working-directory: "./skore"

jobs:
test-skore:
needs: build-skore-ui
defaults:
run:
shell: 'bash'
working-directory: './skore'
strategy:
fail-fast: true
matrix:
os: ['ubuntu-latest', 'windows-latest']
python-version: ['3.9', '3.10', '3.11', '3.12']
os: ["ubuntu-latest", "windows-latest"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Download package distributions
uses: actions/download-artifact@v4
with:
name: skore-ui-package-distributions
path: skore/src/skore/ui/static
cache: "pip"
- name:
timeout-minutes: 10
run: |
# Install dependencies
python -m pip install --upgrade pip
python -m pip install --upgrade pre-commit
python -m pip install --upgrade build
Expand All @@ -65,13 +39,29 @@ jobs:
wheel=(dist/*.whl); python -m pip install "${wheel}[test]"

# Test
python -m pytest src/ tests/
python -m pytest --no-cov src/ tests/

cleanup:
skore-coverage:
runs-on: ubuntu-latest
if: always()
needs: test-skore
steps:
- uses: geekyeggo/delete-artifact@v5
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.12
cache: "pip"
- name: pytest coverage
run: |
# Install dependencies
python -m pip install --upgrade pip
python -m pip install --upgrade pre-commit
python -m pip install --upgrade build
python -m pip install -e .[test]

# run coverage
python -m pytest --junitxml=coverage.xml --cov=skore src/ tests/ | tee pytest-coverage.txt
- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@main
with:
name: skore-ui-package-distributions
pytest-coverage-path: ./skore/pytest-coverage.txt
junitxml-path: ./skore/coverage.xml
title: pytest coverage report
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ coverage.xml
.hypothesis/
.pytest_cache/
cover/
pytest-coverage.txt

# Translations
*.mo
Expand Down
23 changes: 10 additions & 13 deletions skore/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
[project]
name = "skore"
description = "Tooling and assistance for data scientists to \"Own Your Data Science\""
dynamic = [
"license",
"readme",
"version"
]
dynamic = ["license", "readme", "version"]
requires-python = ">=3.9, <3.13"
maintainers = [{name = "skore developers", email="[email protected]"}]
maintainers = [{ name = "skore developers", email = "[email protected]" }]
dependencies = [
"diskcache",
"fastapi",
Expand All @@ -17,7 +13,7 @@ dependencies = [
"skops",
"uvicorn",
]
classifiers=[
classifiers = [
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
Expand Down Expand Up @@ -116,11 +112,14 @@ addopts = [
"--ignore=notebooks",
]

[tool.coverage.run]
omit = [
"tests/*",
]

[tool.ruff]
src = ["skore"]
exclude = [
"doc"
]
exclude = ["doc"]

[tool.ruff.lint]
select = [
Expand Down Expand Up @@ -158,9 +157,7 @@ extend-ignore-re = [
]

[tool.typos.files]
extend-exclude = [
"*.min.js",
]
extend-exclude = ["*.min.js"]

[tool.typos.default.extend-words]
# acronym for "False Positive Rate"
Expand Down
7 changes: 0 additions & 7 deletions skore/tests/integration/ui/test_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ def test_app_state(client):
assert client.app.state.project is not None


def test_skore_ui_index(client):
response = client.get("/")

assert response.status_code == 200
assert b"<!DOCTYPE html>" in response.content


def test_get_items(client, in_memory_project):
response = client.get("/api/project/items")

Expand Down