File tree Expand file tree Collapse file tree 5 files changed +76
-3
lines changed
Expand file tree Collapse file tree 5 files changed +76
-3
lines changed Original file line number Diff line number Diff line change 1+ name : " CodeQL"
2+
3+ on :
4+ push :
5+ branches : [ "main" ]
6+ pull_request :
7+ branches : [ "main" ]
8+ schedule :
9+ - cron : " 41 4 * * 6"
10+
11+ jobs :
12+ analyze :
13+ name : Analyze
14+ runs-on : ubuntu-latest
15+ permissions :
16+ actions : read
17+ contents : read
18+ security-events : write
19+
20+ strategy :
21+ fail-fast : false
22+ matrix :
23+ language : [ python ]
24+
25+ steps :
26+ - name : Checkout
27+ uses : actions/checkout@v3
28+
29+ - name : Initialize CodeQL
30+ uses : github/codeql-action/init@v3
31+ with :
32+ languages : ${{ matrix.language }}
33+ queries : +security-and-quality
34+
35+ - name : Autobuild
36+ uses : github/codeql-action/autobuild@v3
37+
38+ - name : Perform CodeQL Analysis
39+ uses : github/codeql-action/analyze@v3
40+ with :
41+ category : " /language:${{ matrix.language }}"
Original file line number Diff line number Diff line change 4646 - name : Install package
4747 run : micromamba run -n grouper-dev pip install -e .
4848
49- - name : Run tests with pytest
50- run : micromamba run -n grouper-dev pytest Grouper/tests
49+ - name : Test (OS -> ${{ matrix.os }} / Python -> ${{ matrix.python-version }})
50+ run : micromamba run -n grouper-dev python -m pytest -v --cov-append --cov-config=pyproject.toml --color yes --pyargs Grouper
51+
52+ - name : Upload coverage reports to Codecov
53+ uses : codecov/codecov-action@v5
54+ with :
55+ token : ${{ secrets.CODECOV_TOKEN }}
56+ verbose : true
57+ files : ./coverage.xml
Original file line number Diff line number Diff line change 1+ ignore :
2+ - " Grouper/tests"
3+ - " Grouper/images"
4+ - " Grouper/packages"
5+ - " Grouper/submission_scripts"
6+ - " Grouper/.github/ISSUE_TEMPLATE"
7+ - " Grouper/.github/PULL_REQUEST_TEMPLATE.md"
8+ - " run_random_generate.py"
9+ - " run_exhaustive_generate.py"
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ dependencies:
2323 - pytorch
2424 - pytest-benchmark
2525 - pytest
26+ - pytest-cov
27+ - coverage
28+ - codecov
2629 - nlohmann_json
2730 - python-igraph
2831 - dash
Original file line number Diff line number Diff line change @@ -14,4 +14,17 @@ cmake.minimum-version = "3.15"
1414wheel.expand-macos-universal-tags = true
1515
1616[tool .setuptools ]
17- packages = [" Grouper" ]
17+ packages = [" Grouper" ]
18+
19+ [tool .pytest .ini_options ]
20+ addopts = " --cov=Grouper --cov-report=xml:coverage.xml"
21+
22+ [tool .coverage .run ]
23+ source = [" Grouper" ] # Adjust based on your project structure
24+ branch = true # Include branch coverage
25+
26+ [tool .coverage .report ]
27+ exclude_lines = [
28+ " pragma: no cover" ,
29+ " if TYPE_CHECKING:" ,
30+ ]
You can’t perform that action at this time.
0 commit comments