Refactor microcontroller wrapper utilities #1739
Workflow file for this run
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
| # Based on https://sagarsonwane230797.medium.com/automate-build-checks-and-slack-notification-with-github-actions-3b7eb702dae6 | |
| # mypy: https://doedotdev.medium.com/mypy-for-github-action-7da1ebee99e7 | |
| # optimization: https://github.com/marketplace/actions/skip-duplicate-actions#usage-examples | |
| name: HDL and example tests | |
| on: | |
| push: | |
| branches: | |
| - "master" | |
| pull_request: | |
| types: [assigned, opened, synchronize, reopened, ready_for_review] | |
| jobs: | |
| pre_job: | |
| runs-on: ubuntu-latest | |
| if: github.event.pull_request.draft == false | |
| outputs: | |
| should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
| steps: | |
| - id: skip_check | |
| uses: fkirc/skip-duplicate-actions@master | |
| with: | |
| paths: '[ | |
| ".github/**", | |
| "compiler/**", | |
| "edg_core/**", | |
| "electronics_model/**", | |
| "electronics_abstract_parts/**", | |
| "electronics_lib/**", | |
| "edg/**", | |
| "examples/**.py" | |
| ]' | |
| black_latest_3_13: | |
| needs: pre_job | |
| if: ${{ needs.pre_job.outputs.should_skip != 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.13' | |
| - name: install black | |
| run: | | |
| pip install -e .[dev] | |
| - name: black | |
| run: black --check . | |
| mypy_latest_3_13: | |
| needs: pre_job | |
| if: ${{ needs.pre_job.outputs.should_skip != 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.13' | |
| - name: install mypy | |
| run: | | |
| pip install -e .[dev] | |
| pip install mypy mypy-protobuf | |
| mypy --version | |
| - name: mypy | |
| run: mypy --install-types . | |
| packagetest_latest_3_13: | |
| needs: pre_job | |
| if: ${{ needs.pre_job.outputs.should_skip != 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.13' | |
| - name: package | |
| run: python -m pip install . | |
| - name: unittest | |
| run: python -m unittest examples.test_blinky | |
| - name: toptest # test that code works using the installed package and not from the source directory | |
| run: cd examples && python ../blinky_skeleton.py | |
| unittest_latest_3_13: | |
| needs: pre_job | |
| if: ${{ needs.pre_job.outputs.should_skip != 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.13' | |
| - name: install dependencies | |
| run: pip install -e . | |
| - name: unittest | |
| run: python -m unittest discover | |
| unittest_latest_3_10: | |
| needs: pre_job | |
| if: ${{ needs.pre_job.outputs.should_skip != 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.10' | |
| - name: install dependencies | |
| run: pip install -e . | |
| - name: unittest | |
| run: python -m unittest discover |