forked from OpenCyphal/pycyphal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.appveyor.yml
114 lines (108 loc) · 4.7 KB
/
.appveyor.yml
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
environment:
matrix:
-
job_group: tests
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PYTHON: 'C:\Python310-x64' # YAML treats '\\' and "\\" differently.
-
job_group: tests
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
PYTHON: '3.10'
-
job_group: tests
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
PYTHON: '3.9'
-
job_group: tests
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
PYTHON: '3.8'
-
job_group: tests
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
PYTHON: '3.7'
-
job_name: deploy
job_depends_on: tests
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
PYTHON: '3.10'
GIT_TOKEN:
secure: +jQhxLpePj6hdDryfET/XpLo7VL9fhDXVHlwLOPp/nRDYe97TJAfd0XCTuPz1qkT
TWINE_USERNAME: __token__
TWINE_PASSWORD:
secure: +ZVhECKV0ESBrvUGXVd9wnMU9JR2gXSrDCIE1G7ZrW1DuWWzPDmIVMh4LtZafGQEddc0yR7X5q947f+nmPNLg/XSMwd4CKM8xRN+47RgaIpUMD5QIJzIxgk678w+hb4ZmS9J8aAodu0kMn7cz53iFeliGCYwGY37D/JRTs9i6P8Q+xf06KFHiNcLLqoqMLlLcWrLx7hBPlFwVpv2NiEtSmNSM/Z6iizcbYh08wcUK0w=
SONARCLOUD_TOKEN:
secure: WhIOqdzyx8VkpAsNjwy4O+OiAQ4FzUu8d1sFcQ7xz8DlFABiNajhPv0lhc1Dpz7G
COVERALLS_REPO_TOKEN:
secure: m5OF/cgvFDa+BwWDJVJ/xcMoqkQoyNIhWU1+Ckc8Vr0r6L/V3S8FUTO7fFgMeLQC
stack: python %PYTHON%
build: off
skip_tags: true
for:
- # WINDOWS TEST
matrix:
only:
- job_group: tests
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
install:
- 'systeminfo'
# Configure Npcap. This is for testing the packet capture functionality in the Cyphal/UDP transport.
- '.test_deps\npcap-0.96.exe /loopback_support=yes /winpcap_mode=yes /S'
# Installation of the NDIS filter driver from Npcap may have disrupted network connectivity, as explained in
# https://github.com/nmap/npcap/issues/215. Also, a restart appears to be necessary to enable the NPF service.
# Therefore, we restart the VM as suggested in https://github.com/appveyor/ci/issues/3491.
- 'shutdown /r /f /t 5'
- 'timeout 30' # Boot-up delay. This should be sufficient for the VM to get ready. Increase if not.
- 'route print & ipconfig /all'
# Due to the reboot, all volatile configuration like environment variables is lost here. We need to set it up now.
- 'set PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%'
- 'echo %PATH%'
- 'git submodule update --init --recursive'
- 'python -m pip install --upgrade pip setuptools nox'
test_script:
# FIXME on Windows we only test against the OLDEST and the NEWEST version of Python because we run out of time.
# FIXME restructure the workflow or migrate to GitHub Actions.
- 'nox --forcecolor --non-interactive --error-on-missing-interpreters --pythons 3.7 3.10 --session test pristine'
- # GNU/LINUX TEST
matrix:
only:
- job_group: tests
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
install:
- 'export extras_pkg="linux-*-extra-$(uname -r)"'
# Graphviz is needed for the docs, ncat is needed for testing the Cyphal/serial transport.
- 'sudo apt-get install -y $extras_pkg graphviz ncat'
- 'git submodule update --init --recursive'
- 'python -m pip install --upgrade pip setuptools nox'
# Sonar scanner unconditionally fails on PR builds with a NullPointerException, so don't run it there.
- '[[ -z "$APPVEYOR_PULL_REQUEST_HEAD_COMMIT" ]] || unset SONARCLOUD_TOKEN'
test_script:
- 'nox --non-interactive --error-on-missing-interpreters --session test pristine --python $PYTHON'
- 'nox --non-interactive --session demo check_style docs'
on_finish:
- 'ip link show' # Diagnostics aid
- # DEPLOYMENT
matrix:
only:
- job_name: deploy
branches:
only:
- master
install:
- git submodule update --init --recursive
- python -m pip install --upgrade pip setuptools wheel twine
deploy_script:
# Ensure we deploy only from master, not from PR builds.
- '[[ "$APPVEYOR_REPO_BRANCH" == "master" ]] && [[ -z "$APPVEYOR_PULL_REQUEST_HEAD_COMMIT" ]] || exit'
# Configure git credentials.
- echo "https://${GIT_TOKEN}:[email protected]" > ~/.git-credentials
- git config --global credential.helper store
- git config --global user.email "[email protected]"
- git config --global user.name "Release Automation"
# Tag and publish this release. Push the tag after the release is out in case it could not be published.
- |
git tag "$(PYTHONPATH=pycyphal python -c 'from _version import __version__; print(__version__)')"
python setup.py sdist bdist_wheel
python -m twine upload dist/*
git push --tags
artifacts:
- path: '.nox/*/*/*.log'