Skip to content

Merge pull request #11 from ami-iit/change-license #136

Merge pull request #11 from ami-iit/change-license

Merge pull request #11 from ami-iit/change-license #136

Workflow file for this run

name: CI/CD
on:
push:
branches: ['**']
tags-ignore: ['**']
pull_request:
workflow_dispatch:
release:
types: [published]
jobs:
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- run: git fetch --prune --unshallow
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install sdist dependencies
run: pip install build
- name: Create sdist
run: python -m build --sdist .
- uses: actions/upload-artifact@v2
with:
path: dist/*.tar.gz
name: dist
test_sdist:
name: Test source distribution
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- 3.8
- 3.9
steps:
- uses: actions/checkout@master
- run: git fetch --prune --unshallow
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install build dependencies
run: |
wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
sudo apt-add-repository "deb http://packages.osrfoundation.org/gazebo/ubuntu-$CHANNEL `lsb_release -cs` main"
sudo apt-get update
sudo apt-get install ignition-$IGNITION_DISTRIBUTION
pip install wheel
env:
CHANNEL: stable
IGNITION_DISTRIBUTION: fortress
- name: Install Python package
run: pip install .[all]
- name: Run tests
run: pytest
env:
IGN_GAZEBO_PHYSICS_ENGINE_PATH: /usr/lib/x86_64-linux-gnu
- name: Valgrind
if: failure()
run: |
sudo apt install valgrind
pip install colour-valgrind
colour-valgrind pytest .
env:
IGN_GAZEBO_PHYSICS_ENGINE_PATH: /usr/lib/x86_64-linux-gnu
upload_pypi:
name: Publish to PyPI
needs:
- build_sdist
- test_sdist
runs-on: ubuntu-latest
# Master branch produces pre-releases.
# Tagged versions produce stable releases linked to GitHub releases.
steps:
- uses: actions/download-artifact@v2
with:
name: dist
path: dist
- name: Inspect dist folder
run: ls -lah dist/
- name: Publish to PyPI
if: |
github.repository == 'ami-iit/gazebo-scenario-plugins' &&
((github.event_name == 'release' && github.event.action == 'published') ||
(github.event_name == 'push' && github.ref == 'refs/heads/master'))
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.pypi_password }}
skip_existing: true