Skip to content

Commit ac2e5dd

Browse files
fix(DATAGO-120218): use uv for test execution where possible (#61)
* update * fix(DATAGO-120218): use uv for test execution where possible * pin uv install and fix hatch coverage run * update
1 parent 93861b2 commit ac2e5dd

File tree

1 file changed

+10
-18
lines changed

1 file changed

+10
-18
lines changed

.github/workflows/hatch_ci.yml

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -156,23 +156,17 @@ jobs:
156156
python-version: ${{ matrix.python-version }}
157157

158158
- name: Install uv
159-
uses: astral-sh/setup-uv@38f3f104447c67c051c4a08e39b64a148898af3a # v4.2.0
160-
with:
161-
enable-cache: true
162-
159+
id: setup-uv
160+
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
163161
- name: Install Hatch
164162
run: uv tool install hatch
163+
- name: Create Hatch Environment
164+
run: hatch -v env create hatch-test.py${{ matrix.python-version }}
165165

166-
- name: Run Tests with Coverage
167-
continue-on-error: true
168-
run: |
169-
hatch -v test --cover --junitxml=junit-${{ matrix.python-version }}.xml --cov-report=xml
170-
171-
- name: Combine Coverage Reports
166+
- name: Run Tests with Hatch
172167
continue-on-error: true
173168
run: |
174-
hatch -e hatch-test.py${{ matrix.python-version }} run coverage xml
175-
shell: bash
169+
hatch -v run hatch-test.py${{ matrix.python-version }}:pytest tests/ --cov --cov-report=xml:coverage.xml --cov-report=term --junitxml=junit-${{ matrix.python-version }}.xml
176170
177171
- name: Upload Test Results
178172
uses: mikepenz/action-junit-report@3585e9575db828022551b4231f165eb59a0e74e3 # v5.6.2
@@ -250,8 +244,6 @@ jobs:
250244

251245
- name: Install uv
252246
uses: astral-sh/setup-uv@38f3f104447c67c051c4a08e39b64a148898af3a # v4.2.0
253-
with:
254-
enable-cache: true
255247

256248
- name: Install Hatch
257249
run: uv tool install hatch
@@ -523,7 +515,7 @@ jobs:
523515
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
524516
with:
525517
fetch-depth: 0
526-
518+
527519
- name: Setup Python for Build
528520
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
529521
with:
@@ -565,9 +557,9 @@ jobs:
565557
name: dependency-tree
566558
path: dependency-tree.txt
567559
# SCA (Software Composition Analysis) Scan Step
568-
#
560+
#
569561
# Performs security scanning using FOSSA to analyze dependencies and enforce license policies.
570-
#
562+
#
571563
# Key Parameters:
572564
# - fossa.branch: Dynamically set based on event type
573565
# * For pull requests: Set to 'PR' to enable FOSSA's PR-specific analysis features
@@ -595,7 +587,7 @@ jobs:
595587
fossa.branch=${{ github.event.pull_request.number && 'PR' || github.event.repository.default_branch }}
596588
fossa.revision=${{ github.event.pull_request.number && github.head_ref || github.sha }}
597589
fossa_api_key: ${{ secrets.FOSSA_API_KEY }}
598-
590+
599591
- name: FOSSA Guard - Block on Policy Violations
600592
uses: SolaceDev/solace-public-workflows/.github/actions/fossa-guard@main
601593
continue-on-error: true

0 commit comments

Comments
 (0)