Skip to content

Commit 5256c30

Browse files
committed
ci(cli): continuous testing.
1 parent 24fe87b commit 5256c30

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

.github/workflows/test_and_cov.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Test and Coverage
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
test:
13+
strategy:
14+
matrix:
15+
python-version: [3.11, 3.12, 3.13]
16+
os: [ubuntu-latest, macos-latest, macos-14]
17+
runs-on: ${{ matrix.os }}
18+
env:
19+
COREDUMPY_DUMP_DIR: ${{ github.workspace }}/coredumpy_data
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: setup pdm
24+
uses: pdm-project/setup-pdm@v4
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
28+
- name: install pdm and dependencies
29+
if: matrix.os != 'macos-14'
30+
run: |
31+
pdm lock --group dev --group lsp --group mcp
32+
pdm install
33+
34+
- name: install pdm and dependencies for legacy system
35+
if: matrix.os == 'macos-14'
36+
run: |
37+
pdm lock --group dev --group lsp --group mcp --group legacy
38+
pdm install
39+
40+
- name: run tests
41+
run: pdm run pytest --enable-coredumpy --coredumpy-dir ${{ env.COREDUMPY_DUMP_DIR }}
42+
43+
- name: run coverage
44+
run: |
45+
pdm run coverage run -m pytest
46+
pdm run coverage report -m
47+
pdm run coverage xml -i
48+
49+
- name: upload coverage reports to codecov
50+
uses: codecov/codecov-action@v5
51+
with:
52+
token: ${{ secrets.codecov_token }}
53+
54+
- name: Upload coredumpy data if applicable
55+
uses: gaogaotiantian/[email protected]
56+
if: failure()
57+
with:
58+
name: coredumpy_data_${{ matrix.os }}_${{ matrix.python-version }}
59+
path: ${{ env.COREDUMPY_DUMP_DIR }}
60+
retention-days: 7

0 commit comments

Comments
 (0)