Skip to content
Merged
Changes from 8 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
28 changes: 28 additions & 0 deletions validate_package_xml/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: 'Validate package.xml'
description: 'Validate package.xml file'
runs:
using: "composite"
steps:
- name: Checkout
uses: actions/checkout@v4

- name: package.xml syntax validation
shell: bash
run: |
echo "Install ament-xmllint"
sudo apt-get install -y python3-venv libxml2-utils
python3 -m venv .venv
source .venv/bin/activate
pip install ament-xmllint
ament_xmllint package.xml 2>&1 | tee $GITHUB_STEP_SUMMARY
Comment thread
azeey marked this conversation as resolved.
Outdated

- name: package.xml and CMake versions match
shell: bash
run: |
echo "Extract version numbers and compare"
echo '## CMake and Package.xml Versions' >> $GITHUB_STEP_SUMMARY
package_xml_version=$(sed -nE 's/\s*<version>([0-9.]*)<\/version>\s*/\1/p' package.xml)
echo "Version in package.xml: ${package_xml_version}" | tee -a $GITHUB_STEP_SUMMARY
cmake_version=$(sed -nE 's/^project.*VERSION\s*([0-9.]*).*/\1/p' CMakeLists.txt)
echo "Version in CMake: ${cmake_version}" | tee -a $GITHUB_STEP_SUMMARY
[ $package_xml_version = $cmake_version ]