Skip to content

Commit 2a3b990

Browse files
CoderDeltaLANCoderDeltaLAN
andauthored
ci: restore linux job names and set PYTHONPATH=src (keep windows optional) (#6)
* fix: apply ruff/black; remove unused import to keep lint green * ci: restore linux job names and set PYTHONPATH=src (keep windows optional) * ci: retrigger on new base * fix: remove unused import and format code to keep lint green (#7) * fix: remove unused import and format code to keep lint green * ci: retrigger on new base (CI fixed branch) --------- Co-authored-by: CoderDeltaLAN <[email protected]> * fix: remove unused import and format code to keep main green (#8) * fix: remove unused import and format code to keep main green * ci: retrigger on fixed CI base --------- Co-authored-by: CoderDeltaLAN <[email protected]> * fix: remove unused import and format code to keep main green (#9) Co-authored-by: CoderDeltaLAN <[email protected]> --------- Co-authored-by: CoderDeltaLAN <[email protected]>
1 parent 2640e04 commit 2a3b990

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ concurrency:
1313
cancel-in-progress: true
1414

1515
jobs:
16-
python:
17-
if: ${{ (github.event_name == 'push' && startsWith(github.ref,'refs/heads/main')) || (github.event_name == 'pull_request' && github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name,'ready')) }}
16+
linux:
17+
name: linux (py=${{ matrix.python-version }})
1818
runs-on: ubuntu-latest
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
python-version: ['3.11','3.12']
22+
python-version: ["3.11","3.12"]
23+
env:
24+
PYTHONPATH: src
2325
steps:
2426
- uses: actions/checkout@v4
2527
- uses: actions/setup-python@v5
@@ -31,3 +33,21 @@ jobs:
3133
- run: black --check .
3234
- run: pytest -q
3335
- run: mypy .
36+
37+
windows_optional:
38+
name: windows (optional)
39+
runs-on: windows-latest
40+
continue-on-error: true
41+
env:
42+
PYTHONPATH: src
43+
steps:
44+
- uses: actions/checkout@v4
45+
- uses: actions/setup-python@v5
46+
with:
47+
python-version: "3.12"
48+
- run: python -m pip install -U pip
49+
- run: pip install ruff black pytest mypy
50+
- run: ruff check .
51+
- run: black --check .
52+
- run: pytest -q
53+
- run: mypy .

src/commit_guardian/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
__all__ = ["ping", "__version__"]
22
__version__ = "0.1.0"
33

4+
45
def ping() -> str:
56
return "pong"

src/commit_guardian/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from __future__ import annotations
2-
import sys
32
import click
43
from . import __version__, ping
54

5+
66
@click.command()
77
@click.option("--version", is_flag=True, help="Show version and exit.")
88
def main(version: bool) -> None:
@@ -12,5 +12,6 @@ def main(version: bool) -> None:
1212
click.echo(ping())
1313
raise SystemExit(0)
1414

15+
1516
if __name__ == "__main__":
1617
main()

tests/test_sanity.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import commit_guardian as cg
22

3+
34
def test_ping() -> None:
45
assert cg.ping() == "pong"

0 commit comments

Comments
 (0)