Skip to content

Commit cc0e83e

Browse files
committed
Run github action test, add badges in Readme
1 parent 0128b40 commit cc0e83e

3 files changed

Lines changed: 71 additions & 0 deletions

File tree

.github/workflows/tests.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Run Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
- dev
9+
- develop
10+
pull_request:
11+
branches:
12+
- main
13+
- master
14+
- dev
15+
- develop
16+
17+
jobs:
18+
test:
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
22+
23+
services:
24+
postgres:
25+
image: postgres:latest
26+
env:
27+
POSTGRES_HOST_AUTH_METHOD: trust
28+
ports:
29+
- 5432:5432
30+
options: >-
31+
--health-cmd pg_isready
32+
--health-interval 10s
33+
--health-timeout 5s
34+
--health-retries 5
35+
36+
steps:
37+
- name: Checkout code
38+
uses: actions/checkout@v4
39+
40+
- name: Set up Python
41+
uses: actions/setup-python@v5
42+
with:
43+
python-version: '3.10'
44+
45+
- name: Install dependencies
46+
run: |
47+
python -m pip install --upgrade pip
48+
pip install -r requirements.txt
49+
pip install -e .
50+
51+
- name: Run tests with coverage
52+
env:
53+
PGUSER: postgres
54+
run: |
55+
pytest --cov=certapi --cov-report=xml --junitxml=junit.xml -o junit_family=legacy
56+
57+
- name: Upload coverage reports to Codecov
58+
uses: codecov/codecov-action@v5
59+
with:
60+
token: ${{ secrets.CODECOV_TOKEN }}
61+
62+
- name: Upload test results to Codecov
63+
if: ${{ !cancelled() }}
64+
uses: codecov/test-results-action@v1
65+
with:
66+
token: ${{ secrets.CODECOV_TOKEN }}

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
CertApi is a Python package for requesting SSL certificates from ACME.
44
This is to be used as a base library for building other tools, or to integrate Certificate creation feature in you app.
55

6+
[![Build Status](https://github.com/mesudip/certapi/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/mesudip/certapi/actions/workflows/tests.yml)
7+
[![codecov](https://codecov.io/github/mesudip/certapi/graph/badge.svg?token=NYTNCH29IT)](https://codecov.io/github/mesudip/certapi)
8+
[![PyPI version](https://img.shields.io/pypi/v/certapi.svg)](https://pypi.org/project/certapi/)
9+
610

711
For a detailed list of changes, please refer to the [CHANGELOG.md](CHANGELOG.md).
812

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ gunicorn
1212
## Requirements for test and dev
1313
pytest
1414
pytest-dotenv
15+
pytest-cov
1516
black

0 commit comments

Comments
 (0)