Skip to content

Commit 100d90b

Browse files
committed
Improve GitHub Action
* Set timeout-minutes ti 15min * Add on.push.path on.pull_request.path * Raise Python 3.7 -> 3.8 * Use cache for actions/setup-python@v3
1 parent fe28d2a commit 100d90b

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

.github/workflows/python-testing.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,21 @@ name: Python
33

44
on:
55
push:
6-
branches: [ master ]
6+
branches: [ "master", "main" ]
7+
paths:
8+
- 'pyproject.toml'
9+
- '**.py'
10+
- '.github/workflows/python-testing.yml'
11+
712
pull_request:
8-
branches: [ master ]
13+
branches: [ "master", "main" ]
14+
paths:
15+
- 'pyproject.toml'
16+
- '**.py'
17+
- '.github/workflows/python-testing.yml'
18+
19+
permissions:
20+
contents: read
921

1022
concurrency:
1123
# only cancel in-progress runs of the same workflow
@@ -17,6 +29,9 @@ concurrency:
1729
jobs:
1830
check:
1931
runs-on: ubuntu-latest
32+
# Timout of 15min
33+
timeout-minutes: 15
34+
2035
steps:
2136
- uses: actions/checkout@v3
2237
- name: Output env variables
@@ -41,7 +56,8 @@ jobs:
4156
- name: Set up Python ${{ matrix.python-version }}
4257
uses: actions/setup-python@v3
4358
with:
44-
python-version: 3.7
59+
python-version: 3.8
60+
cache: 'pip'
4561
- name: Install dependencies
4662
run: |
4763
python3 -m pip install --upgrade pip setuptools setuptools-scm
@@ -70,6 +86,7 @@ jobs:
7086
uses: actions/setup-python@v4
7187
with:
7288
python-version: ${{ matrix.python-version }}
89+
cache: 'pip'
7390
- name: Install dependencies
7491
run: |
7592
python3 -m pip install --upgrade pip

0 commit comments

Comments
 (0)