-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy path.travis.yml
61 lines (55 loc) · 2.71 KB
/
.travis.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
sudo: required
dist: trusty
language: go
go_import_path: github.com/coreos/ignition
go:
- "1.10.4"
- "1.11"
env:
matrix:
- TARGET=amd64
- TARGET=arm64 GIMME_ARCH=arm64 GIMME_CGO_ENABLED=1
addons:
apt:
packages:
# install cross compilers for cgo support.
- gcc-aarch64-linux-gnu
- libc6-dev-arm64-cross
- libblkid-dev
install:
# since libblkid-dev:arm64 cannot be installed, spoof it
- if [ "${TARGET}" == "arm64" ]; then
echo "void blkid_new_probe_from_filename(void) {}" >> stub.c;
echo "void blkid_do_probe(void) {}" >> stub.c;
echo "void blkid_probe_has_value(void) {}" >> stub.c;
echo "void blkid_probe_lookup_value(void) {}" >> stub.c;
echo "void blkid_free_probe(void) {}" >> stub.c;
echo "void blkid_probe_get_partitions(void) {}" >> stub.c;
echo "void blkid_partlist_get_table(void) {}" >> stub.c;
echo "void blkid_partlist_get_partition(void) {}" >> stub.c;
echo "void blkid_partlist_numof_partitions(void) {}" >> stub.c;
echo "void blkid_partition_get_name(void) {}" >> stub.c;
echo "void blkid_partition_get_uuid(void) {}" >> stub.c;
echo "void blkid_partition_get_type_string(void) {}" >> stub.c;
echo "void blkid_partition_get_start(void) {}" >> stub.c;
echo "void blkid_partition_get_size(void) {}" >> stub.c;
echo "void blkid_partition_get_partno(void) {}" >> stub.c;
echo "void blkid_parttable_get_type(void) {}" >> stub.c;
echo "void blkid_probe_get_topology (void) {}" >> stub.c;
echo "void blkid_topology_get_logical_sector_size(void) {}" >> stub.c;
aarch64-linux-gnu-gcc-4.8 -c -o stub.o stub.c;
aarch64-linux-gnu-gcc-ar-4.8 cq libblkid.a stub.o;
fi
script:
- if [ "${TARGET}" == "amd64" ]; then
GOARCH="${TARGET}" ./test;
elif [ "${TARGET}" == "arm64" ]; then
export CGO_LDFLAGS="-L ${PWD}";
GOARCH="${TARGET}" ./build && file "bin/${TARGET}/ignition" | egrep 'aarch64';
fi
- if [ "${TARGET}" == "amd64" ]; then
GOARCH="${TARGET}" ./build_blackbox_tests;
elif [ "${TARGET}" == "arm64" ]; then
export CGO_LDFLAGS="-L ${PWD}";
GOARCH="${TARGET}" ./build_blackbox_tests && file "tests.test" | egrep 'aarch64';
fi