Skip to content

Commit 1301959

Browse files
authored
fix: Add xml coverage generation and fix tics workflow (#193)
### Workflow updates: * [`.github/workflows/tics_run_sh_ghaction_test.yml`](diffhunk://#diff-594936f70c4be3041fe643be75996fd4d5d1c50675521239e0d7811b85790b90L10-R17): Updated the `runs-on` parameter to include `jammy` and `tiobe` labels for better compatibility with the target environment. * [`.github/workflows/tics_run_sh_ghaction_test.yml`](diffhunk://#diff-594936f70c4be3041fe643be75996fd4d5d1c50675521239e0d7811b85790b90L34-R35): Changed the folder name for coverage results from `.cover` to `cover`. ### Dependency installation: * [`.github/workflows/tics_run_sh_ghaction_test.yml`](diffhunk://#diff-594936f70c4be3041fe643be75996fd4d5d1c50675521239e0d7811b85790b90L10-R17): Modified the system dependencies installation command to install `python3-venv` instead of `python3.10-venv` for broader Python version support. ### Test coverage reporting: * [`tox.ini`](diffhunk://#diff-ef2cef9f88b4fe09ca3082140e67f5ad34fb65fb6e228f119d3812261ae51449R56): Added a command to generate an XML report for test coverage, enabling integration with external tools.
1 parent 0b93011 commit 1301959

4 files changed

Lines changed: 13 additions & 15 deletions

File tree

.github/actionlint.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
self-hosted-runner:
2+
labels:
3+
- self-hosted
4+
- linux
5+
- amd64
6+
- tiobe
7+
- jammy

.github/workflows/ci.yaml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,7 @@ on:
2020
jobs:
2121
lint:
2222
name: Lint
23-
runs-on: ubuntu-22.04
24-
timeout-minutes: 5
25-
steps:
26-
- name: Checkout
27-
uses: actions/checkout@v4
28-
- name: Install tox & poetry
29-
run: |
30-
pipx install tox
31-
pipx install poetry
32-
- name: Run linters
33-
run: tox run -e lint
23+
uses: canonical/data-platform-workflows/.github/workflows/lint.yaml@v32.1.0
3424

3525
lib-check:
3626
name: Check libraries

.github/workflows/tics_run_sh_ghaction_test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ on:
77

88
jobs:
99
build:
10-
runs-on: [self-hosted, linux, X64]
10+
runs-on: [self-hosted, linux, jammy, tiobe]
1111

1212
steps:
1313
- name: Checkout the project
1414
uses: actions/checkout@v4
1515

1616
- name: Install system dependencies
17-
run: sudo apt-get update && sudo apt-get install -y python3.10-venv
17+
run: sudo apt-get update && sudo apt-get install -y python3-venv
1818

1919
- name: Install pipx
2020
run: python3 -m pip install --user pipx && python3 -m pipx ensurepath
@@ -31,8 +31,8 @@ jobs:
3131

3232
- name: move results to necessary folder for TICS
3333
run: |
34-
mkdir .cover
35-
mv coverage.xml .cover/coverage.xml
34+
mkdir cover
35+
mv coverage.xml cover/coverage.xml
3636
- name: Run TICS analysis with github-action
3737
uses: tiobe/tics-github-action@v3
3838
with:

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ commands =
5353
poetry run coverage run --source={[vars]src_path} \
5454
-m pytest -v --tb native -s {posargs} {[vars]tests_path}/unit
5555
poetry run coverage report
56+
poetry run coverage xml
5657

5758
[testenv:integration]
5859
description = Run all integration tests

0 commit comments

Comments
 (0)