Skip to content

Commit ea337a4

Browse files
Create build.yml
1 parent f047037 commit ea337a4

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/build.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: mpy build
2+
on: push
3+
env:
4+
SRC_FILE: bthome.py
5+
permissions:
6+
contents: write
7+
jobs:
8+
report:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-python@v5
13+
- name: Linting...
14+
run: |
15+
pip3 install ruff
16+
python3 -m ruff check $SRC_FILE
17+
- name: Compiling bytecode...
18+
run: |
19+
pip3 install mpy-cross
20+
python3 -m mpy_cross $SRC_FILE
21+
- name: Committing changes...
22+
run: |
23+
if [ $(git diff | wc -l) -gt 0 ]; then
24+
git config --global user.name "$GITHUB_REPOSITORY_OWNER"
25+
git config --global user.email "[email protected]"
26+
git commit -am "GitHub Actions"
27+
git push
28+
fi

0 commit comments

Comments
 (0)