Skip to content

Commit 62f4ec3

Browse files
authored
Coveralls (#95)
* add relative_file option in pyproject.toml for coverage * add steps in ci.yml * move coverage config from pyproject.toml to .coveragerc because I can't figure out how to get coverage to read toml * add coverage badge
1 parent a58d2bf commit 62f4ec3

File tree

4 files changed

+34
-11
lines changed

4 files changed

+34
-11
lines changed

.coveragerc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[run]
2+
omit = tests/*
3+
relative_files = True

.github/workflows/ci.yml

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
name: CI
22

3-
on: pull_request
3+
on:
4+
pull_request:
5+
paths-ignore:
6+
- "docs/**"
7+
- "*.md"
48

59
jobs:
6-
build:
7-
10+
test:
811
runs-on: ubuntu-latest
912
strategy:
1013
matrix:
1114
python-version: ["3.7", "3.8", "3.9", "3.10"] # , "3.11.0-beta.1"]
1215

1316
steps:
14-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v3
1518

1619
- name: Set up Python ${{ matrix.python-version }}
1720
uses: actions/setup-python@v2
@@ -43,3 +46,22 @@ jobs:
4346
- name: Run all tests and linting
4447
run: |
4548
make test
49+
50+
- name: Publish coverage to Coveralls
51+
uses: AndreMiras/coveralls-python-action@v20201129
52+
with:
53+
github-token: ${{ secrets.GITHUB_TOKEN }}
54+
parallel: true
55+
flag-name: py${{ matrix.python-version }}
56+
debug: true
57+
58+
coveralls-finish:
59+
needs: test
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@v3
63+
- name: Coveralls finished
64+
uses: AndreMiras/coveralls-python-action@v20201129
65+
with:
66+
parallel-finished: true
67+
debug: true

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# sqlean
22

33
<p align="center">
4-
<a href="https://www.python.org/"><img alt="Python versions: 3.7, 3.8, 3.9, 3.10" src="https://img.shields.io/badge/python-3.7%20%7C%203.8%20%7C%203.9%20%7C%203.10-blue"></a>
5-
<a href="https://pypi.org/project/sqlean/"><img alt="PyPI" src="https://img.shields.io/pypi/v/sqlean"></a>
6-
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
7-
<a href="https://github.com/oliverxchen/sqlean/blob/main/LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-A31F34"></a>
4+
<a href='https://coveralls.io/github/oliverxchen/sqlean'><img src='https://coveralls.io/repos/github/oliverxchen/sqlean/badge.svg' alt='Coverage Status' /></a>
5+
<a href="https://www.python.org/"><img alt="Python versions: 3.7, 3.8, 3.9, 3.10" src="https://img.shields.io/badge/python-3.7%20%7C%203.8%20%7C%203.9%20%7C%203.10-blue"></a>
6+
<a href="https://pypi.org/project/sqlean/"><img alt="PyPI" src="https://img.shields.io/pypi/v/sqlean"></a>
7+
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
8+
<a href="https://github.com/oliverxchen/sqlean/blob/main/LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-A31F34"></a>
89
</p>
910

1011
sqlean is a Python CLI to clean your SQL queries. It aspires to be the

pyproject.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ markers = ["generate_snapshots"]
4545
strict = "True"
4646
warn_unused_ignores = "False"
4747

48-
[tool.coverage.run]
49-
omit = ["tests/*", "sqlean/parsetab.py"]
50-
5148
[tool.pylint.master]
5249
ignore-paths = "tests/"
5350
min-public-methods = 1

0 commit comments

Comments
 (0)