Skip to content

Commit b5f14a0

Browse files
committed
misc: Add github workflows.
1 parent dd78bab commit b5f14a0

File tree

2 files changed

+73
-0
lines changed

2 files changed

+73
-0
lines changed

.github/workflows/check-commits.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: '📜 Check Commit Messages'
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- edited
8+
- reopened
9+
- synchronize
10+
branches:
11+
- 'main'
12+
13+
jobs:
14+
check-commit-messages:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: '📜 Check commit messages format'
18+
uses: gsactions/commit-message-checker@v1
19+
with:
20+
pattern: '^[^!]+: [A-Za-z]+.+ .+\.$'
21+
flags: 'gm'
22+
error: 'Commit subject line must match the following pattern: <scope>: <description>.'
23+
excludeTitle: 'false'
24+
excludeDescription: 'true'
25+
checkAllCommitMessages: 'true'
26+
accessToken: ${{ secrets.GITHUB_TOKEN }}
27+
- name: '📜 Check commit messages length'
28+
uses: gsactions/commit-message-checker@v1
29+
with:
30+
pattern: '^[^#].{10,78}$'
31+
error: 'Commit subject line maximum line length of 78 characters is exceeded.'
32+
excludeTitle: 'false'
33+
excludeDescription: 'true'
34+
checkAllCommitMessages: 'true'
35+
accessToken: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/python-linter.yml

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: '🔎 Python Linter'
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
19+
steps:
20+
- name: '⏳ Checkout repository'
21+
uses: actions/checkout@v3
22+
23+
- name: '🐍 Set up Python'
24+
uses: actions/setup-python@v4
25+
with:
26+
cache: 'pip'
27+
python-version: "3.10"
28+
29+
- name: '🛠 Install dependencies'
30+
run: |
31+
python -m pip install --upgrade pip
32+
python -m pip install flake8==6.0.0 pytest==7.4.0
33+
34+
- name: '😾 Lint with flake8'
35+
run: |
36+
# stop the build if there are Python syntax errors or undefined names
37+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
38+
flake8 . --count --max-complexity=15 --max-line-length=120 --statistics

0 commit comments

Comments
 (0)