-
Notifications
You must be signed in to change notification settings - Fork 3
50 lines (50 loc) · 1.75 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: CI
#test
on:
push:
pull_request:
jobs:
build:
defaults:
run:
shell: bash
working-directory: "/opt/carma/"
runs-on: ubuntu-latest
container:
image: usdotfhwastoldev/carma-base:develop
env:
INIT_ENV: "/home/carma/.base-image/init-env.sh"
ROS_2_ENV: "/opt/ros/foxy/setup.bash"
TERM: xterm
options: "--user root"
steps:
- name: Checkout ${{ github.event.repository.name }}
uses: actions/[email protected]
with:
fetch-depth: 0
path: src/${{ github.event.repository.name }}
- name: Move source code
run: mv $GITHUB_WORKSPACE/src /opt/carma/
- name: Checkout dependencies
run: |
source "$INIT_ENV"
source "$ROS_2_ENV"
./src/${{ github.event.repository.name }}/docker/checkout.bash -r /opt/carma/
- name: Build
run: |
source "$INIT_ENV"
source "$ROS_2_ENV"
PACKAGES=$(find . -maxdepth 5 -type f -name package.xml | sed 's/\.\///' | cut -d/ -f1)
sed -i '/colcon build/ s/$/ --packages-up-to $PACKAGES/' /home/carma/.ci-image/engineering_tools/code_coverage/make_with_coverage.bash
make_with_coverage.bash -m -e /opt/carma/ -o ./coverage_reports/gcov
- name: Run C++ Tests
run: |
source "$INIT_ENV"
source "$ROS_2_ENV"
sed -i '/colcon test/ s/$/ --packages-above $PACKAGES/' /home/carma/.ci-image/engineering_tools/code_coverage/make_with_coverage.bash
make_with_coverage.bash -t -e /opt/carma/ -o ./coverage_reports/gcov
- name: Run SonarScanner
uses: usdot-fhwa-stol/actions/sonar-scanner@main
with:
sonar-token: ${{ secrets.SONAR_TOKEN }}
working-dir: "/opt/carma/src/${{ github.event.repository.name }}"