Skip to content

Commit

Permalink
Update CI/CD pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoferigo committed Jul 2, 2021
1 parent fd2e871 commit ccfacbf
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ jobs:
build_sdist:
name: Build source distribution
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python-version:
- 3.8

steps:

Expand All @@ -30,35 +25,33 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
python-version: 3.8

- name: Install sdist dependencies
run: pip install wheel setuptools_scm cmake_build_extension
run: pip install build

- name: Create sdist
run: python setup.py sdist
run: python -m build --sdist .

- uses: actions/upload-artifact@v2
with:
path: dist/*.tar.gz
name: dist

test_sdist:
name: Test source distribution
needs: [ build_sdist ]
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python-version:
- 3.8
- 3.9

steps:

- uses: actions/checkout@master
- uses: actions/download-artifact@v2
with:
name: artifact
path: dist
- run: git fetch --prune --unshallow

- name: Set up Python
uses: actions/setup-python@v2
Expand All @@ -71,42 +64,49 @@ jobs:
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 libprotobuf17
pip install wheel
env:
CHANNEL: stable
IGNITION_DISTRIBUTION: dome
IGNITION_DISTRIBUTION: edifice

- name: Install sdist
run: pip -v install dist/*.tar.gz
- name: Install Python package
run: pip install .[all]

- name: Run tests
run: pip install pytest && pytest 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 tests
colour-valgrind pytest .
env:
IGN_GAZEBO_PHYSICS_ENGINE_PATH: /usr/lib/x86_64-linux-gnu

upload_pypi:
name: Publish to PyPI
needs: [ test_sdist ]
needs:
- build_sdist
- test_sdist
runs-on: ubuntu-20.04
# Master branch produces pre-releases.
# Tagged versions produce stable releases linked to GitHub releases.
if: |
github.repository == 'dic-iit/gazebo-scenario-plugins' &&
((github.event_name == 'release' && github.event.action == 'published') ||
(github.event_name == 'push' && github.ref == 'refs/heads/master'))

steps:

- uses: actions/download-artifact@v2
with:
name: artifact
name: dist
path: dist

- name: Publish to PyPI
if: |
github.repository == 'dic-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 }}
Expand Down

0 comments on commit ccfacbf

Please sign in to comment.