Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge release/omega (4.8.0) branch into master #232

Merged
merged 13 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
173 changes: 95 additions & 78 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,78 +1,95 @@
name: "CI: Run tests"
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- develop
- master
- "release/*"
jobs:
build:
defaults:
run:
shell: bash
working-directory: "/opt/carma/"
runs-on: ubuntu-latest
container:
image: usdotfhwastol/carma-base:carma-system-4.5.0
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:
path: src/${{ github.event.repository.name }}
fetch-depth: 0
- name: Move source code
run: mv $GITHUB_WORKSPACE/src /opt/carma/
- name: Checkout dependencies
run: |
./src/${{ github.event.repository.name }}/carma-messenger-core/docker/checkout.bash -r /opt/carma/
- name: Build Ros1
run: |
source "$INIT_ENV"
PACKAGES=$(find . -maxdepth 2 -type f -name package.xml | sed 's/\.\///' | cut -d/ -f1)
sed -i '/colcon build/ s/$/ --parallel-workers 4 --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 Ros1 C++ Tests
continue-on-error: true
run: |
source "$INIT_ENV"
sed -i '/colcon test/ s/$/ --parallel-workers 4 --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: Backup ROS1 compile_commands.json
run: |
mv /opt/carma/build/compile_commands.json /opt/carma/compile_commands.ros1.json
- name: Cleanup before ROS 2 build
# Clear the build and install folders before building ROS 2
run: |
rm -rf /opt/carma/install
rm -rf /opt/carma/build
- name: Build Ros2
run: |
source "$INIT_ENV"
source "$ROS_2_ENV"
PACKAGES=$(find . -maxdepth 2 -type f -name package.xml | sed 's/\.\///' | cut -d/ -f1)
sed -i '/colcon build/ s/$/ --parallel-workers 4 --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 Ros2 C++ Tests
continue-on-error: true
run: |
source "$INIT_ENV"
source "$ROS_2_ENV"
sed -i '/colcon test/ s/$/ --parallel-workers 4 --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: Combine ROS1 and ROS2 compile_commands.json files
continue-on-error: true
run: |
mv /opt/carma/build/compile_commands.json /opt/carma/compile_commands.ros2.json
jq -s add /opt/carma/compile_commands.ros1.json /opt/carma/compile_commands.ros2.json > /opt/carma/build/compile_commands.json
- 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 }}"
name: "CI: Run tests"
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- develop
- master
- "release/*"
jobs:
determine_docker_org_and_tag:
runs-on: ubuntu-latest
outputs:
docker_organization: ${{ steps.docker-org-and-tag.outputs.docker_organization }}
docker_image_tag: ${{ steps.docker-org-and-tag.outputs.docker_image_tag }}
steps:
- id: docker-org-and-tag
uses: usdot-fhwa-stol/actions/docker-org-and-tag@main
build:
needs: determine_docker_org_and_tag
defaults:
run:
shell: bash
working-directory: "/opt/carma/"
runs-on: ubuntu-latest
container:
image: ${{ needs.determine_docker_org_and_tag.outputs.docker_organization }}/carma-base:${{ needs.determine_docker_org_and_tag.outputs.docker_image_tag }}
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/checkout@v4
with:
path: src/${{ github.event.repository.name }}
fetch-depth: 0
- name: Move source code
run: mv $GITHUB_WORKSPACE/src /opt/carma/
- name: Determine base branch
id: determine-base-branch
run: |
if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
echo git_branch="$GITHUB_BASE_REF" >> $GITHUB_OUTPUT
else
echo git_branch="$GITHUB_REF_NAME" >> $GITHUB_OUTPUT
fi
- name: Checkout dependencies
run: |
./src/${{ github.event.repository.name }}/carma-messenger-core/docker/checkout.bash -r /opt/carma/ -b ${{ steps.determine-base-branch.outputs.git_branch }}
- name: Build Ros1
run: |
source "$INIT_ENV"
PACKAGES=$(find . -maxdepth 2 -type f -name package.xml | sed 's/\.\///' | cut -d/ -f1)
sed -i '/colcon build/ s/$/ --parallel-workers 4 --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 Ros1 C++ Tests
continue-on-error: true
run: |
source "$INIT_ENV"
sed -i '/colcon test/ s/$/ --parallel-workers 4 --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: Backup ROS1 compile_commands.json
run: |
mv /opt/carma/build/compile_commands.json /opt/carma/compile_commands.ros1.json
- name: Cleanup before ROS 2 build
# Clear the build and install folders before building ROS 2
run: |
rm -rf /opt/carma/install
rm -rf /opt/carma/build
- name: Build Ros2
run: |
source "$INIT_ENV"
source "$ROS_2_ENV"
PACKAGES=$(find . -maxdepth 2 -type f -name package.xml | sed 's/\.\///' | cut -d/ -f1)
sed -i '/colcon build/ s/$/ --parallel-workers 4 --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 Ros2 C++ Tests
continue-on-error: true
run: |
source "$INIT_ENV"
source "$ROS_2_ENV"
sed -i '/colcon test/ s/$/ --parallel-workers 4 --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: Combine ROS1 and ROS2 compile_commands.json files
continue-on-error: true
run: |
mv /opt/carma/build/compile_commands.json /opt/carma/compile_commands.ros2.json
jq -s add /opt/carma/compile_commands.ros1.json /opt/carma/compile_commands.ros2.json > /opt/carma/build/compile_commands.json
- 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 }}"
86 changes: 36 additions & 50 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,36 @@
name: Docker build
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# branch names with special characters cannot be used to create docker image tag,
# so removing all special characters and replacing them with - for valid docker image tag.
- name: Modify Branch Name
run: echo "MODIFIED_BRANCH_NAME=$(echo '${{ github.ref_name }}' | sed 's/[^a-zA-Z0-9]/-/g')" >> $GITHUB_ENV
- name: Print Modified Branch Name
run: echo "Modified the branch name to $MODIFIED_BRANCH_NAME"
- name: Build and Push carma-messenger-ui Docker Image
uses: docker/build-push-action@v3
with:
context: ./carma-messenger-ui/
push: true
tags: usdotfhwastol/carma-messenger-ui:${{ env.MODIFIED_BRANCH_NAME }}

- name: Build and Push carma-messenger-core Docker Image
uses: docker/build-push-action@v3
with:
context: ./carma-messenger-core/
push: true
tags: usdotfhwastol/carma-messenger-core:${{ env.MODIFIED_BRANCH_NAME }}

- name: Build and Push chevrolet_tahoe_2018 Docker Image
uses: docker/build-push-action@v3
with:
context: ./carma-messenger-config/chevrolet_tahoe_2018/
push: true
tags: usdotfhwastol/carma-messenger-config:${{ env.MODIFIED_BRANCH_NAME }}-chevrolet_tahoe_2018

- name: Build and Push development Docker Image
uses: docker/build-push-action@v3
with:
context: ./carma-messenger-config/development/
push: true
tags: usdotfhwastol/carma-messenger-config:${{ env.MODIFIED_BRANCH_NAME }}-development
name: Docker build
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push carma-messenger-ui Docker Image
uses: docker/build-push-action@v5
with:
context: ./carma-messenger-ui/
- name: Build and Push carma-messenger-core Docker Image
uses: docker/build-push-action@v5
with:
context: ./carma-messenger-core/
build-args: |
BRANCH=${{ github.base_ref }}
- name: Build and Push chevrolet_tahoe_2018 Docker Image
uses: docker/build-push-action@v5
with:
context: ./carma-messenger-config/chevrolet_tahoe_2018/

- name: Build and Push development Docker Image
uses: docker/build-push-action@v5
with:
context: ./carma-messenger-config/development/
Loading
Loading