Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoferigo committed May 20, 2021
1 parent e5c6566 commit 610cedf
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,12 @@ jobs:
if: matrix.type == 'User' && matrix.ignition != 'edifice'
shell: bash -i -e {0}
run: |
pip install setuptools-scm cmake-build-extension
pip install wheel setuptools-scm cmake-build-extension
python3 ./scenario/setup.py bdist_wheel \
build_ext -DIGNITION_DISTRIBUTION=$(python3 -c "print('${{ matrix.ignition }}'.capitalize())")
- name: '[👤|user] Install local wheel'
if: matrix.type == 'User'
run: pip install -v dist/scenario*.whl
run: pip install -v dist/scenar-io-*.whl

- name: '🔍️ Inspect installed ScenarIO package'
if: matrix.type == 'User' && contains(matrix.os, 'ubuntu')
Expand All @@ -277,40 +277,38 @@ jobs:
# ====================

- name: '🐍 Install gym-ignition'
run: pip install wheel && pip install .[test,website]
run: pip install .[test,website]

# ============
# Test project
# ============

- name: '[🐍|scenario] Python Tests'
shell: bash -i -e {0}
run: |
cd tests
pytest -m "scenario"
working-directory: tests
run: pytest -m "scenario"

- name: '[🚨|scenario] Python Tests with Valgrind'
shell: bash -i -e {0}
working-directory: tests
if: failure()
run: |
sudo apt-get install -y --no-install-recommends valgrind
pip install colour-valgrind
cd tests
valgrind --log-file=/tmp/valgrind.log pytest -s -m "scenario" || colour-valgrind -t /tmp/valgrind.log
- name: '[🐍|gym-ignition] Python Tests'
shell: bash -i -e {0}
run: |
cd tests
pytest -m "gym_ignition"
working-directory: tests
run: pytest -m "gym_ignition"

- name: '[🚨|gym-ignition] Python Tests with Valgrind'
shell: bash -i -e {0}
working-directory: tests
if: failure()
run: |
sudo apt-get install -y --no-install-recommends valgrind
pip install colour-valgrind
cd tests
valgrind --log-file=/tmp/valgrind.log pytest -s -m "gym_ignition" || colour-valgrind -t /tmp/valgrind.log
# ============================
Expand All @@ -319,7 +317,7 @@ jobs:

- name: '🗑️ Remove external wheels'
if: matrix.type == 'User'
run: find dist/ -type f -not -name 'scenario-*' -delete -print
run: find dist/ -type f -not -name 'scenar_io-*' -delete -print

# We have to trick PyPI that our wheels are manylinux2014 even if they are not.
# Unfortunately we cannot create self-contained wheels due to the Ignition architecture.
Expand Down Expand Up @@ -433,8 +431,8 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: '🐍 Install sdist dependencies'
run: pip install wheel setuptools-scm cmake-build-extension
- name: '⬇️️ Install dependencies'
run: pip install build

- name: '🔀 Clone repository'
uses: actions/checkout@master
Expand All @@ -459,20 +457,23 @@ jobs:
# ===============

- name: '[📦|scenario]️ Create sdist'
run: python3 scenario/setup.py sdist
run: python -m build --sdist scenario/

- name: '[📦|gym-ignition]️ Create sdist'
run: python3 setup.py sdist
run: python -m build --sdist .

- name: '[📦|gym-ignition]️ Create wheel'
run: pip wheel --find-links=dist/ -w dist/ .
run: python -m build --wheel .

# ================
# Upload artifacts
# ================

- name: '🗑️ Remove external wheels'
run: find dist/ -type f -not \( -name '*scenario-*' -o -name '*gym_ignition-*' -o -name 'gym-ignition-*' \) -delete -print
run: find dist/ -type f -not \( -name '*scenario-*' -o -name '*scenar_io-*' -o -name 'gym-ignition-*' -o -name '*gym_ignition-*' \) -delete -print

- name: '🔍 Check packages'
run: pipx run twine check dist/*

- name: '🔍 Inspect dist folder'
run: ls -lah dist/
Expand Down

0 comments on commit 610cedf

Please sign in to comment.