44
55env :
66 ROS_VERSION : 2
7-
7+ # Change to 'true' to enable the cache upload as artifacts
8+ SAVE_CACHE_AS_ARTIFACT : ' false'
89jobs :
910 build :
1011 strategy :
@@ -13,14 +14,19 @@ jobs:
1314 include :
1415 - os : ubuntu-latest
1516 platform : linux-64
17+ folder_cache : ' output/linux-64'
1618 - os : ubuntu-24.04-arm
1719 platform : linux-aarch64
20+ folder_cache : ' output/linux-aarch64'
1821 - os : macos-13
1922 platform : osx-64
23+ folder_cache : ' output/osx-64'
2024 - os : macos-14
2125 platform : osx-arm64
26+ folder_cache : ' output/osx-arm64'
2227 - os : windows-2022
2328 platform : win-64
29+ folder_cache : ' C:/bld/win-64'
2430
2531 runs-on : ${{ matrix.os }}
2632
3238
3339 -
uses :
prefix-dev/[email protected] 3440 with :
35- pixi-version : v0.49.0
3641 frozen : true
3742
43+ - name : Long paths workarounds for win-64
44+ shell : bash -l {0}
45+ if : matrix.platform == 'win-64'
46+ run : |
47+ # Workaround for problem related to long paths
48+ echo "CONDA_BLD_PATH=C:\\bld\\" >> $GITHUB_ENV
49+ mkdir /c/bld
50+
3851 # Workaround for https://github.com/RoboStack/ros-humble/pull/141#issuecomment-1941919816
3952 - name : Clean up PATH
4053 if : contains(matrix.os, 'windows')
@@ -54,94 +67,71 @@ jobs:
5467 rm -rf /c/Strawberry
5568 rm -rf "/c/Program Files (x86)/Windows Kits/10/Include/10.0.17763.0/"
5669
57-
5870 # Regression for https://github.com/RoboStack/ros-jazzy/issues/44
5971 - name : Check that anaconda-client command works fine
6072 shell : bash -l {0}
6173 run : |
6274 pixi run anaconda --version
6375
64- - name : Generate recipes for linux-64
65- shell : bash -l {0}
66- if : matrix.platform == 'linux-64'
67- run : |
68- mkdir -p recipes
69- $HOME/.pixi/bin/pixi run -v vinca --platform linux-64 -m -n
70- ls -la recipes
71- - name : Generate recipes for linux-aarch64
72- shell : bash -l {0}
73- if : matrix.platform == 'linux-aarch64'
74- run : |
75- mkdir -p recipes
76- $HOME/.pixi/bin/pixi run -v vinca --platform linux-aarch64 -m -n
77- ls -la recipes
78- - name : Generate recipes for osx-64
79- shell : bash -l {0}
80- if : matrix.platform == 'osx-64'
81- run : |
82- mkdir -p recipes
83- $HOME/.pixi/bin/pixi run -v vinca --platform osx-64 -m -n
84- ls -la recipes
85- - name : Generate recipes for osx-arm64
86- shell : bash -l {0}
87- if : matrix.platform == 'osx-arm64'
88- run : |
89- mkdir -p recipes
90- $HOME/.pixi/bin/pixi run -v vinca --platform osx-arm64 -m -n
91- ls -la recipes
92- - name : Generate recipes for win-64
76+ - name : Generate recipes
9377 shell : bash -l {0}
94- if : matrix.platform == 'win-64'
9578 run : |
96- # Workaround for problem related to long paths
97- echo "CONDA_BLD_PATH=C:\\bld\\" >> $GITHUB_ENV
98- mkdir /c/bld
9979 mkdir -p recipes
100- $HOME/.pixi/bin/pixi run -v vinca --platform win-64 -m -n
101- ls -la recipes
102- - name : Check if there are packages to be built
103- id : newrecipecheck
104- shell : bash -l {0}
105- run : |
106- # Workaround for https://github.com/prefix-dev/rattler-build/issues/1535
107- set +e
108- if [ ! -d recipes ] || [ -z "$(ls -A recipes)" ]; then
109- echo "RECIPE_CREATED=0" >> $GITHUB_OUTPUT
110- else
111- echo "RECIPE_CREATED=1" >> $GITHUB_OUTPUT
112- fi
113- - name : Build recipes for linux-64
80+ pixi run -v vinca --platform ${{ matrix.platform }} -m -n
81+
82+ - name : Check patches
11483 shell : bash -l {0}
115- if : steps.newrecipecheck.outputs.RECIPE_CREATED == 1 && matrix.platform == 'linux-64'
11684 run : |
117- env -i $HOME/.pixi/bin/pixi run python check_patches_clean_apply.py
118- # env -i $HOME/.pixi/bin/pixi run rattler-build build --recipe-dir additional_recipes --target-platform linux-64 -m ./conda_build_config.yaml -c robostack-jazzy -c conda-forge --skip-existing
119- env -i $HOME/.pixi/bin/pixi run rattler-build build --recipe-dir recipes --target-platform linux-64 -m ./conda_build_config.yaml -c robostack-jazzy -c conda-forge --skip-existing
120- - name : Build recipes for linux-aarch64
85+ pixi run python check_patches_clean_apply.py
86+
87+ - name : Restore build cache
88+ id : cache-restore
89+ uses : actions/cache/restore@v4
90+ with :
91+ path : |
92+ ${{ matrix.folder_cache }}
93+ key : ${{ runner.os }}-${{ matrix.platform }}-pr-${{ github.event.pull_request.number }}
94+ # allow a later run to pick up a cache that has an extra suffix
95+ restore-keys : |
96+ ${{ runner.os }}-${{ matrix.platform }}-pr-${{ github.event.pull_request.number }}-
97+
98+ - name : Remove outdated files
12199 shell : bash -l {0}
122- if : steps.newrecipecheck.outputs.RECIPE_CREATED == 1 && matrix.platform == 'linux-aarch64'
123100 run : |
124- env -i $HOME/.pixi/bin/pixi run python check_patches_clean_apply.py
125- # env -i $HOME/.pixi/bin/pixi run rattler-build build --recipe-dir additional_recipes --target-platform linux-aarch64 -m ./conda_build_config.yaml -c robostack-jazzy -c conda-forge --skip-existing
126- env -i $HOME/.pixi/bin/pixi run rattler-build build --recipe-dir recipes --target-platform linux-aarch64 -m ./conda_build_config.yaml -c robostack-jazzy -c conda-forge --skip-existing
127- - name : Build recipes for osx-64
101+ rm -rf ${{ matrix.folder_cache }}/cartographer-*
102+ rm -rf ${{ matrix.folder_cache }}/ros-jazzy-rmw-zenoh-*
103+ rm -rf ${{ matrix.folder_cache }}/ros-jazzy-gz-*
104+ rm -rf ${{ matrix.folder_cache }}/ros-jazzy-sdformat-*
105+ rm -rf ${{ matrix.folder_cache }}/ros-jazzy-ros2-control-cmake-*
106+
107+ - name : See packages restored by cache
128108 shell : bash -l {0}
129- if : steps.newrecipecheck.outputs.RECIPE_CREATED == 1 && matrix.platform == 'osx-64'
130109 run : |
131- env -i $HOME/.pixi/bin/pixi run python check_patches_clean_apply.py
132- # env -i $HOME/.pixi/bin/pixi run rattler-build build --recipe-dir additional_recipes --target-platform osx-64 -m ./conda_build_config.yaml -c robostack-jazzy -c conda-forge --skip-existing
133- env -i $HOME/.pixi/bin/pixi run rattler-build build --recipe-dir recipes --target-platform osx-64 -m ./conda_build_config.yaml -c robostack-jazzy -c conda-forge --skip-existing
134- - name : Build recipes for osx-arm64
110+ ls ${{ matrix.folder_cache }}
111+
112+ - name : Build recipes
135113 shell : bash -l {0}
136- if : steps.newrecipecheck.outputs.RECIPE_CREATED == 1 && matrix.platform == 'osx-arm64'
137114 run : |
138- env -i $HOME/.pixi/bin/pixi run python check_patches_clean_apply.py
139- # env -i $HOME/.pixi/bin/pixi run rattler-build build --recipe-dir additional_recipes --target-platform osx-arm64 -m ./conda_build_config.yaml -c robostack-jazzy -c conda-forge --skip-existing
140- env -i $HOME/.pixi/bin/pixi run rattler-build build --recipe-dir recipes --target-platform osx-arm64 -m ./conda_build_config.yaml -c robostack-jazzy -c conda-forge --skip-existing
141- - name : Build recipes for win-64
115+ pixi run rattler-build build --recipe-dir recipes --target-platform ${{ matrix.platform }} -m ./conda_build_config.yaml -c conda-forge -c robostack-jazzy --skip-existing
116+
117+ - name : See packages that will be saved in cache
142118 shell : bash -l {0}
143- if : steps.newrecipecheck.outputs.RECIPE_CREATED == 1 && matrix.platform == 'win-64'
119+ if : always()
144120 run : |
145- $HOME/.pixi/bin/pixi run python check_patches_clean_apply.py
146- # $HOME/.pixi/bin/pixi run rattler-build build --recipe-dir additional_recipes --target-platform win-64 -m ./conda_build_config.yaml -c robostack-jazzy -c conda-forge --skip-existing
147- $HOME/.pixi/bin/pixi run rattler-build build --recipe-dir recipes --target-platform win-64 -m ./conda_build_config.yaml -c robostack-jazzy -c conda-forge --skip-existing
121+ ls ${{ matrix.folder_cache }}
122+
123+ - name : Save build cache
124+ uses : actions/cache/save@v4
125+ if : always()
126+ with :
127+ path : |
128+ ${{ matrix.folder_cache }}
129+ key : ${{ runner.os }}-${{ matrix.platform }}-pr-${{ github.event.pull_request.number }}-${{ github.run_id }}-${{ github.run_attempt }}
130+
131+ - name : Upload build cache as artifact
132+ if : ${{ always() && env.SAVE_CACHE_AS_ARTIFACT == 'true' }}
133+ uses : actions/upload-artifact@v4
134+ with :
135+ name : cache-${{ matrix.platform }}-${{ github.run_id }}
136+ path : ${{ matrix.folder_cache }}
137+ retention-days : 7
0 commit comments