Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 259 - Create GH Actions workflow to replace AppVeyor #303

Merged
merged 18 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 0 additions & 114 deletions .appveyor.yml

This file was deleted.

120 changes: 120 additions & 0 deletions .github/workflows/make-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: 'PyCyphal application builder'
clyde-johnston marked this conversation as resolved.
Show resolved Hide resolved

# Builds OpenCyphal PyCyphal release
clyde-johnston marked this conversation as resolved.
Show resolved Hide resolved
on:
push:
branches:
- master
pull_request:
branches:
- master
clyde-johnston marked this conversation as resolved.
Show resolved Hide resolved

# Ensures that only one workflow is running at a time
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
#
# PyCyphal test
#
pycyphal-test:
name: Test PyCyphal
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-2019-npcap]
clyde-johnston marked this conversation as resolved.
Show resolved Hide resolved
python: ['3.7', '3.8', '3.9', '3.10']
runs-on: ${{ matrix.os }}
steps:
# Checkout pycyphal repository
- name: Check out
uses: actions/checkout@v3

# Install Python version needed for test
- name: Install Python3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}

# Log Python version
- name: Log Python version
run: python --version

# Install test dependencies
- name: Install dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get install -y linux-*-extra-$(uname -r) graphviz ncat
fi
git submodule update --init --recursive
python -m pip install --upgrade pip setuptools nox
shell: bash

# Log system and network configurations
- name: Collect Linux diagnostic data
if: ${{ runner.os == 'Linux' }}
run: ip link show

- name: Collect Windows diagnostic data
if: ${{ runner.os == 'Windows' }}
run: |
systeminfo
route print
ipconfig /all

# Run build and test suite
- name: Run build and test
run: |
nox --non-interactive --error-on-missing-interpreters --session test pristine --python ${{ matrix.python }}
nox --non-interactive --session demo check_style docs

# Save logs
- name: Save logs
uses: actions/upload-artifact@v3
with:
name: PyCyphal-${{ matrix.os }}-python-${{ matrix.python }}
path: .nox/*/*/*.log
retention-days: 7

#
# Create release
#
pycyphal-release:
name: Release PyCyphal
if: (github.event_name == 'push') && (github.ref == 'refs/heads/master')
needs: pycyphal-test
runs-on: ubuntu-latest
steps:
# Checkout code from GitHub
- name: Check out
uses: actions/checkout@v3

# Build distribution from source
- name: Install dependencies
run: |
git submodule update --init --recursive
python -m pip install --upgrade pip setuptools wheel twine
python setup.py sdist bdist_wheel

# Obtain release version number
- name: Get release version
run: |
cd pycyphal
echo "pycyphal_version=$(python -c 'from _version import __version__; print(__version__)')" >> $GITHUB_ENV

# Upload distribution to pypi.org
- name: Upload distribution
run: |
python -m twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN_PYCYPHAL }}

# Tag release
- name: Push version tag
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ env.pycyphal_version }}
tag_prefix: ''
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,4 @@ overgeneral-exceptions=BaseException
[doc8]
ignore-path = docs/api,./.nox,./pycyphal.egg-info
max-line-length = 120
ignore = D000
ignore = D000,D002,D004