1- name : Unit Tests For Development
1+ name : CI Pipeline
22
33on :
44 workflow_dispatch :
1010 - main
1111
1212jobs :
13+ codestyle :
14+ name : ruff codestyle check/linting
15+ runs-on : ubuntu-latest
16+ continue-on-error : true
17+
18+ steps :
19+ - name : checkout code
20+ uses : actions/checkout@v4
21+
22+ - name : set up python 3.11
23+ uses : actions/setup-python@v3
24+ with :
25+ python-version : 3.11
26+
27+ - name : install ruff
28+ run : pip install ruff
29+
30+ - name : run ruff linter
31+ run : ruff check hololinked
32+
1333 test :
1434 strategy :
1535 matrix :
@@ -32,57 +52,57 @@ jobs:
3252 runs-on : ${{ matrix.os }}
3353
3454 steps :
35- - name : Checkout code
55+ - name : checkout code
3656 uses : actions/checkout@v4
3757
38- - name : Set up Python ${{ matrix.python-version }}
58+ - name : set up python ${{ matrix.python-version }}
3959 uses : actions/setup-python@v3
4060 with :
4161 python-version : ${{ matrix.python-version }}
4262
43- - name : Install uv (Linux /macOS)
63+ - name : install uv (linux /macOS)
4464 if : runner.os != 'Windows'
4565 run : curl -LsSf https://astral.sh/uv/install.sh | sh
4666
47- - name : Install uv (Windows )
67+ - name : install uv (windows )
4868 if : runner.os == 'Windows'
4969 run : |
5070 python -m pip install uv
5171
52- - name : Install dependencies (Linux /macOS)
72+ - name : install dependencies (linux /macOS)
5373 if : runner.os != 'Windows'
5474 run : |
5575 uv venv .venv
5676 source .venv/bin/activate
5777 uv sync --no-install-project --group test --group dev
5878
59- - name : Install dependencies (Windows )
79+ - name : install dependencies (windows )
6080 if : runner.os == 'Windows'
6181 run : |
6282 uv venv .venv
6383 .venv\Scripts\activate
6484 uv sync --no-install-project --group test --group dev
6585
66- - name : Run unit tests (Linux /macOS)
86+ - name : run unit tests (linux /macOS)
6787 if : runner.os != 'Windows' && matrix.python-version != 3.13
6888 run : |
6989 source .venv/bin/activate
7090 uv run coverage run -m unittest discover -s tests -p 'test_*.py'
7191
72- - name : Run unit tests and generate coverage report (Linux/macOS python 3.13)
92+ - name : run unit tests (Windows)
93+ if : runner.os == 'Windows'
94+ run : |
95+ .venv\Scripts\activate
96+ uv run coverage run -m unittest discover -s tests -p "test_*.py"
97+
98+ - name : run unit tests and generate coverage report (linux/macOS python 3.13)
7399 if : runner.os != 'Windows' && matrix.python-version == 3.13
74100 run : |
75101 source .venv/bin/activate
76102 uv run coverage run -m unittest discover -s tests -p 'test_*.py'
77103 uv run coverage xml -o coverage.xml
78104
79- - name : Run unit tests (Windows)
80- if : runner.os == 'Windows'
81- run : |
82- .venv\Scripts\activate
83- uv run coverage run -m unittest discover -s tests -p "test_*.py"
84-
85- - name : Upload coverage report as artifact
105+ - name : upload coverage report as artifact
86106 uses : actions/upload-artifact@v4
87107 if : runner.os != 'Windows' && matrix.python-version == 3.13
88108 with :
@@ -91,23 +111,23 @@ jobs:
91111 if-no-files-found : warn
92112
93113 publish_coverage :
94- name : Publish coverage (Ubuntu Python 3.13)
114+ name : publish coverage
95115 needs : test
96116 runs-on : ubuntu-latest
97117 if : github.ref == 'refs/heads/main'
98118 steps :
99- - name : Checkout code
119+ - name : checkout code
100120 uses : actions/checkout@v4
101121
102- - name : Download Ubuntu 3.13 coverage artifact
122+ - name : download coverage artifact
103123 id : dl
104124 uses : actions/download-artifact@v4
105125 with :
106126 name : coverage-report-ubuntu-latest-py3.13
107127 path : .
108128 continue-on-error : true
109129
110- - name : Upload coverage to Codecov
130+ - name : upload coverage to codecov
111131 if : steps.dl.outcome == 'success'
112132 uses : codecov/codecov-action@v4
113133 env :
@@ -118,30 +138,6 @@ jobs:
118138 fail_ci_if_error : true
119139 slug : hololinked-dev/hololinked
120140
121- - name : Skip note (no Ubuntu 3.13 artifact found)
141+ - name : skip note (no artifact found)
122142 if : steps.dl.outcome != 'success'
123- run : echo "No Ubuntu 3.13 coverage artifact present; skipping Codecov upload."
124-
125- publish_package :
126- name : Publish package to Test PyPI
127- runs-on : ubuntu-latest
128- needs : test
129- if : github.event_name == 'workflow_dispatch'
130- permissions :
131- id-token : write # IMPORTANT: mandatory for trusted publishing
132- steps :
133- - uses : actions/checkout@v4
134- - name : Set up Python
135- uses : actions/setup-python@v3
136- with :
137- python-version : 3.11
138- - name : Install uv
139- run : curl -LsSf https://astral.sh/uv/install.sh | sh
140- - name : Build package
141- run : uv build
142- - name : Publish package
143- uses : pypa/gh-action-pypi-publish@release/v1
144- with :
145- user : __token__
146- password : ${{ secrets.TEST_PYPI_API_TOKEN }}
147- repository-url : https://test.pypi.org/legacy/
143+ run : echo "No coverage artifact present; skipping codecov upload."
0 commit comments