Skip to content

Commit 0424460

Browse files
validate package.json and package version file before running all tests
umodbus/version.py is no longer created before testing the package creation
1 parent 96a3064 commit 0424460

File tree

2 files changed

+23
-16
lines changed

2 files changed

+23
-16
lines changed

.github/workflows/test.yml

+21-15
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,24 @@ jobs:
4040
- name: Lint with yamllint
4141
run: |
4242
yamllint .
43-
- name: Install deploy dependencies
43+
- name: Validate package version file
44+
# the package version file has to be always up to date as mip is using
45+
# the file directly from the repo. On a PyPi package the version file
46+
# is updated and then packed
4447
run: |
45-
python -m pip install --upgrade pip
46-
if [ -f requirements-deploy.txt ]; then pip install -r requirements-deploy.txt; fi
48+
changelog2version \
49+
--changelog_file changelog.md \
50+
--version_file umodbus/version.py \
51+
--version_file_type py \
52+
--validate \
53+
--debug
54+
- name: Validate mip package file
55+
run: |
56+
upy-package \
57+
--setup_file setup.py \
58+
--package_changelog_file changelog.md \
59+
--package_file package.json \
60+
--validate
4761
- name: Execute tests
4862
run: |
4963
docker build --tag micropython-test --file Dockerfile.tests .
@@ -59,22 +73,14 @@ jobs:
5973
- name: Run Client/Host RTU test
6074
run: |
6175
docker compose -f docker-compose-rtu-test.yaml up --build --exit-code-from micropython-host
76+
- name: Install deploy dependencies
77+
run: |
78+
python -m pip install --upgrade pip
79+
if [ -f requirements-deploy.txt ]; then pip install -r requirements-deploy.txt; fi
6280
- name: Build package
6381
run: |
64-
changelog2version \
65-
--changelog_file changelog.md \
66-
--version_file umodbus/version.py \
67-
--version_file_type py \
68-
--debug
6982
python setup.py sdist
7083
rm dist/*.orig
7184
- name: Test built package
7285
run: |
7386
twine check dist/*
74-
- name: Validate mip package file
75-
run: |
76-
upy-package \
77-
--setup_file setup.py \
78-
--package_changelog_file changelog.md \
79-
--package_file package.json \
80-
--validate

requirements-test.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# List external packages here
22
# Avoid fixed versions
3+
changelog2version>=0.10.0,<1
34
coverage>=6.4.2,<7
45
flake8>=5.0.0,<6
56
nose2>=0.12.0,<1
6-
pre-commit>=3.3.3,<4
77
setup2upypackage>=0.4.0,<1
8+
pre-commit>=3.3.3,<4
89
yamllint>=1.29,<2

0 commit comments

Comments
 (0)