-
Notifications
You must be signed in to change notification settings - Fork 2
28 lines (28 loc) · 804 Bytes
/
build.yml
File metadata and controls
28 lines (28 loc) · 804 Bytes
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
name: mpy build
on: push
env:
SRC_FILE: src/bthome.py
permissions:
contents: write
jobs:
report:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Linting...
run: |
pip3 install ruff
python3 -m ruff check $SRC_FILE
- name: Compiling bytecode...
run: |
pip3 install mpy-cross
python3 -m mpy_cross $SRC_FILE -o bthome.mpy
- name: Committing changes...
run: |
if [ $(git diff | wc -l) -gt 0 ]; then
git config --global user.name "$GITHUB_REPOSITORY_OWNER"
git config --global user.email "$GITHUB_REPOSITORY_OWNER@users.noreply.github.com"
git commit -am "GitHub Actions"
git push
fi