Skip to content

Commit

Permalink
update CI scripts to allow running CI on the desktop (see below)
Browse files Browse the repository at this point in the history
* add script to run 'act' local github actions tool (lets devs check github
actions on their local machine)
* Update various github actions to latest (so they can work with the 'act'
tool)
* change a few places where python version was not properly quoted as a
string (act yaml parser is more strict than the github version)
* update pylint min-version to work with recent github actions
* remove pandas/riden requirement (that's in my other branch for now)
  • Loading branch information
geeksville committed Jun 22, 2024
1 parent 6e30de8 commit 3d27710
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 393 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,24 @@ jobs:
- "3.10"
- "3.11"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install Python 3
uses: actions/setup-python@v1
uses: actions/setup-python@v5
- name: Uninstall meshtastic
run: |
pip3 uninstall meshtastic
pip3 uninstall -y meshtastic
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip3 install poetry
- name: Install meshtastic from local
run: |
poetry install
poetry run meshtastic --version
- name: Run pylint
run: poetry run pylint meshtastic examples/ --ignore-patterns ".*_pb2.pyi?$"
- name: Check types with mypy
run: mypy meshtastic/
run: poetry run mypy meshtastic/
- name: Run tests with pytest
run: poetry run pytest --cov=meshtastic
- name: Generate coverage report
Expand All @@ -60,10 +61,12 @@ jobs:
- "3.10"
- "3.11"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install Python 3
uses: actions/setup-python@v1
uses: actions/setup-python@v5
- name: Install meshtastic from local
run: |
python -m pip install --upgrade pip
pip3 install poetry
poetry install
meshtastic --version
poetry run meshtastic --version
24 changes: 12 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Bump version
run: >-
Expand Down Expand Up @@ -48,9 +48,9 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Python 3.9
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: "3.9"

- name: Install pypa/build
run: >-
Expand Down Expand Up @@ -79,14 +79,14 @@ jobs:
# needs: release_create
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# uses: actions/checkout@v4
# with:
# ref: ${{ needs.release_create.outputs.new_sha }}

# - name: Set up Python 3.9
# uses: actions/setup-python@v2
# uses: actions/setup-python@v5
# with:
# python-version: 3.9
# python-version: "3.9"

# - name: Setup code signing
# env:
Expand Down Expand Up @@ -125,14 +125,14 @@ jobs:
needs: release_create
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ needs.release_create.outputs.new_sha }}

- name: Set up Python 3.9
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: "3.9"

- name: Build
run: |
Expand Down Expand Up @@ -166,14 +166,14 @@ jobs:
needs: release_create
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ needs.release_create.outputs.new_sha }}

- name: Set up Python 3.9
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: "3.9"

- name: Build
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update_protobufs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: true

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ __pycache__
examples/__pycache__
meshtastic.spec
.hypothesis/
coverage.xml
6 changes: 6 additions & 0 deletions bin/run-ci-local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

# This script lets you run github ci actions locally

# also: we only run one of the 4 matrix tests, because otherwise it absolutely hammers the CPU (so many containers and threads)
act -P ubuntu-latest=-self-hosted --matrix "python-version:3.8"
Loading

0 comments on commit 3d27710

Please sign in to comment.