Skip to content

Commit 0e917c2

Browse files
fix YAML syntax on workflow files
1 parent ab68a37 commit 0e917c2

File tree

3 files changed

+151
-140
lines changed

3 files changed

+151
-140
lines changed

.github/workflows/release.yml

Lines changed: 43 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
# this file is *not* meant to cover or endorse the use of GitHub Actions, but rather to
2-
# help make automated releases for this project
1+
---
2+
3+
# this file is *not* meant to cover or endorse the use of GitHub Actions, but
4+
# rather to help make automated releases for this project
35

46
name: Upload Python Package
57

@@ -15,42 +17,42 @@ jobs:
1517
deploy:
1618
runs-on: ubuntu-latest
1719
steps:
18-
- name: Checkout
19-
uses: actions/checkout@v3
20-
- name: Set up Python
21-
uses: actions/setup-python@v3
22-
with:
23-
python-version: '3.9'
24-
- name: Install build dependencies
25-
run: |
26-
if [ -f requirements-deploy.txt ]; then pip install -r requirements-deploy.txt; fi
27-
- name: Build package
28-
run: |
29-
changelog2version \
30-
--changelog_file changelog.md \
31-
--version_file umodbus/version.py \
32-
--version_file_type py \
33-
--debug
34-
python setup.py sdist
35-
rm dist/*.orig
36-
# sdist call create non conform twine files *.orig, remove them
37-
- name: Publish package
38-
uses: pypa/gh-action-pypi-publish@release/v1.5
39-
with:
40-
password: ${{ secrets.PYPI_API_TOKEN }}
41-
skip_existing: true
42-
verbose: true
43-
print_hash: true
44-
- name: 'Create changelog based release'
45-
uses: brainelectronics/changelog-based-release@v1
46-
with:
47-
# note you'll typically need to create a personal access token
48-
# with permissions to create releases in the other repo
49-
# or you set the "contents" permissions to "write" as in this example
50-
changelog-path: changelog.md
51-
tag-name-prefix: ''
52-
tag-name-extension: ''
53-
release-name-prefix: ''
54-
release-name-extension: ''
55-
draft-release: true
56-
prerelease: false
20+
- name: Checkout
21+
uses: actions/checkout@v3
22+
- name: Set up Python
23+
uses: actions/setup-python@v3
24+
with:
25+
python-version: '3.9'
26+
- name: Install build dependencies
27+
run: |
28+
if [ -f requirements-deploy.txt ]; then pip install -r requirements-deploy.txt; fi
29+
- name: Build package
30+
run: |
31+
changelog2version \
32+
--changelog_file changelog.md \
33+
--version_file umodbus/version.py \
34+
--version_file_type py \
35+
--debug
36+
python setup.py sdist
37+
rm dist/*.orig
38+
# sdist call create non conform twine files *.orig, remove them
39+
- name: Publish package
40+
uses: pypa/gh-action-pypi-publish@release/v1.5
41+
with:
42+
password: ${{ secrets.PYPI_API_TOKEN }}
43+
skip_existing: true
44+
verbose: true
45+
print_hash: true
46+
- name: 'Create changelog based release'
47+
uses: brainelectronics/changelog-based-release@v1
48+
with:
49+
# note you'll typically need to create a personal access token
50+
# with permissions to create releases in the other repo
51+
# or you set the "contents" permissions to "write" as in this example
52+
changelog-path: changelog.md
53+
tag-name-prefix: ''
54+
tag-name-extension: ''
55+
release-name-prefix: ''
56+
release-name-extension: ''
57+
draft-release: true
58+
prerelease: false
Lines changed: 56 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
# this file is *not* meant to cover or endorse the use of GitHub Actions, but rather to
2-
# help make automated releases for this project
1+
---
2+
3+
# this file is *not* meant to cover or endorse the use of GitHub Actions, but
4+
# rather to help make automated test releases for this project
35

46
name: Upload Python Package to test.pypi.org
57

@@ -12,55 +14,55 @@ jobs:
1214
test-deploy:
1315
runs-on: ubuntu-latest
1416
steps:
15-
- name: Checkout
16-
uses: actions/checkout@v3
17-
- name: Set up Python
18-
uses: actions/setup-python@v3
19-
with:
20-
python-version: '3.9'
21-
- name: Install build dependencies
22-
run: |
23-
if [ -f requirements-deploy.txt ]; then pip install -r requirements-deploy.txt; fi
24-
- name: Build package
25-
run: |
26-
changelog2version \
27-
--changelog_file changelog.md \
28-
--version_file umodbus/version.py \
29-
--version_file_type py \
30-
--additional_version_info="-rc${{ github.run_number }}.dev${{ github.event.number }}" \
31-
--debug
32-
python setup.py sdist
33-
- name: Test built package
34-
# sdist call creates non twine conform "*.orig" files, remove them
35-
run: |
36-
rm dist/*.orig
37-
twine check dist/*.tar.gz
38-
- name: Archive build package artifact
39-
uses: actions/upload-artifact@v3
40-
with:
41-
# https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
42-
# ${{ github.repository }} and ${{ github.ref_name }} can't be used for artifact name due to unallowed '/'
43-
name: dist_repo.${{ github.event.repository.name }}_sha.${{ github.sha }}_build.${{ github.run_number }}
44-
path: dist/*.tar.gz
45-
retention-days: 14
46-
- name: Publish package
47-
uses: pypa/gh-action-pypi-publish@release/v1.5
48-
with:
49-
repository_url: https://test.pypi.org/legacy/
50-
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
51-
skip_existing: true
52-
verbose: true
53-
print_hash: true
54-
- name: 'Create changelog based prerelease'
55-
uses: brainelectronics/changelog-based-release@v1
56-
with:
57-
# note you'll typically need to create a personal access token
58-
# with permissions to create releases in the other repo
59-
# or you set the "contents" permissions to "write" as in this example
60-
changelog-path: changelog.md
61-
tag-name-prefix: ''
62-
tag-name-extension: '-rc${{ github.run_number }}.dev${{ github.event.number }}'
63-
release-name-prefix: ''
64-
release-name-extension: '-rc${{ github.run_number }}.dev${{ github.event.number }}'
65-
draft-release: true
66-
prerelease: true
17+
- name: Checkout
18+
uses: actions/checkout@v3
19+
- name: Set up Python
20+
uses: actions/setup-python@v3
21+
with:
22+
python-version: '3.9'
23+
- name: Install build dependencies
24+
run: |
25+
if [ -f requirements-deploy.txt ]; then pip install -r requirements-deploy.txt; fi
26+
- name: Build package
27+
run: |
28+
changelog2version \
29+
--changelog_file changelog.md \
30+
--version_file umodbus/version.py \
31+
--version_file_type py \
32+
--additional_version_info="-rc${{ github.run_number }}.dev${{ github.event.number }}" \
33+
--debug
34+
python setup.py sdist
35+
- name: Test built package
36+
# sdist call creates non twine conform "*.orig" files, remove them
37+
run: |
38+
rm dist/*.orig
39+
twine check dist/*.tar.gz
40+
- name: Archive build package artifact
41+
uses: actions/upload-artifact@v3
42+
with:
43+
# https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
44+
# ${{ github.repository }} and ${{ github.ref_name }} can't be used for artifact name due to unallowed '/'
45+
name: dist_repo.${{ github.event.repository.name }}_sha.${{ github.sha }}_build.${{ github.run_number }}
46+
path: dist/*.tar.gz
47+
retention-days: 14
48+
- name: Publish package
49+
uses: pypa/gh-action-pypi-publish@release/v1.5
50+
with:
51+
repository_url: https://test.pypi.org/legacy/
52+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
53+
skip_existing: true
54+
verbose: true
55+
print_hash: true
56+
- name: 'Create changelog based prerelease'
57+
uses: brainelectronics/changelog-based-release@v1
58+
with:
59+
# note you'll typically need to create a personal access token
60+
# with permissions to create releases in the other repo
61+
# or you set the "contents" permissions to "write" as in this example
62+
changelog-path: changelog.md
63+
tag-name-prefix: ''
64+
tag-name-extension: '-rc${{ github.run_number }}.dev${{ github.event.number }}'
65+
release-name-prefix: ''
66+
release-name-extension: '-rc${{ github.run_number }}.dev${{ github.event.number }}'
67+
draft-release: true
68+
prerelease: true

.github/workflows/test.yml

Lines changed: 52 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
1+
---
2+
3+
# This workflow will install Python dependencies, run tests and lint with a
4+
# specific Python version
5+
# For more information see:
6+
# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
37

48
name: Test Python package
59

@@ -17,46 +21,49 @@ jobs:
1721
build:
1822
runs-on: ubuntu-latest
1923
steps:
20-
- name: Checkout
21-
uses: actions/checkout@v3
22-
- name: Set up Python
23-
uses: actions/setup-python@v3
24-
with:
25-
python-version: '3.9'
26-
- name: Install test dependencies
27-
run: |
28-
pip install -r requirements-test.txt
29-
- name: Lint with flake8
30-
run: |
31-
flake8 .
32-
- name: Install deploy dependencies
33-
run: |
34-
python -m pip install --upgrade pip
35-
if [ -f requirements-deploy.txt ]; then pip install -r requirements-deploy.txt; fi
36-
- name: Execute tests
37-
run: |
38-
docker build --tag micropython-test --file Dockerfile.tests .
39-
- name: Run Client/Host TCP example
40-
run: |
41-
docker compose up --build --exit-code-from micropython-host
42-
- name: Run Client/Host TCP test
43-
run: |
44-
docker compose -f docker-compose-tcp-test.yaml up --build --exit-code-from micropython-host
45-
- name: Run Client/Host RTU example
46-
run: |
47-
docker compose -f docker-compose-rtu.yaml up --build --exit-code-from micropython-host
48-
- name: Run Client/Host RTU test
49-
run: |
50-
docker compose -f docker-compose-rtu-test.yaml up --build --exit-code-from micropython-host
51-
- name: Build package
52-
run: |
53-
changelog2version \
54-
--changelog_file changelog.md \
55-
--version_file umodbus/version.py \
56-
--version_file_type py \
57-
--debug
58-
python setup.py sdist
59-
rm dist/*.orig
60-
- name: Test built package
61-
run: |
62-
twine check dist/*
24+
- name: Checkout
25+
uses: actions/checkout@v3
26+
- name: Set up Python
27+
uses: actions/setup-python@v3
28+
with:
29+
python-version: '3.9'
30+
- name: Install test dependencies
31+
run: |
32+
pip install -r requirements-test.txt
33+
- name: Lint with flake8
34+
run: |
35+
flake8 .
36+
- name: Lint with yamllint
37+
run: |
38+
yamllint .
39+
- name: Install deploy dependencies
40+
run: |
41+
python -m pip install --upgrade pip
42+
if [ -f requirements-deploy.txt ]; then pip install -r requirements-deploy.txt; fi
43+
- name: Execute tests
44+
run: |
45+
docker build --tag micropython-test --file Dockerfile.tests .
46+
- name: Run Client/Host TCP example
47+
run: |
48+
docker compose up --build --exit-code-from micropython-host
49+
- name: Run Client/Host TCP test
50+
run: |
51+
docker compose -f docker-compose-tcp-test.yaml up --build --exit-code-from micropython-host
52+
- name: Run Client/Host RTU example
53+
run: |
54+
docker compose -f docker-compose-rtu.yaml up --build --exit-code-from micropython-host
55+
- name: Run Client/Host RTU test
56+
run: |
57+
docker compose -f docker-compose-rtu-test.yaml up --build --exit-code-from micropython-host
58+
- name: Build package
59+
run: |
60+
changelog2version \
61+
--changelog_file changelog.md \
62+
--version_file umodbus/version.py \
63+
--version_file_type py \
64+
--debug
65+
python setup.py sdist
66+
rm dist/*.orig
67+
- name: Test built package
68+
run: |
69+
twine check dist/*

0 commit comments

Comments
 (0)