1image: ubuntu:bionic
2
3pipelines:
4  default:
5    - step:
6        script:
7          # Dependencies
8          - apt update
9          - apt -y install wget lsb-release gnupg
10          - sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
11          - sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-prerelease `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-prerelease.list'
12          - wget http://packages.osrfoundation.org/gazebo.key -O - | apt-key add -
13          - apt-get update
14          - apt -y install cmake build-essential curl git mercurial g++-8 libtinyxml-dev libxml2-utils ruby-dev python-psutil cppcheck
15          - update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8 --slave /usr/bin/gcov gcov /usr/bin/gcov-8
16          - gcc -v
17          - g++ -v
18          - gcov -v
19          # lcov
20          - git clone https://github.com/linux-test-project/lcov.git
21          - cd lcov
22          - make install
23          - cd ..
24          # Static checking before building - fail fast
25          - sh tools/code_check.sh
26          # Dependency: Ignition packages
27          - apt-get -y install
28            libignition-cmake2-dev libignition-tools-dev libignition-math6-dev
29          # SDFormat
30          - mkdir build
31          - cd build
32          - cmake .. -DCMAKE_BUILD_TYPE=coverage
33          - make -j4
34          - export CTEST_OUTPUT_ON_FAILURE=1
35          - make test
36          - make coverage
37          # Use a special version of codecov for handling gcc8 output.
38          - bash <(curl -s https://raw.githubusercontent.com/codecov/codecov-bash/4678d212cce2078bbaaf5027af0c0dafaad6a095/codecov) -X gcovout 2>/dev/null
39          - make install
40          # Examples
41          - cd ..
42          - cd examples
43          - mkdir build
44          - cd build
45          - cmake ..
46          - make -j4
47          - ./simple ../simple.sdf
48