Cart #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
pull_request: | |
branches: | |
- development | |
push: | |
branches: | |
- development | |
jobs: | |
lint: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Pull repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
- name: Install linting tools | |
run: python -m pip install --upgrade pip black flake8 | |
- name: Check Black formatting | |
run: python -m black --check . | |
- name: Check PEP8 compliance | |
run: python -m flake8 . | |
test: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Setup ROS 2 | |
uses: ros-tooling/[email protected] | |
with: | |
required-ros-distributions: foxy | |
- name: Update rosdep | |
run: rosdep update | |
- name: Pull repository | |
uses: actions/checkout@v2 | |
with: | |
path: src | |
- name: Install dependencies | |
run: rosdep install --from-paths src --ignore-src -r -y --rosdistro=foxy | |
- name: Install repository | |
run: colcon build | |
- name: Upload build logs | |
uses: actions/upload-artifact@v1 | |
if: always() | |
with: | |
name: build-logs | |
path: log/latest_build | |
- name: Run unit tests | |
run: | | |
. /opt/ros/foxy/setup.bash | |
colcon test | |
colcon test-result --verbose | |
- name: Upload unit test logs | |
uses: actions/upload-artifact@v1 | |
# Always upload logs even if other steps fail. | |
if: always() | |
with: | |
name: unit-test-logs | |
path: log/latest_test | |
- name: Run integration tests | |
run: | | |
. /opt/ros/foxy/setup.bash | |
. install/setup.bash | |
launch_test src/test/integ/ezrassor_controller_server/test_controller_server.py \ | |
--verbose >> log/latest_integ | |
- name: Upload integration test log | |
uses: actions/upload-artifact@v1 | |
# Always upload log even if other steps fail. | |
if: always() | |
with: | |
name: integration-test-log | |
path: log/latest_integ |