forked from StormWorld0/storm-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (57 loc) · 2.01 KB
/
Copy pathreview-app.yml
File metadata and controls
73 lines (57 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Storm Framework Review
on:
push:
branches: [ "main" ]
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.STORM_TOKEN }}
- name: Set up Python 3.13
uses: actions/setup-python@v3
with:
python-version: "3.12"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U flake8 autoflake black
- name: Auto Cleanup (Remove Unused Imports)
run: |
autoflake --in-place --remove-all-unused-imports --recursive . --exclude=vendor
- name: After Autoflake
run: git status
- name: Run black
continue-on-error: true
run: |
black . --verbose
- name: After Black
run: git status
- name: Commit black to repo
run: |
git config --global user.name "black-style[bot]"
git config --global user.email "storm[bot]@github.com"
CHANGED_FILES=$(git status --porcelain | sed 's/^M //g' | tr '\n' ', ')
git add .
if ! git diff --cached --quiet; then
git commit -m "Auto format with Black: ${CHANGED_FILES%, }"
git push
fi
- name: Lint with flake8
run: |
flake8 . --count --select=E9,F63,F7,F82,F401,W191 --show-source --statistics
- name: Commit and Push Changes
run: |
git config --global user.name "flake8[bot]"
git config --global user.email "storm[bot]@github.com"
CHANGED_FILES=$(git status --porcelain | sed 's/^M //g' | tr '\n' ', ')
git add .
if ! git diff --cached --quiet; then
git commit -m "style: Cleanup imports in: ${CHANGED_FILES%, }"
git push
fi