Skip to content

Commit fb8284c

Browse files
authored
Added CICD pipelines (#112)
* Added pre-commit ci check * Integrated tox into ci * Attempt at fixing coverage report upload * Second attempt at uploading code coverage info * Removed attempts at uploading code coverage report * Added build checks * Added support for building and publishing to pypi * Fixed yaml formating error * Fixed repository url in publish action * Added separate pipeline for deployment * Attempting to resolve issue with pyyaml version * Deploy package to pypi * Removed testing branches from pipelines * Cleaned up readmes * Updated readme to include badges * Fixed pypi version badge link
1 parent 2a194c5 commit fb8284c

File tree

8 files changed

+120
-18
lines changed

8 files changed

+120
-18
lines changed

.devcontainer/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ RUN pip3 install \
4848
pre-commit \
4949
tox
5050

51+
# Install required packaging and deployment tools
52+
RUN pip3 install \
53+
build \
54+
twine \
55+
check-wheel-contents
56+
5157
# Install visualization tools
5258
RUN pip3 install \
5359
matplotlib \

.github/workflows/ci.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Continuous Integration
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- v*.*.*
9+
pull_request:
10+
types:
11+
- opened
12+
- edited
13+
- synchronize
14+
- reopened
15+
workflow_dispatch:
16+
17+
jobs:
18+
tests:
19+
name: Test implementation
20+
runs-on: ubuntu-latest
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
python-version: ["3.10"]
25+
steps:
26+
- uses: actions/checkout@v2
27+
- name: Set up Python ${{ matrix.python-version }}
28+
uses: actions/setup-python@v2
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
- name: Install dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
python -m pip install tox tox-gh-actions
35+
- name: Test implementation
36+
run: tox
37+
38+
package:
39+
name: Build & publish package
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v3
43+
- uses: actions/setup-python@v3
44+
with:
45+
python-version: "3.10"
46+
- run: python -m pip install build twine check-wheel-contents
47+
- run: python -m build --sdist --wheel .
48+
- run: ls -l dist
49+
- run: check-wheel-contents dist/*.whl
50+
- name: Check long_description
51+
run: python -m twine check dist/*

.github/workflows/deployment.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Deployment
2+
3+
on:
4+
push:
5+
tags:
6+
- v*.*.*
7+
workflow_dispatch:
8+
9+
jobs:
10+
release:
11+
name: Build & publish package
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: actions/setup-python@v3
16+
with:
17+
python-version: "3.10"
18+
- run: python -m pip install build twine check-wheel-contents
19+
- run: python -m build --sdist --wheel .
20+
- run: ls -l dist
21+
- run: check-wheel-contents dist/*.whl
22+
- name: Check long_description
23+
run: python -m twine check dist/*
24+
- name: Publish pymavswarm to PyPI
25+
uses: pypa/gh-action-pypi-publish@release/v1
26+
with:
27+
password: ${{ secrets.PYPI_API_TOKEN }}

MANIFEST.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
include LICENSE *.rst *.toml *.yml *.yaml *.ini
2+
graft .github
3+
4+
# Tests
5+
include tox.ini conftest.py
6+
recursive-include tests *.py

README.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# pymavswarm
22

3+
[![PyPI Version](https://img.shields.io/pypi/v/pymavswarm?color=gr)](https://pypi.org/project/pymavswarm/)
4+
[![Contribution Frequency](https://img.shields.io/github/commit-activity/m/unl-nimbus-lab/pymavswarm)](https://github.com/unl-nimbus-lab/pymavswarm/commits/main)
5+
[![Project License](https://img.shields.io/github/license/unl-nimbus-lab/pymavswarm)](https://github.com/unl-nimbus-lab/pymavswarm/blob/main/LICENSE)
6+
[![Open Issues](https://img.shields.io/github/issues/unl-nimbus-lab/pymavswarm?color=purple)](https://github.com/unl-nimbus-lab/pymavswarm/issues)
7+
38
## What is pymavswarm?
49

510
`pymavswarm` is a Python library implemented to enable interaction with drone
@@ -21,18 +26,20 @@ Here are some of the main features of `pymavswarm`:
2126
- Construct pre-planned missions
2227
- Multi-agent collision avoidance using reachability analysis
2328

24-
## Dependencies
29+
## Installation
2530

26-
`pymavswarm` depends on Python versions 3.10 or greater. Ensure that this
27-
dependency is met prior to installation.
31+
`pymavswarm` may be installed from
32+
[PyPI](https://pypi.org/project/pymavswarm/#description) by running
2833

29-
## Installation
34+
```bash
35+
pip3 install pymavswarm
36+
```
3037

31-
`pymavswarm` must currently be installed manually. To do so, refer to the steps
32-
below:
38+
To build `pymavswarm` from source, first ensure that at least Python 3.10 is
39+
installed. Once this dependency has been met, refer to the steps below:
3340

34-
1. Clone this repository
35-
2. Navigate to the `pymavswarm/` repository directory
41+
1. Clone the project [repository](https://github.com/unl-nimbus-lab/pymavswarm)
42+
2. Navigate to the `pymavswarm/` base directory
3643

3744
```bash
3845
cd path/to/pymavswarm/
@@ -48,8 +55,8 @@ pip3 install .
4855

4956
`pymavswarm` has been implemented to enable easy interfacing with drone
5057
swarms. Refer to the following code snippet for a simple example to get started
51-
with the library. Additional examples may be found in the `pymavswarm/examples`.
52-
directory.
58+
with the library. Additional examples may be found in the project
59+
[examples](https://github.com/unl-nimbus-lab/pymavswarm/tree/main/examples).
5360

5461
```python
5562
import time
@@ -88,7 +95,7 @@ board!
8895
## Contributing
8996

9097
All contributions and ideas are welcome! Detailed guidelines regarding how to
91-
contribute can be found in the `.github/CONTRIBUTING.md` document.
98+
contribute can be found in the [contribution guidelines](https://github.com/unl-nimbus-lab/pymavswarm/blob/main/.github/CONTRIBUTING.md).
9299

93100
## License
94101

examples/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ Several examples have been implemented to demonstrate how to use and extend the
66
- `arming.py`: demonstrates how to arm and disarm swarm agents.
77
- `check_state.py`: demonstrates how to check the state of swarm agents; also
88
demonstrates how to log data to a log file.
9-
- `custom_observer.py`: demonstrates how to implement an observer for an agent
10-
state change event.
9+
- `collision_prevention_no_flight.py`: demonstrates how to accomplish collision
10+
avoidance without requiring drone flight. This can be used to tune the
11+
collision avoidance parameters.
12+
- `collision_prevention.py`: demonstrates how to use perform collision avoidance
13+
on agents.
1114
- `goto.py`: demonstrates how to command an agent to fly to a specified location
1215
using a configuration file; an example configuration file is provided in
1316
`resources/goto.yaml`.

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = pymavswarm
3-
version = 0.1.0
3+
version = 0.1.0b2
44
description = Python library used to communicate with multiple UAS simultaneously using MAVLink
55
long_description = file: README.md
66
long_description_content_type = text/markdown

tox.ini

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,20 @@
22
isolated_build = True
33
envlist =
44
lint
5-
py{310}
65
coverage-report
6+
py310
7+
8+
[gh-actions]
9+
python =
10+
3.10: py310
711

812
[testenv]
913
deps = coverage
1014
commands = coverage run -m unittest
1115

1216
[testenv:coverage-report]
1317
deps = coverage
14-
commands =
15-
coverage combine
16-
coverage report
18+
commands = coverage report --skip-covered --skip-empty
1719

1820
[testenv:lint]
1921
skip_install = true

0 commit comments

Comments
 (0)