Skip to content

Commit a0dd5f0

Browse files
2 parents 7da7249 + b2e1305 commit a0dd5f0

File tree

2 files changed

+67
-1
lines changed

2 files changed

+67
-1
lines changed

.github/workflows/run-tests.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Run Unit Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
test:
10+
name: Run Tests with pytest
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0 # Needed for setuptools_scm to determine version from git tags
18+
19+
- name: Set up Python 3.11
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.11'
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install setuptools setuptools_scm wheel pytest pytest-cov pytest-mock
28+
pip install .[dev]
29+
30+
- name: Run tests with coverage and generate reports
31+
run: |
32+
pytest --cov=rune.runtime --cov-report=term-missing --cov-report=xml:coverage.xml --junitxml=test-results.xml
33+
34+
#- name: Debug - List files after pytest
35+
# run: |
36+
# pwd
37+
# ls -la
38+
39+
- name: Upload coverage report
40+
uses: actions/upload-artifact@v4
41+
if: always()
42+
with:
43+
name: coverage-report
44+
path: coverage.xml
45+
46+
- name: Upload test results
47+
uses: actions/upload-artifact@v4
48+
if: always()
49+
with:
50+
name: pytest-results
51+
path: test-results.xml
52+
53+
- name: Publish Test Results
54+
uses: EnricoMi/publish-unit-test-result-action@v2
55+
if: always() # Run even if tests fail
56+
with:
57+
files: test-results.xml
58+
59+
# disabled for now as codecov appears not to be working with xml reports
60+
#- name: Upload coverage to Codecov
61+
# uses: codecov/codecov-action@v4
62+
# with:
63+
# files: coverage.xml
64+
# fail_ci_if_error: true
65+
# verbose: true

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[![FINOS - Incubating](https://cdn.jsdelivr.net/gh/finos/contrib-toolbox@master/images/badge-incubating.svg)](https://community.finos.org/docs/governance/Software-Projects/stages/incubating)
2+
[![Run Unit Tests](https://github.com/Cloudrisk/rune-python-runtime/actions/workflows/run-tests.yml/badge.svg?branch=main)](https://github.com/Cloudrisk/rune-python-runtime/actions/workflows/run-tests.yml)
23

34
# Rune Python Runtime
45

@@ -80,4 +81,4 @@ Copyright 2025 CLOUDRISK Limited and FT Advisory LLC
8081

8182
Distributed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).
8283

83-
SPDX-License-Identifier: [Apache-2.0](https://spdx.org/licenses/Apache-2.0)
84+
SPDX-License-Identifier: [Apache-2.0](https://spdx.org/licenses/Apache-2.0)

0 commit comments

Comments
 (0)