Skip to content

Commit 6167374

Browse files
committed
Update coverage workflow
Update coverage workflow to be similar structure to other workflows. Fix lint error with dynamic version file. Fix unit test run error. Signed-off-by: Martin Hickey <[email protected]>
1 parent c4e8c9d commit 6167374

File tree

5 files changed

+77
-25
lines changed

5 files changed

+77
-25
lines changed

.github/workflows/coverage.yaml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/coverage.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Coverage
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
- "release-**"
8+
paths:
9+
- '**.py'
10+
- 'pyproject.toml'
11+
- 'tox.ini'
12+
- '.github/workflows/coverage.yml' # This workflow
13+
pull_request:
14+
branches:
15+
- "main"
16+
- "release-**"
17+
paths:
18+
- '**.py'
19+
- 'pyproject.toml'
20+
- 'tox.ini'
21+
- '.github/workflows/coverage.yml' # This workflow
22+
23+
env:
24+
LC_ALL: en_US.UTF-8
25+
26+
defaults:
27+
run:
28+
shell: bash
29+
30+
permissions:
31+
contents: read
32+
33+
jobs:
34+
coverage:
35+
runs-on: ubuntu-latest
36+
name: "coverage: ${{ matrix.coverage.name }}"
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
coverage:
41+
- name: "coverage"
42+
commands: |
43+
tox -e coverage
44+
45+
steps:
46+
- name: "Harden Runner"
47+
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
48+
with:
49+
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
50+
51+
- name: "Checkout"
52+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
53+
with:
54+
# https://github.com/actions/checkout/issues/249
55+
fetch-depth: 0
56+
57+
- name: Setup Python 3.11
58+
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
59+
with:
60+
python-version: 3.11
61+
cache: pip
62+
cache-dependency-path: |
63+
**/pyproject.toml
64+
65+
- name: "Install tox"
66+
run: |
67+
python -m pip install --upgrade pip
68+
python -m pip install tox tox-gh
69+
70+
- name: "${{ matrix.coverage.name }}"
71+
run: |
72+
${{ matrix.coverage.commands }}

.isort.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ import_heading_firstparty=First Party
88
import_heading_localfolder=Local
99
known_firstparty=
1010
known_localfolder=fms_mo,tests
11+
extend_skip=fms_mo/_version.py

.pylintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,8 @@ disable=raw-checker-failed,
454454
pointless-statement,
455455
wrong-import-order,
456456
duplicate-code,
457-
unbalanced-tuple-unpacking
457+
unbalanced-tuple-unpacking,
458+
missing-module-docstring,
458459

459460
# Enable the message, report, category or checker with the given id(s). You can
460461
# either give multiple identifier separated by comma (,) or put this option

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = lint, fmt
2+
envlist = py, lint, fmt
33
minversion = 4.4
44

55
[testenv]
@@ -11,7 +11,7 @@ wheel_build_env = pkg
1111
deps =
1212
pytest
1313
commands =
14-
unit: {envpython} -m pytest {posargs:tests}
14+
pytest {posargs:tests}
1515

1616
[testenv:lint]
1717
description = lint with pylint

0 commit comments

Comments
 (0)