Skip to content

Commit

Permalink
circle ci config update
Browse files Browse the repository at this point in the history
  • Loading branch information
saina-ramyar committed Aug 13, 2024
1 parent 4b64b78 commit d61e251
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
version: 2
# Copyright (C) 2018-2022 LEIDOS.
#
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
#
#

# Configuration file for Circle CI
# Configuration file for Circle CI
# CI will report failure if any executed command returns and error status
# Operations performed are as follows
# Build source code
Expand All @@ -34,6 +34,7 @@ jobs:
TERM: xterm # use xterm to get full display output from build
INIT_ENV: /home/carma/.base-image/init-env.sh
ROS_2_ENV: /opt/ros/foxy/setup.bash
COVERAGE_FLAGS: -g --coverage -fprofile-arcs -ftest-coverage -Wall
working_directory: "/opt/carma/"
resource_class: large
# Execution steps
Expand All @@ -47,7 +48,7 @@ jobs:
mkdir AutowareAuto
- checkout:
path: src/AutowareAuto
- run:
- run:
name: Pull Deps
command: |
source ${INIT_ENV}
Expand All @@ -63,11 +64,13 @@ jobs:
command: |
source ${INIT_ENV}
source ${ROS_2_ENV}
make_with_coverage.bash -t -e /opt/carma/ -o ./coverage_reports/gcov
export AUTOWARE_COMPILE_WITH_CUDA=1
colcon build --install-base ./ros/install --executor sequential --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_LIBRARY_PATH=/usr/local/cuda/lib64/stubs -DCMAKE_CXX_FLAGS="${COVERAGE_FLAGS}" -DCMAKE_C_FLAGS="${COVERAGE_FLAGS}"
# make_with_coverage.bash -t -e /opt/carma/ -o ./coverage_reports/gcov
# Run SonarCloud analysis
# PR Branchs and number extracted from Circle variables and github api
# Circle CI seems to make a change to the base branch, so we must fetch --force to ensure correct git file change stats
# SONAR_SCANNER_TOKEN MUST be secured as an environment variable in Circle CI NOT in this file.
# SONAR_SCANNER_TOKEN MUST be secured as an environment variable in Circle CI NOT in this file.
# The following sonar settings MUST be set in SonarCloud UI NOT in this file
# sonar.pullrequest.provider
# sonar.pullrequest.github.endpoint
Expand All @@ -81,7 +84,7 @@ jobs:
if [ -z "${CIRCLE_PULL_REQUEST}" ]; then
echo "Non-PR Build Detected. Running analysis on ${CIRCLE_BRANCH}"
cd src/AutowareAuto
sonar-scanner -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN}
sonar-scanner -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN}
exit 0;
fi
echo "PR branch ${CIRCLE_BRANCH}"
Expand All @@ -90,7 +93,7 @@ jobs:
export PR_NUM=`echo ${CIRCLE_PULL_REQUEST} | cut -d'/' -f7`
echo "PR number ${PR_NUM}"
export BASE_BRANCH_URL="https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/pulls/${PR_NUM}"
export TARGET_BRANCH=$(curl "$BASE_BRANCH_URL" | jq '.base.ref' | tr -d '"')
export TARGET_BRANCH=$(curl "$BASE_BRANCH_URL" | jq '.base.ref' | tr -d '"')
echo "Target Branch = ${TARGET_BRANCH}"
cd src/AutowareAuto
git fetch --force origin ${TARGET_BRANCH}:${TARGET_BRANCH}
Expand Down

0 comments on commit d61e251

Please sign in to comment.