π§ͺ Test Cloud Client #262
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: 'π§ͺ 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' | |
schedule: | |
- cron: '0 12 * * *' # Runs every day at 12 PM UTC | |
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: 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 update | |
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 secure element' | |
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 / Async)' | |
env: | |
DEVICE_ID: ${{ secrets.DEVICE_ID1 }} | |
SECRET_KEY: ${{ secrets.SECRET_KEY }} | |
run: | | |
python tests/ci.py --basic-auth | |
- name: 'βοΈ Connect to IoT cloud (CPython / Basic Auth / Sync)' | |
env: | |
DEVICE_ID: ${{ secrets.DEVICE_ID1 }} | |
SECRET_KEY: ${{ secrets.SECRET_KEY }} | |
run: | | |
python tests/ci.py --basic-auth --sync | |
- name: 'βοΈ Connect to IoT cloud (CPython / Key-Cert Auth / Async)' | |
env: | |
DEVICE_ID: ${{ secrets.DEVICE_ID2 }} | |
run: | | |
python tests/ci.py --file-auth | |
- name: 'βοΈ Connect to IoT cloud (CPython / Key-Cert Auth / CADATA / Async)' | |
env: | |
DEVICE_ID: ${{ secrets.DEVICE_ID2 }} | |
run: | | |
python tests/ci.py --file-auth --ca-data | |
- name: 'βοΈ Connect to IoT cloud (CPython / Crypto Auth / Async)' | |
env: | |
DEVICE_ID: ${{ secrets.DEVICE_ID2 }} | |
run: | | |
export SOFTHSM2_CONF="${HOME}/softhsm/tokens/softhsm2.conf" | |
python tests/ci.py --crypto-device | |
- name: 'βοΈ Connect to IoT cloud (MicroPython / Basic Auth / Async)' | |
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 --basic-auth | |
- name: 'βοΈ Connect to IoT cloud (MicroPython / Basic Auth / Sync)' | |
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 --basic-auth --sync | |
- name: 'βοΈ Connect to IoT cloud (MicroPython / Key-Cert Auth / Async)' | |
env: | |
DEVICE_ID: ${{ secrets.DEVICE_ID2 }} | |
run: | | |
export PATH="${HOME}/cache/bin:${PATH}" | |
micropython -c "import sys; print(sys.path)" | |
micropython tests/ci.py --file-auth |