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,16 +14,22 @@ 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 - os : ubuntu-latest
2531 platform : emscripten-wasm32
32+ folder_cache : ' output/emscripten-wasm32'
2633
2734 runs-on : ${{ matrix.os }}
2835
@@ -32,11 +39,18 @@ jobs:
3239 persist-credentials : false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
3340 fetch-depth : 0 # otherwise, you will failed to push refs to dest repo
3441
35- - uses : prefix-dev/setup-pixi@v0.8.1
42+ - uses : prefix-dev/setup-pixi@v0.8.10
3643 with :
37- environments : beta
3844 frozen : true
3945
46+ - name : Long paths workarounds for win-64
47+ shell : bash -l {0}
48+ if : matrix.platform == 'win-64'
49+ run : |
50+ # Workaround for problem related to long paths
51+ echo "CONDA_BLD_PATH=C:\\bld\\" >> $GITHUB_ENV
52+ mkdir /c/bld
53+
4054 # Workaround for https://github.com/RoboStack/ros-humble/pull/141#issuecomment-1941919816
4155 - name : Clean up PATH
4256 if : contains(matrix.os, 'windows')
@@ -56,119 +70,69 @@ jobs:
5670 rm -rf /c/Strawberry
5771 rm -rf "/c/Program Files (x86)/Windows Kits/10/Include/10.0.17763.0/"
5872
59- - name : Check what files have changed
60- id : filecheck
61- shell : bash -l {0}
62- run : |
63- git fetch origin main
64- # continue on error
65- set +e
66- git diff --exit-code --name-only origin/main -- vinca_linux_64.yaml > /dev/null
67- echo "::set-output name=LINUX_YAML_CHANGED::${?}"
68- git diff --exit-code --name-only origin/main -- vinca_emscripten32.yaml > /dev/null
69- echo "::set-output name=EMSCRIPTEN32_YAML_CHANGED::${?}"
70- git diff --exit-code --name-only origin/main -- vinca_linux_aarch64.yaml > /dev/null
71- echo "::set-output name=LINUX_AARCH_YAML_CHANGED::${?}"
72- git diff --exit-code --name-only origin/main -- vinca_osx.yaml > /dev/null
73- echo "::set-output name=OSX_YAML_CHANGED::${?}"
74- git diff --exit-code --name-only origin/main -- vinca_osx_arm64.yaml > /dev/null
75- echo "::set-output name=OSX_ARM_YAML_CHANGED::${?}"
76- git diff --exit-code --name-only origin/main -- vinca_win.yaml > /dev/null
77- echo "::set-output name=WIN_YAML_CHANGED::${?}"
78- - name : Generate recipes for linux-64
79- shell : bash -l {0}
80- if : matrix.platform == 'linux-64'
81- run : |
82- cp vinca_linux_64.yaml vinca.yaml
83- mkdir -p recipes
84- $HOME/.pixi/bin/pixi run -e beta -v vinca --platform linux-64 -m
85- ls -la recipes
86- - name : Generate recipes for emscripten-wasm32
87- shell : bash -l {0}
88- if : steps.filecheck.outputs.EMSCRIPTEN32_YAML_CHANGED == 1 && matrix.platform == 'emscripten-wasm32'
89- run : |
90- cp vinca_emscripten32.yaml vinca.yaml
91- mkdir -p recipes
92- $HOME/.pixi/bin/pixi run -e beta -v vinca --platform emscripten-wasm32 -m -n
93- ls -la recipes
94- - name : Generate recipes for linux-aarch64
95- shell : bash -l {0}
96- if : matrix.platform == 'linux-aarch64'
97- run : |
98- cp vinca_linux_aarch64.yaml vinca.yaml
99- mkdir -p recipes
100- $HOME/.pixi/bin/pixi run -e beta -v vinca --platform linux-aarch64 -m
101- ls -la recipes
102- - name : Generate recipes for osx-64
103- shell : bash -l {0}
104- if : matrix.platform == 'osx-64'
105- run : |
106- cp vinca_osx.yaml vinca.yaml
107- mkdir -p recipes
108- $HOME/.pixi/bin/pixi run -e beta -v vinca --platform osx-64 -m
109- ls -la recipes
110- - name : Generate recipes for osx-arm64
73+ # Regression for https://github.com/RoboStack/ros-jazzy/issues/44
74+ - name : Check that anaconda-client command works fine
11175 shell : bash -l {0}
112- if : matrix.platform == 'osx-arm64'
11376 run : |
114- cp vinca_osx_arm64.yaml vinca.yaml
115- mkdir -p recipes
116- $HOME/.pixi/bin/pixi run -e beta -v vinca --platform osx-arm64 -m
117- ls -la recipes
118- - name : Generate recipes for win-64
77+ pixi run anaconda --version
78+
79+ - name : Generate recipes
11980 shell : bash -l {0}
120- if : matrix.platform == 'win-64'
12181 run : |
122- # Workaround for problem related to long paths
123- echo "CONDA_BLD_PATH=C:\\bld\\" >> $GITHUB_ENV
124- mkdir /c/bld
125- cp vinca_win.yaml vinca.yaml
12682 mkdir -p recipes
127- $HOME/.pixi/bin/pixi run -e beta -v vinca --platform win-64 -m
128- ls -la recipes
129- - name : Check if there are packages to be built
130- id : newrecipecheck
131- shell : bash -l {0}
132- run : |
133- set +e
134- if [ ! -d recipes ] || [ -z "$(ls -A recipes)" ]; then
135- echo "RECIPE_CREATED=0" >> $GITHUB_OUTPUT
136- else
137- echo "RECIPE_CREATED=1" >> $GITHUB_OUTPUT
138- fi
139- - name : Build recipes for linux-64
140- shell : bash -l {0}
141- if : steps.newrecipecheck.outputs.RECIPE_CREATED == 1 && matrix.platform == 'linux-64'
142- run : |
143- env -i $HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir additional_recipes --target-platform linux-64 -m ./conda_build_config.yaml -c robostack-staging -c conda-forge --skip-existing
144- env -i $HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir recipes --target-platform linux-64 -m ./conda_build_config.yaml -c robostack-staging -c conda-forge --skip-existing
145- - name : Build recipes for emscripten-wasm32
83+ pixi run -v vinca --platform ${{ matrix.platform }} -m -n
84+
85+ - name : Check patches
14686 shell : bash -l {0}
147- if : steps.newrecipecheck.outputs.RECIPE_CREATED == 1 && steps.filecheck.outputs.EMSCRIPTEN32_YAML_CHANGED == 1 && matrix.platform == 'emscripten-wasm32'
14887 run : |
149- env -i $HOME/.pixi/bin/pixi run -e beta sh -c 'find additional_recipes/* -maxdepth 0 -type d -exec ln -s ../{} recipes/ \;'
150- env -i $HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir ./recipes --target-platform emscripten-wasm32 -m ./conda_build_config.yaml -c https://repo.mamba.pm/emscripten-forge/ -c robostack-staging -c conda-forge --skip-existing --test skip
151- - name : Build recipes for linux-aarch64
88+ pixi run python check_patches_clean_apply.py
89+
90+ - name : Restore build cache
91+ id : cache-restore
92+ uses : actions/cache/restore@v4
93+ with :
94+ path : |
95+ ${{ matrix.folder_cache }}
96+ key : ${{ runner.os }}-${{ matrix.platform }}-pr-${{ github.event.pull_request.number }}
97+ # allow a later run to pick up a cache that has an extra suffix
98+ restore-keys : |
99+ ${{ runner.os }}-${{ matrix.platform }}-pr-${{ github.event.pull_request.number }}-
100+
101+ - name : See packages restored by cache
152102 shell : bash -l {0}
153- if : steps.newrecipecheck.outputs.RECIPE_CREATED == 1 && matrix.platform == 'linux-aarch64'
154103 run : |
155- env -i $HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir additional_recipes --target-platform linux-aarch64 -m ./conda_build_config.yaml -c robostack-staging -c conda-forge --skip-existing
156- env -i $HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir recipes --target-platform linux-aarch64 -m ./conda_build_config.yaml -c robostack-staging -c conda-forge --skip-existing
157- - name : Build recipes for osx-64
104+ ls ${{ matrix.folder_cache }}
105+
106+ - name : Build recipes [non emscripten]
158107 shell : bash -l {0}
159- if : steps.newrecipecheck.outputs.RECIPE_CREATED == 1 && matrix.platform == 'osx-64 '
108+ if : matrix.platform != 'emscripten-wasm32 '
160109 run : |
161- env -i $HOME/. pixi/bin/pixi run -e beta rattler-build build --recipe-dir additional_recipes --target-platform osx-64 -m ./conda_build_config.yaml -c robostack-staging -c conda-forge --skip-existing
162- env -i $HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir recipes --target-platform osx-64 -m ./conda_build_config.yaml -c robostack-staging -c conda-forge --skip-existing
163- - name : Build recipes for osx-arm64
110+ 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
111+
112+ - name : Build recipes [emscripten]
164113 shell : bash -l {0}
165- if : steps.newrecipecheck.outputs.RECIPE_CREATED == 1 && matrix.platform == 'osx-arm64 '
114+ if : matrix.platform == 'emscripten-wasm32 '
166115 run : |
167- env -i $HOME/. pixi/bin/pixi run -e beta rattler-build build --recipe-dir additional_recipes --target-platform osx-arm64 -m ./conda_build_config.yaml -c robostack-staging -c conda-forge -- skip-existing
168- env -i $HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir recipes --target-platform osx-arm64 -m ./conda_build_config.yaml -c robostack-staging -c conda-forge --skip-existing
169- - name : Build recipes for win-64
116+ 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
117+
118+ - name : See packages that will be saved in cache
170119 shell : bash -l {0}
171- if : steps.newrecipecheck.outputs.RECIPE_CREATED == 1 && matrix.platform == 'win-64'
120+ if : always()
172121 run : |
173- $HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir additional_recipes --target-platform win-64 -m ./conda_build_config.yaml -c robostack-staging -c conda-forge --skip-existing
174- $HOME/.pixi/bin/pixi run -e beta rattler-build build --recipe-dir recipes -m ./conda_build_config.yaml --target-platform win-64 -c robostack-staging -c conda-forge --skip-existing
122+ ls ${{ matrix.folder_cache }}
123+
124+ - name : Save build cache
125+ uses : actions/cache/save@v4
126+ if : always()
127+ with :
128+ path : |
129+ ${{ matrix.folder_cache }}
130+ key : ${{ runner.os }}-${{ matrix.platform }}-pr-${{ github.event.pull_request.number }}-${{ github.run_id }}-${{ github.run_attempt }}
131+
132+ - name : Upload build cache as artifact
133+ if : ${{ always() && env.SAVE_CACHE_AS_ARTIFACT == 'true' }}
134+ uses : actions/upload-artifact@v4
135+ with :
136+ name : cache-${{ matrix.platform }}-${{ github.run_id }}
137+ path : ${{ matrix.folder_cache }}
138+ retention-days : 7
0 commit comments