-
Notifications
You must be signed in to change notification settings - Fork 1
136 lines (133 loc) · 4.03 KB
/
build.yml
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
name: Build mc-rtc ports
on:
push:
branches:
- '**'
jobs:
build-packages:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-20.04, macos-latest]
runs-on: ${{ matrix.os }}
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
steps:
- uses: actions/checkout@v2
- name: Remove default installation
shell: bash
run: |
rm -rf "$VCPKG_INSTALLATION_ROOT" || sudo rm -rf "$VCPKG_INSTALLATION_ROOT" || true
- name: Restore cache
uses: actions/cache@v2
with:
path: |
${{ env.VCPKG_ROOT }}
!${{ env.VCPKG_ROOT }}/buildtrees
!${{ env.VCPKG_ROOT }}/packages
!${{ env.VCPKG_ROOT }}/downloads
key: |
vcpkg-1-${{ matrix.os }}-${{ github.sha }}
restore-keys: |
vcpkg-1-${{ matrix.os }}-
- name: Clone vcpkg
shell: bash
run: |
if [ ! -d vcpkg ]
then
echo "BOOTSTRAP_VCPKG=true" >> $GITHUB_ENV
git clone --recursive https://github.com/microsoft/vcpkg || true
echo "VCPKG_HEAD=`cd vcpkg && git rev-parse HEAD`" >> $GITHUB_ENV
else
cd vcpkg
old_head=`git rev-parse HEAD`
git pull
new_head=`git rev-parse HEAD`
if [ $old_head = $new_head ]
then
echo "BOOTSTRAP_VCPKG=false" >> $GITHUB_ENV
else
echo "BOOTSTRAP_VCPKG=true" >> $GITHUB_ENV
fi
echo "VCPKG_HEAD=${new_head}" >> $GITHUB_ENV
fi
if ${{ startsWith(runner.os, 'Windows') }}
then
echo "VCPKG_DEFAULT_TRIPLET=x64-windows" >> $GITHUB_ENV
fi
if ${{ startsWith(runner.os, 'Linux') }}
then
echo "VCPKG_DEFAULT_TRIPLET=x64-linux-dynamic" >> $GITHUB_ENV
fi
- name: Bootstrap vcpkg (Windows)
if: startsWith(runner.os, 'Windows')
shell: bash
run: |
if $BOOTSTRAP_VCPKG
then
cd vcpkg
./bootstrap-vcpkg.bat
fi
- name: Bootstrap vcpkg (Linux)
if: startsWith(runner.os, 'Linux')
run: |
export CXX=g++ # Enforce default g++ selection
sudo apt-get install -y python3-setuptools
if $BOOTSTRAP_VCPKG
then
cd vcpkg
./bootstrap-vcpkg.sh
fi
- name: Bootstrap vcpkg (macOS)
if: startsWith(runner.os, 'macOS')
run: |
brew unlink gcc && brew link gcc
if $BOOTSTRAP_VCPKG
then
cd vcpkg
./bootstrap-vcpkg.sh -allowAppleClang
fi
- name: Setup vcpkg-configuration.json
shell: bash
run: |
GITHUB_WORKSPACE=$(echo "${{ github.workspace }}" | sed -e's/\\/\\\\/g')
cat <<EOF | tee vcpkg/vcpkg-configuration.json
{
"default-registry": {
"kind": "git",
"repository": "https://github.com/Microsoft/vcpkg",
"baseline": "${VCPKG_HEAD}"
},
"registries":
[
{
"kind": "git",
"baseline": "${{ github.sha }}",
"repository": "${GITHUB_WORKSPACE}",
"packages": [ "spacevecalg", "rbdyn", "eigen-qld", "sch-core", "tasks", "mc-rbdyn-urdf", "mc-rtc-data", "eigen-quadprog", "state-observation", "hpp-spline", "ndcurves", "mc-rtc", "tvm", "libnotify" ]
}
]
}
EOF
- name: Install
shell: bash
run: |
./vcpkg/vcpkg remove --outdated --recurse
echo "JRL_PORT=tvm" >> $GITHUB_ENV
./vcpkg/vcpkg install --feature-flags=registries --debug tvm
echo "JRL_PORT=mc-rtc" >> $GITHUB_ENV
./vcpkg/vcpkg install --feature-flags=registries --debug mc-rtc
rm -rf $VCPKG_ROOT/buildtrees
rm -rf $VCPKG_ROOT/packages
rm -rf $VCPKG_ROOT/downloads
- name: Show logs
if: failure()
shell: bash
run: |
for f in `ls vcpkg/buildtrees/${JRL_PORT}/*.log`
do
echo "=========="
echo "$f"
echo "=========="
cat $f
done