Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/RJD-1057-remove-functions-forwar…
Browse files Browse the repository at this point in the history
…ded-to-entity-base-refactor' into ref/RJD-1057-improve-responsibility-simulator-core-api
  • Loading branch information
dmoszynski committed Oct 14, 2024
2 parents 98c1866 + 508e3f0 commit 6fe1268
Show file tree
Hide file tree
Showing 243 changed files with 33,891 additions and 2,751 deletions.
47 changes: 42 additions & 5 deletions .github/workflows/BuildAndRun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ on:
push:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
job1:
name: BuildAndRun
Expand All @@ -31,6 +34,7 @@ jobs:
matrix:
rosdistro: [humble]
runs_on: [ubuntu-22.04] # macos-14 is added for arm support. See also https://x.com/github/status/1752458943245189120?s=20
cmake_build_type: [RelWithDebInfo, Release] # Debug build type is currently unavailable. @TODO Fix problem and add Debug build.
steps:
- name: Suppress warnings
run: git config --global --add safe.directory '*'
Expand Down Expand Up @@ -61,27 +65,45 @@ jobs:
run: |
vcs import src < src/scenario_simulator_v2/dependency_${{ matrix.rosdistro }}.repos
- name: Resolve rosdep
- name: Resolve rosdep and install colcon mixin
run: |
apt-get update
apt-get install -y python3-pip
apt-get install -y python3-pip python3-colcon-lcov-result lcov unzip
rosdep update --include-eol-distros
rosdep install -iy --from-paths src --rosdistro ${{ matrix.rosdistro }}
colcon mixin add default https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml
colcon mixin update default
shell: bash

- name: Build packages
- name: Install sonar-scanner and build-wrapper
uses: sonarsource/sonarcloud-github-c-cpp@v3
env:
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}

- name: Build with SonarCloud Build Wrapper
run: |
source /opt/ros/${{ matrix.rosdistro }}/setup.bash
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release -DBUILD_CPP_MOCK_SCENARIOS=ON --packages-up-to ${{ steps.list_packages.outputs.package_list }}
build-wrapper-linux-x86-64 --out-dir src/scenario_simulator_v2/bw-output \
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} -DBUILD_CPP_MOCK_SCENARIOS=ON -DBUILD_TESTING=true -DCMAKE_CXX_FLAGS='-fprofile-arcs -ftest-coverage' -DCMAKE_C_FLAGS='-fprofile-arcs -ftest-coverage' --packages-up-to ${{ steps.list_packages.outputs.package_list }}
shell: bash

- name: Colcon test
run: |
source /opt/ros/${{ matrix.rosdistro }}/setup.bash
source install/local_setup.bash
colcon test --packages-select ${{ steps.list_packages.outputs.package_list }}
colcon test --event-handlers console_cohesion+ --packages-select ${{ steps.list_packages.outputs.package_list }}
colcon lcov-result --packages-select ${{ steps.list_packages.outputs.package_list }}
shell: bash

- name: Collect and run gcov on coverage data
run: |
mkdir -p ./gcov && \
find ./build -name "*.gcda" -o -name "*.gcno" | \
while read -r line; do \
gcov -o $(dirname "$line") $(echo "$line" | sed 's/\.gcda$/.cpp/;s/\.gcno$/.cpp/;s/\.gcda$/.hpp/;s/\.gcno$/.hpp/'); \
done && mv *.gcov ./gcov/

- name: Show test result
if: always()
run: |
Expand All @@ -97,6 +119,21 @@ jobs:
./src/scenario_simulator_v2/.github/workflows/workflow.sh ./src/scenario_simulator_v2/test_runner/scenario_test_runner/config/workflow.txt global_frame_rate:=20
shell: bash

- name: Upload Lcov result
uses: actions/upload-artifact@v4
with:
name: lcov-${{ matrix.cmake_build_type }}
path: lcov
retention-days: 1

- name: Run SonarCloud scan
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: https://sonarcloud.io/
working-directory: src/scenario_simulator_v2/
run: sonar-scanner --define sonar.cfamily.compile-commands="bw-output/compile_commands.json"

# - name: Basic test
# run: |
# source install/setup.bash
Expand Down
81 changes: 81 additions & 0 deletions .github/workflows/Docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Docker
on:
pull_request:
paths:
- "**"
- "!docs/**"
- "!README.md"
- "!CONTRIBUTING.md"
- "!.github/**"
- ".github/workflows/Docker.yaml"
- "!mkdocs.yml"
- "!pyproject.toml"
- "!poetry.lock"
workflow_dispatch:
inputs:
version:
description: version of the scenario_simulator_v2
required: true

jobs:
push_docker:
name: Push Docker Image
runs-on: ubuntu-22.04
timeout-minutes: 720
strategy:
matrix:
rosdistro: [humble]
arch: [amd64]
# Build test for arm64 CPU is broken.
# This is a temporary solution and will be repaired in the future.
# See also https://github.com/tier4/scenario_simulator_v2/pull/1295
# arch: [amd64, arm64]
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false

- name: Install docker for ubuntu runner
uses: docker/setup-buildx-action@v3

- name: Install QEMU
uses: docker/setup-qemu-action@v3

- uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build (${{ matrix.arch }})
if: github.event_name == 'pull_request'
uses: docker/bake-action@v3
with:
files: |
./docker-bake.hcl
workdir: .
set: |
*.cache-to=type=gha,mode=max
*.cache-from=type=gha
push: false
targets: |
${{ matrix.rosdistro }}_base_${{ matrix.arch }}
- name: Build and push (${{ matrix.arch }})
if: github.event_name == 'workflow_dispatch'
uses: docker/bake-action@v3
with:
files: |
./docker-bake.hcl
workdir: .
set: |
*.cache-to=type=gha,mode=max
*.cache-from=type=gha
*.tags=ghcr.io/tier4/scenario_simulator_v2:humble-${{ github.event.inputs.version }}
push: true
targets: |
${{ matrix.rosdistro }}_base_${{ matrix.arch }}
60 changes: 12 additions & 48 deletions .github/workflows/Release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
uses: levonet/action-restore-branch@master

- name: Install bloom
run: apt update && apt install -y python3-bloom git
run: apt update && apt install -y python3-bloom git curl

- name: Checkout
uses: actions/checkout@v4
Expand All @@ -50,7 +50,7 @@ jobs:
git config --global user.name "Release Bot"
git config --global user.email "[email protected]"
git config --global --add safe.directory /__w/scenario_simulator_v2/scenario_simulator_v2
git config --global credential.helper ${{ secrets.GITHUB_TOKEN }}
git config --global credential.helper ${{ secrets.BLOOM_GITHUB_TOKEN }}
git config pull.rebase false
- name: Get old version
Expand Down Expand Up @@ -142,50 +142,14 @@ jobs:
repo: context.repo.repo,
ref: `heads/${context.payload.pull_request.head.ref}`,
})
push_docker:
needs: release
name: Push Docker Image
runs-on: ubuntu-22.04
timeout-minutes: 720
strategy:
matrix:
rosdistro: [humble]
arch: [amd64]
# Build test for arm64 CPU is broken.
# This is a temporary solution and will be repaired in the future.
# See also https://github.com/tier4/scenario_simulator_v2/pull/1295
# arch: [amd64, arm64]
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false

- name: Install docker for ubuntu runner
uses: docker/setup-buildx-action@v3

- name: Install QEMU
uses: docker/setup-qemu-action@v3

- uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push (${{ matrix.arch }})
uses: docker/bake-action@v3
with:
files: |
./docker-bake.hcl
workdir: .
set: |
*.cache-to=type=gha,mode=max
*.cache-from=type=gha
*.tags=ghcr.io/tier4/scenario_simulator_v2:humble-${{ needs.release.outputs.new_version }}
push: ${{ github.event.pull_request.merged == true }}
targets: |
${{ matrix.rosdistro }}_base_${{ matrix.arch }}
- name: Kick docker build action
if: github.event.pull_request.merged == true
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token ${{ secrets.BLOOM_GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/tier4/scenario_simulator_v2/actions/workflows/Docker.yaml/dispatches \
-d '{"ref":"master","inputs":{"version":"${{ steps.new_version.outputs.new_version }}"}}'
11 changes: 6 additions & 5 deletions .github/workflows/custom_spell.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"AUTORCC",
"Canonicalized",
"canonicalizing",
"cfamily",
"classname",
"Cmyk",
"Dawid",
"DBOOST",
"DBUILD",
Expand All @@ -14,11 +16,10 @@
"DWITH_INTEGRATION_TEST",
"engageable",
"euclidian",
"hakuturu",
"Kataoka",
"gcda",
"gcno",
"libunwind",
"linelint",
"Masaya",
"Mersenne",
"Monic",
"Moszynski",
Expand All @@ -40,8 +41,8 @@
"TESTRANDOMIZER",
"travelling",
"Tschirnhaus",
"walltime",
"xerces",
"xercesc",
"yamacir-kit"
"xercesc"
]
}
8 changes: 2 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@ SHELL ["/bin/bash", "-c"]
ENV DEBIAN_FRONTEND=noninteractive
ENV DEBCONF_NOWARNINGS=yes

RUN --mount=type=cache,id=apt-cache-amd64,target=/var/cache/apt,sharing=locked \
--mount=type=cache,id=apt-lib-amd64,target=/var/lib/apt,sharing=locked \
apt-get update && apt-get -y install python3-pip python3-rospkg python3-rosdep software-properties-common ccache
# cspell: ignore kisak
RUN --mount=type=cache,id=apt-cache-amd64,target=/var/cache/apt,sharing=locked \
--mount=type=cache,id=apt-lib-amd64,target=/var/lib/apt,sharing=locked \
add-apt-repository ppa:kisak/kisak-mesa -y
RUN --mount=type=cache,id=apt-cache-amd64,target=/var/cache/apt,sharing=locked \
--mount=type=cache,id=apt-lib-amd64,target=/var/lib/apt,sharing=locked \
apt-get update && apt-get -y install python3-pip python3-rospkg python3-rosdep software-properties-common ccache && \
add-apt-repository ppa:kisak/kisak-mesa -y && \
apt-get update && apt-get install libegl-mesa0 -y

RUN rm -f /etc/apt/apt.conf.d/docker-clean && \
Expand Down
Loading

0 comments on commit 6fe1268

Please sign in to comment.