Some renaming + update_statistics -> publish_statistics + agent tool docs + timeout reply [19297][19276] #1132
Workflow file for this run
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: test | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 1 * * *' | |
jobs: | |
windows-build-test: | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
cmake-config: | |
- 'Release' | |
- 'Debug' | |
env: | |
CXXFLAGS: /MP | |
OPENSSL64_ROOT: "C:/Program Files/OpenSSL-Win64" | |
steps: | |
- name: Sync eProsima/AML-IP repository | |
uses: actions/checkout@v2 | |
with: | |
path: AML-IP | |
- name: Install OpenSSL | |
uses: ./AML-IP/.github/actions/install-openssl-windows | |
- name: Install yaml-cpp | |
uses: ./AML-IP/.github/actions/install-yamlcpp-windows | |
with: | |
cmake_build_type: ${{ matrix.cmake-config }} | |
- name: Install GTest | |
uses: ./AML-IP/.github/actions/install-gtest-windows | |
with: | |
cmake_build_type: ${{ matrix.cmake-config }} | |
- name: Get build eProsima dependencies Job Id | |
shell: pwsh | |
run: | | |
$secret = ConvertTo-SecureString -String "${{ secrets.GITHUB_TOKEN }}" -AsPlainText | |
$RUNS_URI = '${{ github.api_url }}/repos/${{ github.repository }}/actions/workflows/build_eprosima_dependencies.yml/runs' | |
# Check available queries according with github policy | |
"::group::Rate Limits with github action token" | |
((Invoke-WebRequest -Authentication OAuth -Token $secret ` | |
-Uri https://api.github.com/users/octocat).Headers.GetEnumerator() | | |
? Key -like "X-RateLimit*") | Out-Host | |
"::endgroup::" | |
((Invoke-WebRequest -Authentication OAuth -Token $secret -Uri $RUNS_URI).Content | ConvertFrom-Json).workflow_runs | ? status -eq 'completed' | | |
select -first 1 id | % { "fastdds_job_id=" + $_.id } | Out-File $env:GITHUB_ENV -Append | |
- name: Download eProsima dependencies | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
workflow: build_eprosima_dependencies.yml | |
path: ${{ github.workspace }}\..\eprosima\install | |
name: windows_${{ matrix.cmake-config }}_eprosima_dependencies_install | |
run_id: ${{ env.eprosima_dependencies_job_id }} | |
- name: Install amlip_cpp | |
uses: ./AML-IP/.github/actions/install-subpackage-windows | |
with: | |
package_path: AML-IP | |
subpackage: amlip_cpp | |
subpackage_dir: amlip_cpp | |
cmake_build_type: ${{ matrix.cmake-config }} | |
- name: Run tests amlip_cpp | |
uses: ./AML-IP/.github/actions/run-test-windows | |
with: | |
package_name: amlip_cpp | |
cmake_build_type: ${{ matrix.cmake-config }} | |
if: always() | |
# NOTE: Windows does not support Python API | |
ubuntu-build-test: | |
runs-on: ubuntu-latest | |
environment: | |
name: codecov | |
steps: | |
- name: Sync eProsima/AML-IP repository | |
uses: actions/checkout@v2 | |
with: | |
path: src/AML-IP | |
- name: Install apt packages | |
uses: ./src/AML-IP/.github/actions/install-apt-packages | |
- name: Install GTest | |
uses: ./src/AML-IP/.github/actions/install-gtest-linux | |
- name: Install Python packages | |
uses: ./src/AML-IP/.github/actions/install-python-packages | |
- name: Get build eProsima dependencies Job Id | |
run: | | |
export JOB_ID=$(curl -sL $GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/workflows/build_eprosima_dependencies.yml/runs | \ | |
jq '.workflow_runs[] | select(.status == "completed") | .id' | \ | |
head -n 1) | |
echo "eprosima_dependencies_job_id=${JOB_ID}" >> $GITHUB_ENV | |
- name: Download eProsima dependencies | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
workflow: build_eprosima_dependencies.yml | |
path: /home/runner/work/eprosima/install | |
name: ubuntu_eprosima_dependencies_install | |
run_id: ${{ env.eprosima_dependencies_job_id }} | |
- name: Update colcon mixin | |
run: | | |
colcon mixin add default \ | |
https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml | |
colcon mixin update default | |
continue-on-error: true | |
- name: Build workspace | |
run: | | |
cat src/AML-IP/.github/workflows/test_colcon.meta | |
source /home/runner/work/eprosima/install/setup.bash | |
colcon build \ | |
--packages-up-to-regex amlip \ | |
--event-handlers=console_direct+ \ | |
--metas src/AML-IP/.github/workflows/test_colcon.meta \ | |
--mixin coverage-gcc \ | |
--packages-skip amlip_docs | |
- name: Run tests amlip_cpp | |
uses: ./src/AML-IP/.github/actions/run-test-ubuntu | |
with: | |
package_name: amlip_cpp | |
if: always() | |
- name: Run tests amlip_swig | |
uses: ./src/AML-IP/.github/actions/run-test-ubuntu | |
with: | |
package_name: amlip_swig | |
if: always() | |
- name: Run tests amlip_py | |
uses: ./src/AML-IP/.github/actions/run-test-ubuntu | |
with: | |
package_name: amlip_py | |
if: always() | |
- name: Generate coverage report | |
run: | | |
cp src/AML-IP/codecov.yml . | |
mkdir coverage-report | |
mkdir build/amlip | |
cp --recursive build/amlip_* build/amlip | |
gcovr \ | |
--root src/AML-IP/ \ | |
--output coverage-report/coverage.xml \ | |
--xml-pretty \ | |
--exclude='.*docs/.*' \ | |
--exclude='.*test/.*' \ | |
--exclude='.*github/.*' \ | |
--exclude='.*common/.*' \ | |
--exclude='.*dev/.*' \ | |
--exclude='.*thirdparty/.*' \ | |
--exclude='.*resources/.*' \ | |
--exclude-unreachable-branches \ | |
build/amlip_* | |
- name: Upload coverage | |
uses: actions/upload-artifact@v1 | |
with: | |
name: coverage-report | |
path: coverage-report/ | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: coverage-report/coverage.xml | |
root_dir: src/AML-IP | |
fail_ci_if_error: true | |
- name: Upload Logs | |
uses: actions/upload-artifact@v1 | |
with: | |
name: colcon-logs-ubuntu | |
path: log/ | |
if: always() | |
ubuntu-test-documentation: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Sync eProsima/AML-IP repository | |
uses: actions/checkout@v2 | |
with: | |
path: src/AML-IP | |
- name: Install apt packages | |
uses: ./src/AML-IP/.github/actions/install-apt-packages | |
- name: Install Python packages | |
uses: ./src/AML-IP/.github/actions/install-python-packages | |
- name: Get build eProsima dependencies Job Id | |
run: | | |
export JOB_ID=$(curl -sL $GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/workflows/build_eprosima_dependencies.yml/runs | \ | |
jq '.workflow_runs[] | select(.status == "completed") | .id' | \ | |
head -n 1) | |
echo "eprosima_dependencies_job_id=${JOB_ID}" >> $GITHUB_ENV | |
- name: Download eProsima dependencies | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
workflow: build_eprosima_dependencies.yml | |
path: /home/runner/work/eprosima/install | |
name: ubuntu_eprosima_dependencies_install | |
run_id: ${{ env.eprosima_dependencies_job_id }} | |
- name: Update colcon mixin | |
run: | | |
colcon mixin add default \ | |
https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml | |
colcon mixin update default | |
continue-on-error: true | |
- name: Build workspace | |
run: | | |
cat src/AML-IP/.github/workflows/docs_colcon.meta | |
source /home/runner/work/eprosima/install/setup.bash | |
colcon build \ | |
--packages-select amlip_docs \ | |
--event-handlers=console_direct+ \ | |
--metas src/AML-IP/.github/workflows/docs_colcon.meta | |
- name: Run tests amlip_docs | |
uses: ./src/AML-IP/.github/actions/run-test-ubuntu | |
with: | |
package_name: amlip_docs | |
if: always() | |
- name: Upload documentation | |
uses: actions/upload-artifact@v1 | |
with: | |
name: Documentation HTML | |
path: install/amlip_docs/docs/amlip_docs/sphinx/html/ | |
- name: Upload spelling errors | |
uses: actions/upload-artifact@v1 | |
with: | |
name: spelling_errors.txt | |
path: build/amlip_docs/docs/test/spelling/output.txt | |
continue-on-error: true | |
- name: Upload Logs | |
uses: actions/upload-artifact@v1 | |
with: | |
name: colcon-logs-ubuntu | |
path: log/ | |
if: always() | |
ubuntu-build-test-flaky: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Sync eProsima/AML-IP repository | |
uses: actions/checkout@v2 | |
with: | |
path: src/AML-IP | |
- name: Install apt packages | |
uses: ./src/AML-IP/.github/actions/install-apt-packages | |
- name: Install GTest | |
uses: ./src/AML-IP/.github/actions/install-gtest-linux | |
- name: Install Python packages | |
uses: ./src/AML-IP/.github/actions/install-python-packages | |
- name: Get build eProsima dependencies Job Id | |
run: | | |
export JOB_ID=$(curl -sL $GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/workflows/build_eprosima_dependencies.yml/runs | \ | |
jq '.workflow_runs[] | select(.status == "completed") | .id' | \ | |
head -n 1) | |
echo "eprosima_dependencies_job_id=${JOB_ID}" >> $GITHUB_ENV | |
- name: Download eProsima dependencies | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
workflow: build_eprosima_dependencies.yml | |
path: /home/runner/work/eprosima/install | |
name: ubuntu_eprosima_dependencies_install | |
run_id: ${{ env.eprosima_dependencies_job_id }} | |
- name: Update colcon mixin | |
run: | | |
colcon mixin add default \ | |
https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml | |
colcon mixin update default | |
continue-on-error: true | |
- name: Build workspace | |
run: | | |
cat src/AML-IP/.github/workflows/test_colcon.meta | |
source /home/runner/work/eprosima/install/setup.bash | |
colcon build \ | |
--packages-up-to-regex amlip \ | |
--event-handlers=console_direct+ \ | |
--metas src/AML-IP/.github/workflows/test_colcon.meta \ | |
--packages-skip amlip_docs | |
- name: Run tests | |
run: | | |
source install/setup.bash && \ | |
colcon test \ | |
--packages-select amlip_cpp \ | |
--event-handlers=console_direct+ \ | |
--return-code-on-test-failure \ | |
--ctest-args \ | |
--label-regex xfail \ | |
--timeout 60 | |
asan-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Sync eProsima/AML-IP repository | |
uses: actions/checkout@v2 | |
with: | |
path: src/AML-IP | |
- name: Install apt packages | |
uses: ./src/AML-IP/.github/actions/install-apt-packages | |
- name: Install GTest | |
uses: ./src/AML-IP/.github/actions/install-gtest-linux | |
- name: Install Python packages | |
uses: ./src/AML-IP/.github/actions/install-python-packages | |
- name: Get build eProsima dependencies Job Id | |
run: | | |
export JOB_ID=$(curl -sL $GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/workflows/build_eprosima_dependencies.yml/runs | \ | |
jq '.workflow_runs[] | select(.status == "completed") | .id' | \ | |
head -n 1) | |
echo "eprosima_dependencies_job_id=${JOB_ID}" >> $GITHUB_ENV | |
- name: Download eProsima dependencies | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
workflow: build_eprosima_dependencies.yml | |
path: /home/runner/work/eprosima/install | |
name: ubuntu_eprosima_dependencies_install | |
run_id: ${{ env.eprosima_dependencies_job_id }} | |
- name: Update colcon mixin | |
run: | | |
colcon mixin add default \ | |
https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml | |
colcon mixin update default | |
continue-on-error: true | |
- name: Build workspace | |
run: | | |
cat src/AML-IP/.github/workflows/asan_colcon.meta | |
source /home/runner/work/eprosima/install/setup.bash | |
colcon build \ | |
--packages-up-to-regex amlip_cpp \ | |
--event-handlers=console_direct+ \ | |
--metas src/AML-IP/.github/workflows/asan_colcon.meta | |
- name: Run tests | |
run: | | |
source install/setup.bash && \ | |
colcon test \ | |
--packages-select amlip_cpp \ | |
--event-handlers=console_direct+ \ | |
--return-code-on-test-failure \ | |
--ctest-args \ | |
--label-exclude "xfail|xasan" \ | |
--timeout 60 | |
- name: Upload Logs | |
uses: actions/upload-artifact@v1 | |
with: | |
name: asan-logs | |
path: log/ | |
if: always() | |
clang-tidy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Sync eProsima/AML-IP repository | |
uses: actions/checkout@v2 | |
with: | |
path: src/AML-IP | |
- name: Install apt packages | |
uses: ./src/AML-IP/.github/actions/install-apt-packages | |
- name: Install GTest | |
uses: ./src/AML-IP/.github/actions/install-gtest-linux | |
- name: Install Python packages | |
uses: ./src/AML-IP/.github/actions/install-python-packages | |
- name: Get build eProsima dependencies Job Id | |
run: | | |
export JOB_ID=$(curl -sL $GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/workflows/build_eprosima_dependencies.yml/runs | \ | |
jq '.workflow_runs[] | select(.status == "completed") | .id' | \ | |
head -n 1) | |
echo "eprosima_dependencies_job_id=${JOB_ID}" >> $GITHUB_ENV | |
- name: Download eProsima dependencies | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
workflow: build_eprosima_dependencies.yml | |
path: /home/runner/work/eprosima/install | |
name: ubuntu_eprosima_dependencies_install | |
run_id: ${{ env.eprosima_dependencies_job_id }} | |
- name: Build workspace | |
run: | | |
cat src/AML-IP/.github/workflows/clang_colcon.meta | |
source /home/runner/work/eprosima/install/setup.bash | |
colcon build \ | |
--event-handlers=console_direct+ \ | |
--metas src/AML-IP/.github/workflows/clang_colcon.meta | |
- name: Run clang-tidy | |
run: | | |
mkdir build/amlip | |
cp --recursive build/amlip_* build/amlip | |
cd build/amlip | |
run-clang-tidy -header-filter='.*' -checks='clang-analyzer-cplusplus' -quiet 2> ${{ github.workspace }}/clang_results.yml | |
- name: Upload clang results | |
uses: actions/upload-artifact@v1 | |
with: | |
name: clang_results | |
path: ${{ github.workspace }}/clang_results.yml | |
uncrustify: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Sync eProsima/AML-IP repository | |
uses: actions/checkout@v2 | |
with: | |
path: src/AML-IP | |
- name: Fetch all branches and tags | |
run: | | |
cd src/AML-IP | |
git fetch --prune --unshallow | |
- name: Install apt packages | |
uses: ./src/AML-IP/.github/actions/install-apt-packages | |
- name: Install Python packages | |
uses: ./src/AML-IP/.github/actions/install-python-packages | |
- name: Install uncrustify | |
run: | | |
git clone https://github.com/uncrustify/uncrustify.git \ | |
--branch uncrustify-0.71.0 \ | |
--single-branch uncrustify | |
mkdir -p uncrustify/build | |
cd uncrustify/build | |
cmake .. | |
sudo cmake --build . --target install | |
cd ../.. | |
sudo rm -rf uncrustify | |
# (TODO) Change to main branch when PR is merged | |
- name: Clone ament_lint | |
run: | | |
git clone --branch feature/fix-language-set https://github.com/jparisu/ament_lint.git src/ament_lint | |
- name: Build ament_uncrustify | |
run: colcon build --packages-up-to ament_uncrustify | |
- name: Fetch uncrustify config file | |
run: | | |
curl \ | |
-l https://raw.githubusercontent.com/eProsima/cpp-style/master/uncrustify.cfg \ | |
-o uncrustify.cfg | |
- name: Get difference | |
run: | | |
cd src/AML-IP | |
echo "MODIFIED_FILES=$(git diff --name-only origin/${GITHUB_BASE_REF} origin/${GITHUB_HEAD_REF} | grep -e '\.h' -e '\.hpp' -e '\.cpp' -e '\.ipp' | tr '\n' ' ')" >> $GITHUB_ENV | |
- name: Check difference | |
run: | | |
cd src/AML-IP | |
if [[ -z "${MODIFIED_FILES}" ]] | |
then | |
touch empty.hpp | |
echo "MODIFIED_FILES=empty.hpp" >> $GITHUB_ENV | |
fi | |
- name: Check style | |
run: | | |
source install/local_setup.bash | |
cd src/AML-IP | |
ament_uncrustify \ | |
-c ../../uncrustify.cfg \ | |
--language CPP \ | |
--xunit-file ../../uncrustify_results.xml \ | |
${MODIFIED_FILES} | |
- name: Upload uncrustify results | |
uses: actions/upload-artifact@v1 | |
with: | |
name: uncrustify_results | |
path: uncrustify_results.xml | |
python-linter: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Sync eProsima/AML-IP repository | |
uses: actions/checkout@v2 | |
with: | |
path: src/AML-IP | |
- name: Fetch all branches and tags | |
run: | | |
cd src/AML-IP | |
git fetch --prune --unshallow | |
- name: Install apt packages | |
uses: ./src/AML-IP/.github/actions/install-apt-packages | |
- name: Install Python packages | |
uses: ./src/AML-IP/.github/actions/install-python-packages | |
- name: Get difference | |
run: | | |
cd src/AML-IP | |
echo "MODIFIED_FILES=$(git diff --name-only origin/${GITHUB_BASE_REF} origin/${GITHUB_HEAD_REF} | grep -e '\.py' | tr '\n' ' ')" >> $GITHUB_ENV | |
- name: Check difference | |
run: | | |
cd src/AML-IP | |
if [[ -z "${MODIFIED_FILES}" ]] | |
then | |
touch empty.py | |
echo "MODIFIED_FILES=empty.py" >> $GITHUB_ENV | |
fi | |
echo ${MODIFIED_FILES} | |
- name: Check flake8 linter | |
run: | | |
cd src/AML-IP | |
python3 -m flake8 --config ./.github/workflows/setup.cfg ${MODIFIED_FILES} | |
if: always() |