machine.py - formatting #18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: mpy build | |
on: push | |
env: | |
SRC_FILE: src/sht3x.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: Running tests... | |
run: | | |
python3 run_tests.py | |
- name: Compiling bytecode... | |
run: | | |
pip3 install mpy-cross | |
python3 -m mpy_cross $SRC_FILE -o sht3x.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 "[email protected]" | |
git commit -am "GitHub Actions" | |
git push | |
fi |