Skip to content

Commit

Permalink
[1] Implement GitHub action for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mikir committed Oct 24, 2023
1 parent b562202 commit f3bc21d
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Windows

on:
push:
branches: [ master, '*-ci' ]
pull_request:
branches: [ master ]
workflow_dispatch:
schedule:
- cron: '0 0 * * 0'

jobs:
build_windows:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: ["windows-latest"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

- name: Set up Python ${{matrix.python-version}}
uses: actions/setup-python@v4
with:
python-version: ${{matrix.python-version}}

- name: Install dependecies
run: choco install wget
shell: bash

- name: Install Mosquitto library
run: |
wget -P "${{github.workspace}}" https://mosquitto.org/files/binary/win64/mosquitto-2.0.18-install-windows-x64.exe
& "${{github.workspace}}/mosquitto-2.0.18-install-windows-x64.exe" /S
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install paho-mqtt
python -m pip install zserio
python -m pip install astroid==2.15.0
python -m pip install pylint==2.16.3
python -m pip install mypy==0.931
shell: bash

- name: Build Zserio Python Pub/Sub Paho Mqtt
run: |
zserio -src examples/calculator calculator.zs -python build/gen
mypy build/gen examples/calculator src
PYTHONPATH=build/gen pylint examples src \
--disable=missing-module-docstring,missing-function-docstring,duplicate-code,too-many-arguments \
--disable=too-few-public-methods,broad-exception-caught,unnecessary-lambda-assignment
shell: bash

- name: Test Zserio Python Pub/Sub Paho Mqtt
run: |
"/c/Program Files/mosquitto/mosquitto" &
sleep 10
cd examples/calculator
python power_of_two_provider.py &
python square_root_of_provider.py &
sleep 10
echo -e "p\\n100\\nq" | python calculator_client.py | grep "square_root_of: 10.0"
echo -e "s\\n100\\nq" | python calculator_client.py | grep "power_of_two: 10000"
kill $(jobs -p)
env:
PYTHONDONTWRITEBYTECODE: 1
PYTHONPATH: "../../src;../../build/gen"
shell: bash
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Zserio Pub/Sub Paho MQTT Backend

[![](https://github.com/ndsev/zserio-pubsub-paho-mqtt-python/actions/workflows/build_linux.yml/badge.svg)](https://github.com/ndsev/zserio-pubsub-paho-mqtt-python/actions/workflows/build_linux.yml)
[![](https://github.com/ndsev/zserio-pubsub-paho-mqtt-python/actions/workflows/build_windows.yml/badge.svg)](https://github.com/ndsev/zserio-pubsub-paho-mqtt-python/actions/workflows/build_windows.yml)
[![](https://img.shields.io/github/watchers/ndsev/zserio-pubsub-paho-mqtt-python.svg)](https://GitHub.com/ndsev/zserio-pubsub-paho-mqtt-python/watchers)
[![](https://img.shields.io/github/forks/ndsev/zserio-pubsub-paho-mqtt-python.svg)](https://GitHub.com/ndsev/zserio-pubsub-paho-mqtt-python/network/members)
[![](https://img.shields.io/github/stars/ndsev/zserio-pubsub-paho-mqtt-python.svg?color=yellow)](https://GitHub.com/ndsev/zserio-pubsub-paho-mqtt-python/stargazers)
Expand Down

0 comments on commit f3bc21d

Please sign in to comment.