build gz-ros2-control both on Linux and macOS
#858
Workflow file for this run
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
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| env: | |
| ROS_VERSION: 2 | |
| # Change to 'true' to enable the cache upload as artifacts | |
| SAVE_CACHE_AS_ARTIFACT: 'false' | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| platform: linux-64 | |
| folder_cache: 'output/linux-64' | |
| - os: ubuntu-24.04-arm | |
| platform: linux-aarch64 | |
| folder_cache: 'output/linux-aarch64' | |
| - os: macos-13 | |
| platform: osx-64 | |
| folder_cache: 'output/osx-64' | |
| - os: macos-14 | |
| platform: osx-arm64 | |
| folder_cache: 'output/osx-arm64' | |
| - os: windows-2022 | |
| platform: win-64 | |
| folder_cache: 'C:/bld/win-64' | |
| - os: ubuntu-latest | |
| platform: emscripten-wasm32 | |
| folder_cache: 'output/emscripten-wasm32' | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token | |
| fetch-depth: 0 # otherwise, you will failed to push refs to dest repo | |
| - uses: prefix-dev/setup-pixi@v0.8.10 | |
| with: | |
| frozen: true | |
| - name: Long paths workarounds for win-64 | |
| shell: bash -l {0} | |
| if: matrix.platform == 'win-64' | |
| run: | | |
| # Workaround for problem related to long paths | |
| echo "CONDA_BLD_PATH=C:\\bld\\" >> $GITHUB_ENV | |
| mkdir /c/bld | |
| # Workaround for https://github.com/RoboStack/ros-humble/pull/141#issuecomment-1941919816 | |
| - name: Clean up PATH | |
| if: contains(matrix.os, 'windows') | |
| uses: egor-tensin/cleanup-path@v4 | |
| with: | |
| # cygpath in C:\Program Files\Git\usr\bin is used by install micromamba | |
| # git in C:\Program Files\Git\bin is used by pip install git+ | |
| dirs: 'C:\Program Files\Git\usr\bin;C:\Program Files\Git\bin;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin' | |
| # For some reason, the Strawberry perl's pkg-config is found | |
| # instead of the conda's one, so let's delete the /c/Strawberry directory | |
| # Furthermore, we also need to remove an older SDK that is used and can result in compilation problems | |
| - name: Debug pkg-config problem | |
| if: contains(matrix.os, 'windows') | |
| shell: bash -l {0} | |
| run: | | |
| rm -rf /c/Strawberry | |
| rm -rf "/c/Program Files (x86)/Windows Kits/10/Include/10.0.17763.0/" | |
| # Regression for https://github.com/RoboStack/ros-jazzy/issues/44 | |
| - name: Check that anaconda-client command works fine | |
| shell: bash -l {0} | |
| run: | | |
| pixi run anaconda --version | |
| - name: Generate recipes | |
| shell: bash -l {0} | |
| run: | | |
| mkdir -p recipes | |
| pixi run -v vinca --platform ${{ matrix.platform }} -m -n | |
| - name: Check patches | |
| shell: bash -l {0} | |
| run: | | |
| pixi run python check_patches_clean_apply.py | |
| - name: Restore build cache | |
| id: cache-restore | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| ${{ matrix.folder_cache }} | |
| key: ${{ runner.os }}-${{ matrix.platform }}-pr-${{ github.event.pull_request.number }} | |
| # allow a later run to pick up a cache that has an extra suffix | |
| restore-keys: | | |
| ${{ runner.os }}-${{ matrix.platform }}-pr-${{ github.event.pull_request.number }}- | |
| - name: See packages restored by cache | |
| shell: bash -l {0} | |
| run: | | |
| ls ${{ matrix.folder_cache }} || true | |
| - name: Build recipes [non emscripten] | |
| shell: bash -l {0} | |
| if: matrix.platform != 'emscripten-wasm32' | |
| run: | | |
| pixi run rattler-build build --recipe-dir recipes --target-platform ${{ matrix.platform }} -m ./conda_build_config.yaml -c conda-forge -c robostack-staging --skip-existing | |
| - name: Build recipes [emscripten] | |
| shell: bash -l {0} | |
| if: matrix.platform == 'emscripten-wasm32' | |
| run: | | |
| pixi run rattler-build build --recipe-dir recipes --target-platform ${{ matrix.platform }} -m ./conda_build_config.yaml -c https://repo.mamba.pm/emscripten-forge/ -c conda-forge -c robostack-staging --skip-existing --test skip | |
| - name: See packages that will be saved in cache | |
| shell: bash -l {0} | |
| if: always() | |
| run: | | |
| ls ${{ matrix.folder_cache }} || true | |
| - name: Save build cache | |
| uses: actions/cache/save@v4 | |
| if: always() | |
| with: | |
| path: | | |
| ${{ matrix.folder_cache }} | |
| key: ${{ runner.os }}-${{ matrix.platform }}-pr-${{ github.event.pull_request.number }}-${{ github.run_id }}-${{ github.run_attempt }} | |
| - name: Upload build cache as artifact | |
| if: ${{ always() && env.SAVE_CACHE_AS_ARTIFACT == 'true' }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cache-${{ matrix.platform }}-${{ github.run_id }} | |
| path: ${{ matrix.folder_cache }} | |
| retention-days: 7 |