Add example with conan workspaces #238
This file contains hidden or 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: Conan create ros-kilted | |
| on: | |
| pull_request: | |
| paths-ignore: | |
| - '**/*.md' | |
| - 'LICENSE' | |
| - '.gitignore' | |
| push: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - '**/*.md' | |
| - 'LICENSE' | |
| - '.gitignore' | |
| jobs: | |
| conan-create: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - runner: windows-2022 | |
| variant: core | |
| conan_home: C:/.c2 | |
| - runner: macos-latest | |
| variant: core | |
| conan_home: /private/tmp/conan-ci | |
| - runner: ubuntu-latest | |
| variant: core | |
| conan_home: /tmp/conan-ci | |
| - runner: windows-2022 | |
| variant: desktop | |
| conan_home: C:/.c2 | |
| - runner: macos-latest | |
| variant: desktop | |
| conan_home: /private/tmp/conan-ci | |
| - runner: ubuntu-latest | |
| variant: desktop | |
| conan_home: /tmp/conan-ci | |
| runs-on: ${{ matrix.runner }} | |
| env: | |
| CONAN_HOME: ${{ matrix.conan_home }} | |
| ARTIFACTORY_URL: ${{ secrets.ARTIFACTORY_URL }} | |
| CONAN_LOGIN_USERNAME: ${{ secrets.ARTIFACTORY_USER }} | |
| CONAN_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} | |
| steps: | |
| - name: Free disk space | |
| if: runner.os == 'Linux' && matrix.variant == 'desktop' | |
| uses: jlumbroso/free-disk-space@main | |
| with: | |
| tool-cache: false | |
| android: true | |
| dotnet: true | |
| haskell: true | |
| large-packages: false | |
| swap-storage: true | |
| - name: Enable long paths for git | |
| if: runner.os == 'Windows' | |
| run: git config --global core.longpaths true | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Prepare Conan home | |
| shell: bash | |
| run: mkdir -p "$CONAN_HOME" | |
| - name: Install CMake | |
| uses: jwlawson/actions-setup-cmake@v2.2 | |
| with: | |
| cmake-version: "3.31.0" | |
| - name: Set up Python | |
| id: setup_python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| update-environment: false | |
| - name: Prepend Python to System PATH | |
| shell: bash | |
| run: echo "$(dirname '${{ steps.setup_python.outputs.python-path }}')" >> "$GITHUB_PATH" | |
| # Service Fabric's msvcp140.dll breaks rcl_init(); Qt's build needs no sh.exe on PATH. | |
| - name: Clean up PATH (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| $path = ($env:PATH -split ';') | Where-Object { $_ -and $_ -notmatch 'Service.Fabric' -and -not (Test-Path (Join-Path $_ 'sh.exe') -ErrorAction SilentlyContinue) } | |
| "PATH=$($path -join ';')" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
| - name: Install latest Conan | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install conan | |
| conan --version | |
| - name: Set up Conan home | |
| shell: bash | |
| run: | | |
| conan profile detect | |
| conan remote add conan-ros "$ARTIFACTORY_URL" | |
| conan remote login conan-ros | |
| - name: Show ros-kilted revisions in Artifactory | |
| run: conan list "ros-kilted/2026.06.17#*:*" -r=conan-ros -f=compact | |
| - name: Export recipes in this reopo | |
| run: | | |
| conan export recipes/orocos_kdl/all --version=1.5.1 | |
| conan export recipes/python_orocos_kdl/all --version=1.5.1 | |
| conan export recipes/ros-kilted/all --version=2026.06.17 | |
| - name: Install ros-kilted (build missing from source) | |
| run: > | |
| conan install --requires=ros-kilted/2026.06.17 | |
| --build=missing | |
| --profile:all=profiles/ros | |
| -o ros-kilted/*:variant=${{ matrix.variant }} | |
| --format=json --out-file=install_graph.json | |
| - name: Upload binaries built from source to Artifactory | |
| shell: bash | |
| run: | | |
| conan list --graph=install_graph.json --graph-binaries=build --format=json > upload_pkglist.json | |
| cat upload_pkglist.json | |
| conan upload --list=upload_pkglist.json -r conan-ros -c | |
| # Change the Conan home to test ros-kilted relocation | |
| - name: Relocate the Conan home | |
| shell: bash | |
| run: echo "CONAN_HOME=${CONAN_HOME}-2" >> "$GITHUB_ENV" | |
| - name: Set up the relocated Conan home | |
| shell: bash | |
| run: | | |
| conan profile detect | |
| conan remote add conan-ros "$ARTIFACTORY_URL" | |
| conan remote login conan-ros | |
| - name: Export recipes in this repo | |
| run: | | |
| conan export recipes/orocos_kdl/all --version=1.5.1 | |
| conan export recipes/python_orocos_kdl/all --version=1.5.1 | |
| conan export recipes/ros-kilted/all --version=2026.06.17 | |
| - name: Run ros-kilted test_package against the uploaded binaries | |
| working-directory: ${{ github.workspace }} | |
| run: > | |
| conan test recipes/ros-kilted/all/test_package ros-kilted/2026.06.17 | |
| --profile:all=profiles/ros | |
| -o ros-kilted/*:variant=${{ matrix.variant }} | |
| - name: Find and run examples (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| env: | |
| PYTHONPATH: ${{ github.workspace }} | |
| ROS_KILTED_VARIANT: ${{ matrix.variant }} | |
| run: python -u "${{ github.workspace }}/.github/run_ci_tests.py" | |
| - name: Find and run examples | |
| if: runner.os != 'Windows' | |
| shell: bash | |
| env: | |
| PYTHONPATH: ${{ github.workspace }} | |
| ROS_KILTED_VARIANT: ${{ matrix.variant }} | |
| run: | | |
| # colcon-powershell misdetects itself as primary shell otherwise | |
| unset PSModulePath | |
| python -u "${{ github.workspace }}/.github/run_ci_tests.py" | |
| - name: Upload pose_estimation example deps built from source to Artifactory | |
| if: always() && hashFiles('examples/pose_estimation/install_graph.json') != '' | |
| shell: bash | |
| working-directory: ${{ github.workspace }}/examples/pose_estimation | |
| run: | | |
| conan list --graph=install_graph.json --graph-binaries=build --format=json > upload_pkglist.json | |
| cat upload_pkglist.json | |
| conan upload --list=upload_pkglist.json -r conan-ros -c |