Skip to content

Commit c0ab8eb

Browse files
authored
CI pipeline
1 parent 465f042 commit c0ab8eb

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/main.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Format and Lint
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
pull_request:
7+
branches: [ main, master ]
8+
9+
jobs:
10+
format-and-lint:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
ref: ${{ github.head_ref }}
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: '3.11'
23+
24+
- name: Install dependencies
25+
run: make install
26+
27+
- name: Run formatters
28+
run: make format
29+
30+
- name: Run linter
31+
run: make lint
32+
33+
- name: Commit and push changes if any
34+
run: |
35+
if [[ -n $(git status --porcelain) ]]; then
36+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
37+
git config --local user.name "github-actions[bot]"
38+
git add -A
39+
git commit -m "style: format code with black and isort"
40+
git push
41+
else
42+
echo "No changes to commit"
43+
fi

0 commit comments

Comments
 (0)