Skip to content

Commit 83ed353

Browse files
authored
Merge pull request #4 from NCAR/dev-ui
Add Codecov coverage reporting and CodeQL security scanning
2 parents 755b6f6 + eb588ba commit 83ed353

5 files changed

Lines changed: 151 additions & 1 deletion

File tree

.codecov.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
target: auto # must not drop below current baseline
6+
threshold: 2% # allow up to 2% drop without failing
7+
patch:
8+
default:
9+
target: 70% # new code in a PR must be 70% covered
10+
11+
comment:
12+
layout: "reach,diff,flags"
13+
behavior: default

.github/workflows/codeql.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: CodeQL
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
- cron: "0 6 * * 1" # weekly Monday 06:00 UTC
10+
11+
jobs:
12+
analyze:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
security-events: write
16+
actions: read
17+
contents: read
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- uses: github/codeql-action/init@v3
23+
with:
24+
languages: python
25+
26+
- uses: github/codeql-action/analyze@v3
27+
with:
28+
category: "/language:python"

.github/workflows/tests.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,18 @@ jobs:
1414
- name: Install uv
1515
uses: astral-sh/setup-uv@v5
1616

17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.13"
20+
1721
- name: Install dependencies
1822
run: uv sync
1923

2024
- name: Run tests
21-
run: uv run pytest tests/ -v --tb=short
25+
run: uv run pytest tests/ -v --tb=short --cov --cov-report=xml
26+
27+
- name: Upload coverage to Codecov
28+
uses: codecov/codecov-action@v4
29+
with:
30+
files: ./coverage.xml
31+
fail_ci_if_error: false

pyproject.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,23 @@ dependencies = [
4343
[dependency-groups]
4444
dev = [
4545
"pytest>=9.0.2",
46+
"pytest-cov>=6.0.0",
4647
"ruff>=0.9.0",
4748
]
4849

50+
[tool.coverage.run]
51+
source = ["notebooks"]
52+
omit = [
53+
"*/tests/*",
54+
"*/.venv/*",
55+
"*/helpers/v*_dino_embeddings_lancedb.py",
56+
"*/helpers/v*_openclip_embeddings_lancedb.py",
57+
]
58+
59+
[tool.coverage.report]
60+
show_missing = true
61+
skip_empty = true
62+
4963
[tool.marimo.runtime]
5064
output_max_bytes = 10_000_000
5165

0 commit comments

Comments
 (0)