Skip to content

Commit 4b918b8

Browse files
committed
chore(ci): add coverage comment to test workflow
1 parent 8c408eb commit 4b918b8

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

.github/workflows/tests.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,36 @@ name: Tests
33
on:
44
pull_request:
55
push:
6+
branches:
7+
- "main"
8+
workflow_call:
69

710
jobs:
811
tests:
912
name: Tests
1013
runs-on: ubuntu-latest
14+
permissions:
15+
# Gives the action the necessary permissions for publishing new
16+
# comments in pull requests.
17+
pull-requests: write
18+
# Gives the action the necessary permissions for pushing data to the
19+
# python-coverage-comment-action branch, and for editing existing
20+
# comments (to avoid publishing multiple comments in the same PR)
21+
contents: write
22+
1123
strategy:
1224
matrix:
13-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
25+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
1426

1527
steps:
16-
- uses: actions/checkout@v3
28+
- uses: actions/checkout@v4
1729

1830
- name: Set up Python ${{ matrix.python-version }}
1931
uses: actions/setup-python@v4
2032
with:
2133
python-version: ${{ matrix.python-version }}
34+
cache: pip
35+
cache-dependency-path: "**/pyproject.toml"
2236

2337
- name: Install dependencies
2438
run: |
@@ -27,3 +41,11 @@ jobs:
2741
2842
- name: Run tests
2943
run: ./tests/run.sh
44+
45+
- name: Coverage comment
46+
uses: py-cov-action/python-coverage-comment-action@v3
47+
if: github.event_name != 'workflow_call' && matrix.version == '3.11'
48+
with:
49+
GITHUB_TOKEN: ${{ github.token }}
50+
MINIMUM_GREEN: 90
51+
MINIMUM_ORANGE: 80

0 commit comments

Comments
 (0)