Skip to content

Commit c3172fc

Browse files
committed
test: add test and codecov for every commit (prev. only when deploy)
1 parent ad816e4 commit c3172fc

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

.github/workflows/tests.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Tests
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
build-linux:
11+
runs-on: ${{ matrix.platform.runner }}
12+
strategy:
13+
matrix:
14+
platform:
15+
- runner: ubuntu-24.04
16+
target: manylinux_2_17_x86_64.manylinux2014_x86_64
17+
python-version: ['3.10']
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Install dependencies
21+
run: |
22+
pip install uv --user --break-system-packages
23+
uv tool install build
24+
uv tool install wheel
25+
- name: Build app
26+
run: |
27+
bash build_reduce_linux.sh v4.14
28+
- name: Build python wheel
29+
run: |
30+
bash build_python.sh 4.14.0.2 ${{ matrix.platform.target }}
31+
- uses: actions/setup-python@v5
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
- name: Setup python environment
35+
run: |
36+
uv venv
37+
source .venv/bin/activate
38+
uv pip install -r requirements_test.txt
39+
uv pip install build_python/dist/*.whl
40+
- name: Run pytest
41+
uses: deargen/workflows/actions/run-pytest@master
42+
with:
43+
additional-args: --cov-report=xml --cov-report=term
44+
- name: Upload results to Codecov
45+
uses: codecov/codecov-action@v4
46+
with:
47+
token: ${{ secrets.CODECOV_TOKEN }}

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
[![PyPI - Downloads](https://img.shields.io/pypi/dm/reduce-binary)](https://pypistats.org/packages/reduce-binary)
77
[![image](https://img.shields.io/pypi/l/reduce-binary.svg)](https://pypi.python.org/pypi/reduce-binary)
88
[![image](https://img.shields.io/pypi/pyversions/reduce-binary.svg)](https://pypi.python.org/pypi/reduce-binary)
9-
9+
[![Actions status](https://github.com/deargen/py-reduce-binary/workflows/Tests/badge.svg)](https://github.com/deargen/py-reduce-binary/actions)
10+
[![codecov](https://codecov.io/github/deargen/py-reduce-binary/graph/badge.svg?token=S9MD6B44J6)](https://codecov.io/github/deargen/py-reduce-binary)
1011

1112
Install and use [reduce](https://github.com/rlabduke/reduce) with ease in Python.
1213

0 commit comments

Comments
 (0)