added lifecycle manager to launcher #14
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: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
industrial_ci: | |
name: ROS ${{ matrix.ROS_DISTRO }} (${{ matrix.ROS_REPO }}) | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
ROS_DISTRO: [rolling] | |
ROS_REPO: [main] | |
include: | |
- {ROS_DISTRO: rolling, ROS_REPO: main} | |
env: | |
CCACHE_DIR: "/home/runner/target_ws/.ccache" | |
SONAR_SCANNER_VERSION: 4.4.0.2170 | |
SONAR_SERVER_URL: "https://sonarcloud.io" | |
# BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory | |
BUILD_WRAPPER_OUT_DIR: /home/runner/target_ws/ | |
ISOLATION: "shell" | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/cache@v2 | |
with: | |
path: ${{ env.CCACHE_DIR }} | |
key: ccache-${{ matrix.ROS_DISTRO }}-${{ matrix.ROS_REPO }}-${{github.run_id}} | |
restore-keys: | | |
ccache-${{ matrix.ROS_DISTRO }}-${{ matrix.ROS_REPO }}- | |
- uses: 'ros-industrial/industrial_ci@master' | |
env: | |
ROS_DISTRO: ${{ matrix.ROS_DISTRO }} | |
ROS_REPO: ${{ matrix.ROS_REPO }} | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
- name: Download and set up sonar-scanner | |
env: | |
SONAR_SCANNER_DOWNLOAD_URL: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ env.SONAR_SCANNER_VERSION }}-linux.zip | |
run: | | |
curl -sSLo /home/runner/target_ws/sonar-scanner.zip ${{ env.SONAR_SCANNER_DOWNLOAD_URL }} | |
unzip -o /home/runner/target_ws/sonar-scanner.zip -d /home/runner/target_ws/ | |
echo "/home/runner/target_ws/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin" >> $GITHUB_PATH | |
- name: Download and set up build-wrapper | |
env: | |
BUILD_WRAPPER_DOWNLOAD_URL: ${{ env.SONAR_SERVER_URL }}/static/cpp/build-wrapper-linux-x86.zip | |
run: | | |
curl -sSLo /home/runner/target_ws/build-wrapper-linux-x86.zip ${{ env.BUILD_WRAPPER_DOWNLOAD_URL }} | |
unzip -o /home/runner/target_ws/build-wrapper-linux-x86.zip -d /home/runner/target_ws/ | |
echo "/home/runner/target_ws/build-wrapper-linux-x86" >> $GITHUB_PATH | |
- name: Run build-wrapper | |
run: | | |
cd /home/runner/target_ws/ | |
rm -rf build log install | |
source /opt/ros/rolling/setup.bash | |
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} colcon build | |
- name: Run sonar-scanner | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: | | |
cd /home/runner/target_ws/ | |
sonar-scanner --define sonar.host.url="${{ env.SONAR_SERVER_URL }}" --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" \ | |
-Dsonar.projectKey=muttistefano_icp_nav_follow \ | |
-Dsonar.organization=muttistefano \ | |
-Dsonar.cfamily.threads=2 \ | |
-Dsonar.projectBaseDir=/home/runner/target_ws/ \ | |
-Dsonar.sources=src | |
- name: cccc action step | |
uses: sarnold/cccc-action@main | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: upload metrics report | |
uses: actions/upload-artifact@v2 | |
with: | |
name: metrics | |
path: ./metrics | |