Skip to content

Commit 9c0f089

Browse files
committed
refactor: use matrix for running lint workflow
1 parent 411ee16 commit 9c0f089

File tree

1 file changed

+23
-132
lines changed

1 file changed

+23
-132
lines changed
Lines changed: 23 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -1,136 +1,27 @@
1-
name: "Pre commit hook check"
1+
name: "Lint/Format"
22

33
on:
4-
pull_request:
5-
types:
6-
- opened
7-
- reopened
8-
- edited
9-
- synchronize
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
- edited
9+
- synchronize
1010

1111
jobs:
12-
pr-title-3_8:
13-
name: Pre commit hook check (3.8)
14-
runs-on: ubuntu-latest
15-
steps:
16-
- uses: actions/checkout@v2
17-
- uses: actions/setup-python@v5
18-
with:
19-
python-version: '3.8'
20-
- name: Create virtual environment and install dependencies
21-
run: |
22-
python3 -m venv venv
23-
source venv/bin/activate
24-
make dev-install && rm -rf src
25-
- name: Make a dummy change to README.md
26-
run: |
27-
echo "# Dummy change for PR check" >> README.md
28-
- run: git init && git add --all && git -c user.name='test' -c user.email='[email protected]' commit -m 'init for pr action'
29-
- run: |
30-
source venv/bin/activate
31-
./hooks/pre-commit.sh
32-
33-
pr-title-3_9:
34-
name: Pre commit hook check (3.9)
35-
runs-on: ubuntu-latest
36-
steps:
37-
- uses: actions/checkout@v2
38-
- uses: actions/setup-python@v5
39-
with:
40-
python-version: '3.9'
41-
- name: Create virtual environment and install dependencies
42-
run: |
43-
python3 -m venv venv
44-
source venv/bin/activate
45-
make dev-install && rm -rf src
46-
- name: Make a dummy change to README.md
47-
run: |
48-
echo "# Dummy change for PR check" >> README.md
49-
- run: git init && git add --all && git -c user.name='test' -c user.email='[email protected]' commit -m 'init for pr action'
50-
- run: |
51-
source venv/bin/activate
52-
./hooks/pre-commit.sh
53-
54-
pr-title-3_10:
55-
name: Pre commit hook check (3.10)
56-
runs-on: ubuntu-latest
57-
steps:
58-
- uses: actions/checkout@v2
59-
- uses: actions/setup-python@v5
60-
with:
61-
python-version: '3.10'
62-
- name: Create virtual environment and install dependencies
63-
run: |
64-
python3 -m venv venv
65-
source venv/bin/activate
66-
make dev-install && rm -rf src
67-
- name: Make a dummy change to README.md
68-
run: |
69-
echo "# Dummy change for PR check" >> README.md
70-
- run: git init && git add --all && git -c user.name='test' -c user.email='[email protected]' commit -m 'init for pr action'
71-
- run: |
72-
source venv/bin/activate
73-
./hooks/pre-commit.sh
74-
75-
pr-title-3_11:
76-
name: Pre commit hook check (3.11)
77-
runs-on: ubuntu-latest
78-
steps:
79-
- uses: actions/checkout@v2
80-
- uses: actions/setup-python@v5
81-
with:
82-
python-version: '3.11'
83-
- name: Create virtual environment and install dependencies
84-
run: |
85-
python3 -m venv venv
86-
source venv/bin/activate
87-
make dev-install && rm -rf src
88-
- name: Make a dummy change to README.md
89-
run: |
90-
echo "# Dummy change for PR check" >> README.md
91-
- run: git init && git add --all && git -c user.name='test' -c user.email='[email protected]' commit -m 'init for pr action'
92-
- run: |
93-
source venv/bin/activate
94-
./hooks/pre-commit.sh
95-
96-
pr-title-3_12:
97-
name: Pre commit hook check (3.12)
98-
runs-on: ubuntu-latest
99-
steps:
100-
- uses: actions/checkout@v2
101-
- uses: actions/setup-python@v5
102-
with:
103-
python-version: '3.12'
104-
- name: Create virtual environment and install dependencies
105-
run: |
106-
python3 -m venv venv
107-
source venv/bin/activate
108-
make dev-install && rm -rf src
109-
- name: Make a dummy change to README.md
110-
run: |
111-
echo "# Dummy change for PR check" >> README.md
112-
- run: git init && git add --all && git -c user.name='test' -c user.email='[email protected]' commit -m 'init for pr action'
113-
- run: |
114-
source venv/bin/activate
115-
./hooks/pre-commit.sh
116-
117-
pr-title-3_13:
118-
name: Pre commit hook check (3.13)
119-
runs-on: ubuntu-latest
120-
steps:
121-
- uses: actions/checkout@v2
122-
- uses: actions/setup-python@v5
123-
with:
124-
python-version: '3.13'
125-
- name: Create virtual environment and install dependencies
126-
run: |
127-
python3 -m venv venv
128-
source venv/bin/activate
129-
make dev-install && rm -rf src
130-
- name: Make a dummy change to README.md
131-
run: |
132-
echo "# Dummy change for PR check" >> README.md
133-
- run: git init && git add --all && git -c user.name='test' -c user.email='[email protected]' commit -m 'init for pr action'
134-
- run: |
135-
source venv/bin/activate
136-
./hooks/pre-commit.sh
12+
lint-format:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
py_version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-python@v5
20+
with:
21+
python-version: ${{ matrix.py_version }}
22+
- name: Create virtual environment and install dependencies
23+
run: |
24+
python3 -m venv venv
25+
source venv/bin/activate
26+
make dev-install && rm -rf src
27+
make lint

0 commit comments

Comments
 (0)