Skip to content

Commit 5956940

Browse files
authored
👷 Move from Codecov to Smokeshow (#486)
1 parent ea79c47 commit 5956940

File tree

7 files changed

+79
-16
lines changed

7 files changed

+79
-16
lines changed

.github/workflows/smokeshow.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Smokeshow
2+
3+
on:
4+
workflow_run:
5+
workflows: [Test]
6+
types: [completed]
7+
8+
permissions:
9+
statuses: write
10+
11+
jobs:
12+
smokeshow:
13+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/setup-python@v4
18+
with:
19+
python-version: '3.9'
20+
21+
- run: pip install smokeshow
22+
23+
- uses: dawidd6/action-download-artifact@v2
24+
with:
25+
workflow: test.yml
26+
commit: ${{ github.event.workflow_run.head_sha }}
27+
28+
- run: smokeshow upload coverage-html
29+
env:
30+
SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage}
31+
SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 100
32+
SMOKESHOW_GITHUB_CONTEXT: coverage
33+
SMOKESHOW_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
SMOKESHOW_GITHUB_PR_HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
35+
SMOKESHOW_AUTH_KEY: ${{ secrets.SMOKESHOW_AUTH_KEY }}

.github/workflows/test.yml

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,43 @@ jobs:
5656
- name: Lint
5757
if: ${{ matrix.python-version != '3.6.15' }}
5858
run: python -m poetry run bash scripts/lint.sh
59+
- run: mkdir coverage
5960
- name: Test
6061
run: python -m poetry run bash scripts/test.sh
61-
- name: Upload coverage
62-
uses: codecov/codecov-action@v3
62+
env:
63+
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}
64+
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}
65+
- name: Store coverage files
66+
uses: actions/upload-artifact@v3
67+
with:
68+
name: coverage
69+
path: coverage
70+
coverage-combine:
71+
needs: [test]
72+
runs-on: ubuntu-latest
73+
74+
steps:
75+
- uses: actions/checkout@v3
76+
77+
- uses: actions/setup-python@v4
78+
with:
79+
python-version: '3.8'
80+
81+
- name: Get coverage files
82+
uses: actions/download-artifact@v3
83+
with:
84+
name: coverage
85+
path: coverage
86+
87+
- run: pip install coverage[toml]
88+
89+
- run: ls -la coverage
90+
- run: coverage combine coverage
91+
- run: coverage report
92+
- run: coverage html --show-contexts --title "Coverage for ${{ github.sha }}"
93+
94+
- name: Store coverage HTML
95+
uses: actions/upload-artifact@v3
96+
with:
97+
name: coverage-html
98+
path: htmlcov

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111
<a href="https://github.com/tiangolo/sqlmodel/actions?query=workflow%3APublish" target="_blank">
1212
<img src="https://github.com/tiangolo/sqlmodel/workflows/Publish/badge.svg" alt="Publish">
1313
</a>
14-
<a href="https://codecov.io/gh/tiangolo/sqlmodel" target="_blank">
15-
<img src="https://img.shields.io/codecov/c/github/tiangolo/sqlmodel?color=%2334D058" alt="Coverage">
16-
</a>
14+
<a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/tiangolo/sqlmodel" target="_blank">
15+
<img src="https://coverage-badge.samuelcolvin.workers.dev/tiangolo/sqlmodel.svg" alt="Coverage">
1716
<a href="https://pypi.org/project/sqlmodel" target="_blank">
1817
<img src="https://img.shields.io/pypi/v/sqlmodel?color=%2334D058&label=pypi%20package" alt="Package version">
1918
</a>

docs/index.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111
<a href="https://github.com/tiangolo/sqlmodel/actions?query=workflow%3APublish" target="_blank">
1212
<img src="https://github.com/tiangolo/sqlmodel/workflows/Publish/badge.svg" alt="Publish">
1313
</a>
14-
<a href="https://codecov.io/gh/tiangolo/sqlmodel" target="_blank">
15-
<img src="https://img.shields.io/codecov/c/github/tiangolo/sqlmodel?color=%2334D058" alt="Coverage">
16-
</a>
14+
<a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/tiangolo/sqlmodel" target="_blank">
15+
<img src="https://coverage-badge.samuelcolvin.workers.dev/tiangolo/sqlmodel.svg" alt="Coverage">
1716
<a href="https://pypi.org/project/sqlmodel" target="_blank">
1817
<img src="https://img.shields.io/pypi/v/sqlmodel?color=%2334D058&label=pypi%20package" alt="Package version">
1918
</a>

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ source = [
6767
"tests",
6868
"sqlmodel"
6969
]
70+
context = '${CONTEXT}'
7071

7172
[tool.coverage.report]
7273
exclude_lines = [

scripts/test-cov-html.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

scripts/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ set -x
66
coverage run -m pytest tests
77
coverage combine
88
coverage report --show-missing
9-
coverage xml
9+
coverage html

0 commit comments

Comments
 (0)