Skip to content

Commit 9700aa8

Browse files
committed
add tests cov workflow
1 parent abd2407 commit 9700aa8

File tree

2 files changed

+69
-37
lines changed

2 files changed

+69
-37
lines changed

.github/workflows/python-install-and-test-on-linux-always.yml

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,7 @@ on: [push]
44

55
jobs:
66
build:
7-
permissions:
8-
actions: read
9-
attestations: read
10-
checks: read
11-
contents: write
12-
deployments: read
13-
id-token: none
14-
issues: none
15-
discussions: none
16-
packages: read
17-
pages: read
18-
pull-requests: write
19-
security-events: read
20-
statuses: read
7+
permissions: read-all
218

229
runs-on: ubuntu-latest
2310
strategy:
@@ -42,26 +29,3 @@ jobs:
4229
- name: Generate Coverage Report
4330
run: |
4431
coverage report -m
45-
- name: Coverage Badge
46-
uses: tj-actions/coverage-badge-py@1788babcb24544eb5bbb6e0d374df5d1e54e670f # v2
47-
48-
- name: Verify Changed files
49-
uses: tj-actions/verify-changed-files@a1c6acee9df209257a246f2cc6ae8cb6581c1edf # v20
50-
id: verify-changed-files
51-
with:
52-
files: coverage.svg
53-
54-
- name: Commit files
55-
if: steps.verify-changed-files.outputs.files_changed == 'true'
56-
run: |
57-
git config --local user.email "github-actions[bot]@users.noreply.github.com"
58-
git config --local user.name "github-actions[bot]"
59-
git add coverage.svg
60-
git commit -m "Updated coverage.svg"
61-
62-
- name: Push changes
63-
if: steps.verify-changed-files.outputs.files_changed == 'true'
64-
uses: ad-m/github-push-action@master
65-
with:
66-
github_token: ${{ secrets.github_token }}
67-
branch: ${{ github.ref }}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Build tests coverage badge
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
permissions:
8+
actions: read
9+
attestations: read
10+
checks: read
11+
contents: write
12+
deployments: read
13+
id-token: none
14+
issues: none
15+
discussions: none
16+
packages: read
17+
pages: read
18+
pull-requests: write
19+
security-events: read
20+
statuses: read
21+
22+
runs-on: ubuntu-latest
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
python-version: ["3.12"]
27+
28+
steps:
29+
- uses: actions/checkout@v4
30+
- name: Set up Python ${{ matrix.python-version }}
31+
uses: actions/setup-python@v4
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
- name: Install dependencies
35+
run: |
36+
python -m pip install --upgrade pip
37+
pip install .
38+
pip install --group dev
39+
- name: Test with pytest
40+
run: |
41+
coverage run -m pytest -v -s
42+
- name: Generate Coverage Report
43+
run: |
44+
coverage report -m
45+
46+
- name: Coverage Badge
47+
uses: tj-actions/coverage-badge-py@1788babcb24544eb5bbb6e0d374df5d1e54e670f # v2
48+
49+
- name: Verify Changed files
50+
uses: tj-actions/verify-changed-files@a1c6acee9df209257a246f2cc6ae8cb6581c1edf # v20
51+
id: verify-changed-files
52+
with:
53+
files: coverage.svg
54+
55+
- name: Commit files
56+
if: steps.verify-changed-files.outputs.files_changed == 'true'
57+
run: |
58+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
59+
git config --local user.name "github-actions[bot]"
60+
git add coverage.svg
61+
git commit -m "Updated coverage.svg"
62+
63+
- name: Push changes
64+
if: steps.verify-changed-files.outputs.files_changed == 'true'
65+
uses: ad-m/github-push-action@master
66+
with:
67+
github_token: ${{ secrets.github_token }}
68+
branch: ${{ github.ref }}

0 commit comments

Comments
 (0)