4
4
5
5
env :
6
6
ROS_VERSION : 2
7
-
7
+ # Change to 'true' to enable the cache upload as artifacts
8
+ SAVE_CACHE_AS_ARTIFACT : ' false'
8
9
jobs :
9
10
build :
10
11
strategy :
@@ -13,14 +14,19 @@ jobs:
13
14
include :
14
15
- os : ubuntu-latest
15
16
platform : linux-64
17
+ folder_cache : ' output/linux-64'
16
18
- os : ubuntu-24.04-arm
17
19
platform : linux-aarch64
20
+ folder_cache : ' output/linux-aarch64'
18
21
- os : macos-13
19
22
platform : osx-64
23
+ folder_cache : ' output/osx-64'
20
24
- os : macos-14
21
25
platform : osx-arm64
26
+ folder_cache : ' output/osx-arm64'
22
27
- os : windows-2022
23
28
platform : win-64
29
+ folder_cache : ' C:/bld/win-64'
24
30
25
31
runs-on : ${{ matrix.os }}
26
32
32
38
33
39
-
uses :
prefix-dev/[email protected]
34
40
with :
35
- pixi-version : v0.49.0
36
41
frozen : true
37
42
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
+
38
51
# Workaround for https://github.com/RoboStack/ros-humble/pull/141#issuecomment-1941919816
39
52
- name : Clean up PATH
40
53
if : contains(matrix.os, 'windows')
@@ -54,94 +67,71 @@ jobs:
54
67
rm -rf /c/Strawberry
55
68
rm -rf "/c/Program Files (x86)/Windows Kits/10/Include/10.0.17763.0/"
56
69
57
-
58
70
# Regression for https://github.com/RoboStack/ros-jazzy/issues/44
59
71
- name : Check that anaconda-client command works fine
60
72
shell : bash -l {0}
61
73
run : |
62
74
pixi run anaconda --version
63
75
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
93
77
shell : bash -l {0}
94
- if : matrix.platform == 'win-64'
95
78
run : |
96
- # Workaround for problem related to long paths
97
- echo "CONDA_BLD_PATH=C:\\bld\\" >> $GITHUB_ENV
98
- mkdir /c/bld
99
79
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
114
83
shell : bash -l {0}
115
- if : steps.newrecipecheck.outputs.RECIPE_CREATED == 1 && matrix.platform == 'linux-64'
116
84
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
121
99
shell : bash -l {0}
122
- if : steps.newrecipecheck.outputs.RECIPE_CREATED == 1 && matrix.platform == 'linux-aarch64'
123
100
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
128
108
shell : bash -l {0}
129
- if : steps.newrecipecheck.outputs.RECIPE_CREATED == 1 && matrix.platform == 'osx-64'
130
109
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
135
113
shell : bash -l {0}
136
- if : steps.newrecipecheck.outputs.RECIPE_CREATED == 1 && matrix.platform == 'osx-arm64'
137
114
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
142
118
shell : bash -l {0}
143
- if : steps.newrecipecheck.outputs.RECIPE_CREATED == 1 && matrix.platform == 'win-64'
119
+ if : always()
144
120
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