Skip to content

Commit 6a6828b

Browse files
Added GH Actions workflow to replaced AppVeyor script (#98)
This PR addresses issue #87 to move the AppVeyor script to GH Actions. Co-authored-by: Pavel Kirienko <[email protected]>
1 parent f564e42 commit 6a6828b

File tree

5 files changed

+98
-101
lines changed

5 files changed

+98
-101
lines changed
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: 'Test and Release PyDSDL'
2+
on: push
3+
4+
# Ensures that only one workflow is running at a time
5+
concurrency:
6+
group: ${{ github.workflow_sha }}
7+
cancel-in-progress: true
8+
9+
jobs:
10+
pydsdl-test:
11+
name: Test PyDSDL
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: [ ubuntu-latest, macos-latest ]
16+
python: [ '3.7', '3.8', '3.9', '3.10', '3.11' ]
17+
include:
18+
- os: windows-2019
19+
python: '3.10'
20+
- os: macos-latest
21+
python: '3.9'
22+
runs-on: ${{ matrix.os }}
23+
steps:
24+
- name: Check out pydsdl
25+
uses: actions/checkout@v3
26+
27+
- name: Check out public_regulated_data_types
28+
uses: actions/checkout@v3
29+
with:
30+
repository: OpenCyphal/public_regulated_data_types
31+
path: .dsdl-test
32+
33+
- name: Install Python3
34+
uses: actions/setup-python@v4
35+
with:
36+
python-version: ${{ matrix.python }}
37+
38+
- name: Log Python version
39+
run: python --version
40+
41+
- name: Install dependencies
42+
run: |
43+
if [ "$RUNNER_OS" == "Linux" ]; then
44+
sudo apt-get --ignore-missing update || true
45+
sudo apt-get install -y linux-*-extra-$(uname -r) graphviz
46+
fi
47+
python -m pip install --upgrade pip setuptools nox typed_ast
48+
shell: bash
49+
50+
- name: Run build and test
51+
run: |
52+
if [ "$RUNNER_OS" == "Linux" ]; then
53+
nox --non-interactive --error-on-missing-interpreters --session test test_eol pristine lint --python ${{ matrix.python }}
54+
nox --non-interactive --session docs
55+
elif [ "$RUNNER_OS" == "Windows" ]; then
56+
nox --forcecolor --non-interactive --error-on-missing-interpreters --session test test_eol pristine lint
57+
elif [ "$RUNNER_OS" == "macOS" ]; then
58+
nox --non-interactive --error-on-missing-interpreters --session test test_eol pristine lint --python ${{ matrix.python }}
59+
else
60+
echo "${{ runner.os }} not supported"
61+
exit 1
62+
fi
63+
python -c "import pydsdl; pydsdl.read_namespace('.dsdl-test/uavcan', [])"
64+
shell: bash
65+
66+
pydsdl-release:
67+
name: Release PyDSDL
68+
if: contains(github.event.head_commit.message, '#release') || contains(github.ref, '/master')
69+
needs: pydsdl-test
70+
runs-on: ubuntu-latest
71+
steps:
72+
- name: Check out
73+
uses: actions/checkout@v3
74+
75+
- name: Build distribution
76+
run: |
77+
python -m pip install --upgrade pip setuptools wheel twine
78+
python setup.py sdist bdist_wheel
79+
80+
- name: Get release version
81+
run: echo "pydsdl_version=$(python3 -c 'import pydsdl; print(pydsdl.__version__)')" >> $GITHUB_ENV
82+
83+
- name: Upload distribution
84+
run: |
85+
python -m twine upload dist/*
86+
env:
87+
TWINE_USERNAME: __token__
88+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN_PYDSDL }}
89+
90+
- name: Push version tag
91+
uses: mathieudutour/[email protected]
92+
with:
93+
github_token: ${{ secrets.GITHUB_TOKEN }}
94+
custom_tag: ${{ env.pydsdl_version }}
95+
tag_prefix: ''

appveyor.yml

Lines changed: 0 additions & 98 deletions
This file was deleted.

noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def test(session):
6161
session.log(f"OPEN IN WEB BROWSER: file://{report_file}")
6262

6363

64-
@nox.session(python=["3.6", "3.7"])
64+
@nox.session(python=["3.7"])
6565
def test_eol(session):
6666
"""This is a minimal test session for those old Pythons that have EOLed."""
6767
session.install("-e", ".")

pydsdl/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import sys as _sys
88
from pathlib import Path as _Path
99

10-
__version__ = "1.20.0"
10+
__version__ = "1.20.1"
1111
__version_info__ = tuple(map(int, __version__.split(".")[:3]))
1212
__license__ = "MIT"
1313
__author__ = "OpenCyphal"

pydsdl/_namespace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ def _unittest_common_usage_errors() -> None:
629629
_ensure_no_common_usage_errors(dir_dsdl, [di / "baz"], reports.append)
630630
(rep,) = reports
631631
reports.clear()
632-
assert str(dir_dsdl_uavcan).lower() in rep.lower()
632+
assert str(dir_dsdl_uavcan.resolve()).lower() in rep.lower()
633633

634634

635635
def _unittest_nested_roots() -> None:

0 commit comments

Comments
 (0)