Skip to content

Commit b6c6265

Browse files
daniel-thompesap
andauthored
Add CodeCov to pull requests (#15)
Fixed CI to show correct testing coverage List of changes: - Added Codecov to pull requests, - Fixed problem of pytest not showing the correct coverage, - Refactor CI files, - Update `README.md` to reflect correct CI file, - CI-coverage now runs on PR and pushes on main branch. - Remove un-used configuration from `pyproject.toml` --------- Co-authored-by: pesap <[email protected]>
1 parent 5807058 commit b6c6265

File tree

5 files changed

+24
-84
lines changed

5 files changed

+24
-84
lines changed

.github/workflows/main_tests.yml .github/workflows/ci.yml

+15-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
name: Main - CI
1+
name: CI
22

33
on:
4-
schedule:
5-
- cron: "0 0 * * 1-5"
64
push:
75
branches:
86
- main
7+
pull_request:
98

109
jobs:
11-
test:
12-
runs-on: ubuntu-latest
10+
pytest:
11+
runs-on: ${{ matrix.os }}
1312
strategy:
1413
matrix:
15-
python-version: ["3.11"]
14+
python-version: ["3.11", "3.12"]
15+
os: [ubuntu-latest, windows-latest]
1616

1717
steps:
1818
- uses: actions/checkout@v4
@@ -24,9 +24,16 @@ jobs:
2424
run: |
2525
python -m pip install --upgrade pip
2626
python -m pip install ".[dev]"
27-
- name: Run pytest
27+
- name: Run pytest with coverage
2828
run: |
29-
python -m pytest -v --disable-warnings tests
29+
pytest -v --cov --cov-report=xml
30+
- name: codecov
31+
uses: codecov/[email protected]
32+
with:
33+
token: ${{ secrets.CODECOV_TOKEN }}
34+
name: infrasys-tests
35+
fail_ci_if_error: false
36+
verbose: true
3037
mypy:
3138
runs-on: ubuntu-latest
3239
name: "mypy"

.github/workflows/codecov.yml

-34
This file was deleted.

.github/workflows/pull_request_tests.yml

-41
This file was deleted.

README.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# infrasys
22

3-
[![Main - CI](https://github.com/NREL/infrasys/workflows/Main%20-%20CI/badge.svg)](https://github.com/NREL/infrasys/actions/workflows/main_tests.yml)
3+
[![CI](https://github.com/NREL/infrasys/workflows/CI/badge.svg)](https://github.com/NREL/infrasys/actions/workflows/ci.yml)
44
[![codecov](https://codecov.io/gh/NREL/infrasys/branch/main/graph/badge.svg)](https://codecov.io/gh/NREL/infrasys)
55

66
This package implements a data store for components and time series in support of Python-based
@@ -39,3 +39,10 @@ Please install `pre-commit` so that your code is checked before making commits.
3939
```
4040
$ pre-commit install
4141
```
42+
43+
## License
44+
infrasys is released under a BSD 3-Clause
45+
[License](https://github.com/NREL/infrasys/blob/main/LICENSE.txt).
46+
47+
infrasys was developed under software record SWR-24-42 at the National Renewable Energy Laboratory
48+
([NREL](https://www.nrel.gov)).

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Issues = "https://github.com/NREL/infrasys/issues"
5757
Source = "https://github.com/NREL/infrasys"
5858

5959
[tool.pytest.ini_options]
60+
pythonpath = "src"
6061
minversion = "6.0"
6162
addopts = "-ra"
6263
testpaths = [

0 commit comments

Comments
 (0)