Skip to content

Commit 833bb91

Browse files
authored
Upgrade python Workflows
I Upgrade python Workflows in main and push.
1 parent d65cbc6 commit 833bb91

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

.github/workflows/python.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
11
name: Python Checks
22

3-
on: [pull_request, push]
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened] # PR 有代码变化时运行
6+
push:
7+
branches:
8+
- main
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: true
413

514
jobs:
615
Test:
716
runs-on: ubuntu-latest
817
steps:
918
- name: Checkout repository
10-
uses: actions/checkout@v2
19+
uses: actions/checkout@v4
1120

1221
- name: Set up Python
13-
uses: actions/setup-python@v2
22+
uses: actions/setup-python@v5
1423
with:
1524
python-version: '3.13'
1625

1726
- name: Cache Python dependencies
18-
id: cache-pip
1927
uses: actions/cache@v3
2028
with:
2129
path: ~/.cache/pip
@@ -42,4 +50,4 @@ jobs:
4250
run: mypy . --ignore-missing-imports || true
4351

4452
- name: Run Pytest tests
45-
run: pytest
53+
run: pytest

0 commit comments

Comments
 (0)