-
Notifications
You must be signed in to change notification settings - Fork 7
144 lines (125 loc) · 4.98 KB
/
Copy pathtestpr.yml
File metadata and controls
144 lines (125 loc) · 4.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
on:
pull_request:
workflow_dispatch:
env:
ROS_VERSION: 2
PYTHONIOENCODING: utf-8
# Change to 'true' to enable the cache upload as artifacts
SAVE_CACHE_AS_ARTIFACT: 'true'
# Change to 'true' to ignore cache and force a full rebuild, but please restore to 'false' before merging
IGNORE_CACHE_AND_DO_FULL_REBUILD: '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-15-intel
platform: osx-64
folder_cache: 'output/osx-64'
- os: macos-15
platform: osx-arm64
folder_cache: 'output/osx-arm64'
- os: windows-2022
platform: win-64
folder_cache: 'C:/bld/win-64'
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
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.9.4
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@v5
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/"
- 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 check-patches
- name: Restore build cache
id: cache-restore
uses: actions/cache/restore@v5
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: Optional force full rebuild
if: ${{ env.IGNORE_CACHE_AND_DO_FULL_REBUILD == 'true' }}
shell: bash -l {0}
run: |
rm -rf ${{ matrix.folder_cache }}/*
- name: Delete specific outdated cache entries
shell: bash -l {0}
run: |
# rm -rf ${{ matrix.folder_cache }}/ros-rolling-moveit-ros-perception* 2>/dev/null || true
mkdir -p ${{ matrix.folder_cache }}
pixi run rattler-index fs ${{ matrix.folder_cache }}/.. --force
- name: See packages restored by cache
shell: bash -l {0}
run: |
ls ${{ matrix.folder_cache }} || true
- name: Build recipes
shell: bash -l {0}
run: |
pixi run rattler-build build --recipe-dir recipes --target-platform ${{ matrix.platform }} -m ./conda_build_config.yaml -c https://prefix.dev/conda-forge -c https://prefix.dev/robostack-rolling --skip-existing
- 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@v5
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: Generate GitHub Actions workflows to catch post-PR problems
shell: bash -l {0}
run: |
pixi run vinca-gha --platform ${{ matrix.platform }} --trigger-branch dummy_build_branch_as_it_is_unused -d ./recipes
- name: Upload build cache as artifact
if: ${{ always() && env.SAVE_CACHE_AS_ARTIFACT == 'true' }}
uses: actions/upload-artifact@v6
with:
name: cache-${{ matrix.platform }}-${{ github.run_id }}
path: ${{ matrix.folder_cache }}
retention-days: 7