Skip to content

Commit 0b1a9e7

Browse files
authored
setup codecov (#286)
* add ci * job level env * fix ci * if prev step didn't run then * publish to codecov * increase timeout * increase timeout * only run when on main * add badge
1 parent 1fefe16 commit 0b1a9e7

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,17 @@ on:
1717
jobs:
1818
run:
1919
runs-on: ${{ matrix.os }}
20-
timeout-minutes: 10
20+
timeout-minutes: 25
21+
22+
env:
23+
RESONATE_HOST: http://localhost
2124

2225
strategy:
2326
fail-fast: true
2427
matrix:
2528
os: [ubuntu-latest, macos-latest]
26-
python-version: ["3.12", "3.13"]
27-
server-version: ["main", "latest"]
29+
python-version: [3.12, 3.13]
30+
server-version: [main, latest]
2831

2932
steps:
3033
- uses: actions/checkout@v4
@@ -77,8 +80,17 @@ jobs:
7780
run: ./resonate serve --system-signal-timeout 0.1s &
7881
working-directory: server
7982

80-
- name: run tests
81-
env:
82-
RESONATE_HOST: http://localhost
83+
- name: run tests with coverage
84+
id: coverage
85+
if: ${{ matrix.server-version == 'latest' && matrix.python-version == '3.13' && matrix.os == 'ubuntu-latest' && github.ref == 'refs/heads/main' }}
86+
run: uv run pytest --cov --cov-branch --cov-report=xml
8387

88+
- name: Upload coverage reports to Codecov
89+
if: ${{ steps.coverage.outcome != 'skipped' }}
90+
uses: codecov/codecov-action@v5
91+
with:
92+
token: ${{ secrets.CODECOV_TOKEN }}
93+
94+
- name: run tests
95+
if: ${{ steps.coverage.outcome == 'skipped' }}
8496
run: uv run pytest

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<div align="center">
88

99
[![ci](https://github.com/resonatehq/resonate-sdk-py/actions/workflows/ci.yml/badge.svg)](https://github.com/resonatehq/resonate-sdk-py/actions/workflows/ci.yml)
10+
[![codecov](https://codecov.io/gh/resonatehq/resonate-sdk-py/graph/badge.svg?token=61GYC3DXID)](https://codecov.io/gh/resonatehq/resonate-sdk-py)
1011
[![dst](https://github.com/resonatehq/resonate-sdk-py/actions/workflows/dst.yml/badge.svg)](https://github.com/resonatehq/resonate-sdk-py/actions/workflows/dst.yml)
1112
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
1213

0 commit comments

Comments
 (0)