-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (60 loc) · 2.05 KB
/
code-coverage.yml
File metadata and controls
67 lines (60 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Code coverage
on: [push, workflow_dispatch]
jobs:
run:
runs-on: ubuntu-latest
env:
OS: ubuntu-latest
PYTHON: '3.11'
steps:
- name: Checkout repo with submodules
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
persist-credentials: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Sync and update FracturedJson submodule to tip of main
run: |
set -euo pipefail
# Ensure .gitmodules remotes are in sync and initialize submodules
git submodule sync --recursive
git submodule update --init --recursive
# Force FracturedJson to origin/main (robust for shallow clones)
if [ -d "FracturedJson" ]; then
pushd FracturedJson
git fetch --no-tags origin main
if git rev-parse --verify origin/main >/dev/null 2>&1; then
git checkout -B main origin/main
git reset --hard origin/main
else
echo "ERROR: origin/main not found for FracturedJson"
git show-ref || true
exit 1
fi
popd
else
echo "ERROR: FracturedJson directory not found after init"
exit 1
fi
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v5
with:
python-version: '3.13'
- name: Install the project
run: uv sync --locked --all-extras --dev
- name: Build FracturedJson binaries
run: uv run python3 src/build/build_binaries.py
- name: Generate coverage report
run: uv run pytest --cov=fractured_json --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ./coverage/reports/
env_vars: OS,PYTHON
fail_ci_if_error: true
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
verbose: true