misc: Add micropython test. #151
Workflow file for this run
This file contains 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: 'π§ͺ Test Cloud Client' | |
on: | |
push: | |
branches: | |
- 'main' | |
paths: | |
- '*.py' | |
- '.github/workflows/*.yml' | |
- '.github/workflows/*.json' | |
- '!**/README.md' | |
pull_request: | |
types: | |
- opened | |
- edited | |
- reopened | |
- synchronize | |
branches: | |
- 'main' | |
paths: | |
- '*.py' | |
- '.github/workflows/*.yml' | |
- '.github/workflows/*.json' | |
- '!**/README.md' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 'β³ Checkout repository' | |
uses: actions/checkout@v3 | |
- name: 'β» Caching dependencies' | |
uses: actions/[email protected] | |
id: cache | |
with: | |
path: ~/cache/bin/ | |
key: 'micropython' | |
- name: 'π Set up Python' | |
uses: actions/setup-python@v4 | |
with: | |
cache: 'pip' | |
python-version: "3.10" | |
- name: 'π Set up MicroPython' | |
# if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
rm ${HOME}/cache/bin/micropython | |
source tests/ci.sh && ci_install_micropython | |
- name: 'π Install dependencies' | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install build==0.10.0 cbor2==5.4.6 M2Crypto==0.38.0 micropython-senml==0.1.0 | |
sudo apt-get install softhsm2 gnutls-bin libengine-pkcs11-openssl | |
- name: 'π¦ Build package' | |
run: python3 -m build | |
- name: 'π Install package' | |
run: | | |
python3 -m build | |
pip install --user dist/arduino_iot_cloud-*.whl | |
pip install --target=${HOME}/.micropython/lib dist/arduino_iot_cloud-*.whl | |
- name: 'π Configure soft crypto device' | |
env: | |
KEY_PEM: ${{ secrets.KEY_PEM }} | |
CERT_PEM: ${{ secrets.CERT_PEM }} | |
CA_PEM: ${{ secrets.CA_PEM }} | |
run: | | |
source tests/ci.sh && ci_configure_softhsm | |
- name: 'βοΈ Connect to IoT cloud (CPython / Basic Auth)' | |
env: | |
DEVICE_ID: ${{ secrets.DEVICE_ID1 }} | |
SECRET_KEY: ${{ secrets.SECRET_KEY }} | |
run: | | |
python tests/ci.py | |
- name: 'βοΈ Connect to IoT cloud (CPython / Crypto Auth)' | |
env: | |
DEVICE_ID: ${{ secrets.DEVICE_ID2 }} | |
SECRET_KEY: ${{ secrets.SECRET_KEY }} | |
run: | | |
export SOFTHSM2_CONF="${HOME}/softhsm/tokens/softhsm2.conf" | |
python tests/ci.py --crypto-device | |
- name: 'βοΈ Connect to IoT cloud (MicroPython / Basic Auth)' | |
env: | |
DEVICE_ID: ${{ secrets.DEVICE_ID1 }} | |
SECRET_KEY: ${{ secrets.SECRET_KEY }} | |
run: | | |
export PATH="${HOME}/cache/bin:${PATH}" | |
micropython -c "import sys; print(sys.path)" | |
micropython tests/ci.py |