forked from sfera-labs/exo-sense-py-modbus
-
Notifications
You must be signed in to change notification settings - Fork 58
86 lines (81 loc) · 2.62 KB
/
Copy pathtest.yml
File metadata and controls
86 lines (81 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
---
# This workflow will install Python dependencies, run tests and lint with a
# specific Python version
# For more information see:
# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Test Python package
on:
push:
# branches: [ $default-branch ]
branches-ignore:
- 'main'
- 'develop'
pull_request:
branches:
- 'main'
- 'develop'
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
- name: Install test dependencies
run: |
pip install -r requirements-test.txt
- name: Lint with flake8
run: |
flake8 .
- name: Lint with yamllint
run: |
yamllint .
- name: Validate package version file
# the package version file has to be always up to date as mip is using
# the file directly from the repo. On a PyPi package the version file
# is updated and then packed
run: |
changelog2version \
--changelog_file changelog.md \
--version_file umodbus/version.py \
--version_file_type py \
--validate \
--debug
- name: Validate mip package file
run: |
upy-package \
--setup_file setup.py \
--package_changelog_file changelog.md \
--package_file package.json \
--validate
- name: Execute tests
run: |
docker build --tag micropython-test --file Dockerfile.tests .
- name: Run Client/Host TCP example
run: |
docker compose up --build --exit-code-from micropython-host
- name: Run Client/Host TCP test
run: |
docker compose -f docker-compose-tcp-test.yaml up --build --exit-code-from micropython-host
- name: Run Client/Host RTU example
run: |
docker compose -f docker-compose-rtu.yaml up --build --exit-code-from micropython-host
- name: Run Client/Host RTU test
run: |
docker compose -f docker-compose-rtu-test.yaml up --build --exit-code-from micropython-host
- name: Install deploy dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements-deploy.txt ]; then pip install -r requirements-deploy.txt; fi
- name: Build package
run: |
python setup.py sdist
rm dist/*.orig
- name: Test built package
run: |
twine check dist/*