File tree Expand file tree Collapse file tree 4 files changed +142
-7
lines changed
Expand file tree Collapse file tree 4 files changed +142
-7
lines changed Original file line number Diff line number Diff line change 66 - main
77 pull_request :
88
9+
910jobs :
1011 test :
12+ name : Run tests and collect coverage
1113 runs-on : ubuntu-latest
1214 steps :
13- - uses : actions/checkout@v4
14- - uses : gardenlinux/python-gardenlinux-lib/.github/actions/setup@main
15+ - name : Checkout
16+ uses : actions/checkout@v4
17+ with :
18+ fetch-depth : 2
19+
20+ - name : Setup Gardenlinux
21+ uses : ./.github/actions/setup
22+
23+ - name : Install Poetry
24+ uses : snok/install-poetry@v1
25+
26+ - name : Install dependencies
27+ run : poetry install --with dev
28+
29+ - name : Prepare environment
30+ run : make install-test
31+
1532 - name : Run tests
16- run : |
33+ run : |
1734 export GLOCI_REGISTRY_TOKEN="invalid"
18- make test
35+ make test-coverage-ci
36+
37+ - name : Check for report
38+ run : test -f coverage.xml
39+
40+ - name : Upload results to Codecov
41+ uses : codecov/codecov-action@v5
42+ with :
43+ token : ${{ secrets.CODECOV_TOKEN }}
Original file line number Diff line number Diff line change @@ -46,6 +46,12 @@ install-test: install-dev
4646test : install-test
4747 $(POETRY ) run pytest -k " not kms"
4848
49+ test-coverage : install-test
50+ $(POETRY ) run pytest -k " not kms" --cov=gardenlinux --cov-report=xml tests/
51+
52+ test-coverage-ci : install-test
53+ $(POETRY ) run pytest -k " not kms" --cov=gardenlinux --cov-report=xml --cov-fail-under=50 tests/
54+
4955test-debug : install-test
5056 $(POETRY ) run pytest -k " not kms" -vvv -s
5157
Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ pygments = "^2.19.1"
2626bandit = " ^1.8.3"
2727black = " ^25.1.0"
2828moto = " ^5.1.9"
29+ pytest = " ^8.4.1"
30+ pytest-cov = " ^6.2.1"
2931
3032[tool .poetry .group .docs .dependencies ]
3133sphinx-rtd-theme = " ^3.0.2"
You can’t perform that action at this time.
0 commit comments