-
Notifications
You must be signed in to change notification settings - Fork 51
/
.gitlab-ci.yml
131 lines (121 loc) · 3.54 KB
/
.gitlab-ci.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
stages:
- build-toolchain
- build-components
- build-runtime
variables:
TOOLCHAIN_IMAGE: $CI_REGISTRY/zeroth-robotics/openlch/openlch-runtime-sdk
GIT_SUBMODULE_STRATEGY: recursive
GIT_SUBMODULE_PATHS: runtime/firmware/tpu-sdk-sg200x runtime/firmware/duo-sdk
.runner: &runner
tags:
- linux-x64
.c-build: &c-build
variables:
TOOLCHAIN_PREFIX: /sdk/host/bin/riscv64-buildroot-linux-musl-
SYSROOT: /sdk/host/riscv64-buildroot-linux-musl/sysroot
CFLAGS: -mcmodel=medany -mabi=lp64d
LDFLAGS: -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
TPU_SDK_DIR: ../tpu-sdk-sg200x
build-toolchain:
<<: *runner
stage: build-toolchain
services:
- docker:dind
image: docker:latest
script:
- |
if [ "$GITLAB_CI" != "false" ]; then
echo "$CI_REGISTRY_PASSWORD" | docker login $CI_REGISTRY -u $CI_REGISTRY_USER --password-stdin
docker pull $TOOLCHAIN_IMAGE:latest || true
fi
- docker build --progress=plain --cache-from $TOOLCHAIN_IMAGE:latest -t $TOOLCHAIN_IMAGE:latest -f runtime/toolchain-docker-img/Dockerfile .
- |
if [ "$GITLAB_CI" != "false" ]; then
docker push $TOOLCHAIN_IMAGE:latest
fi
rules:
- if: $CI_PIPELINE_SOURCE == "push"
changes:
- runtime/toolchain-docker-img/**/*
- .gitlab-ci.yml
build-cviwrapper:
<<: *runner
<<: *c-build
stage: build-runtime
image: $TOOLCHAIN_IMAGE:latest
script:
- cd runtime/firmware/cviwrapper
- make
artifacts:
paths:
- runtime/firmware/cviwrapper/libcviwrapper.so
expire_in: 1 week
rules:
- if: $CI_PIPELINE_SOURCE == "push"
changes:
- runtime/**/*
- .gitlab-ci.yml
build-servo:
<<: *runner
<<: *c-build
stage: build-runtime
image: $TOOLCHAIN_IMAGE:latest
script:
- cd runtime/firmware/sts3215
- make
artifacts:
paths:
- runtime/firmware/sts3215/libsts3215.so
expire_in: 1 week
rules:
- if: $CI_PIPELINE_SOURCE == "push"
changes:
- runtime/**/*
- .gitlab-ci.yml
build-efuse:
<<: *runner
<<: *c-build
stage: build-runtime
image: $TOOLCHAIN_IMAGE:latest
script:
- cd runtime/firmware/efuse
- make
artifacts:
paths:
- runtime/firmware/efuse/efuse_read_serial
expire_in: 1 week
rules:
- if: $CI_PIPELINE_SOURCE == "push"
changes:
- runtime/**/*
- .gitlab-ci.yml
build-runtime:
<<: *runner
stage: build-runtime
image: $TOOLCHAIN_IMAGE:latest
needs:
- build-cviwrapper
- build-servo
script:
- cd runtime
- source /root/.cargo/env
- cargo +nightly build --features milkv --no-default-features --target riscv64gc-unknown-linux-musl -Zbuild-std --release
artifacts:
paths:
- runtime/target/riscv64gc-unknown-linux-musl/release/
exclude:
- runtime/target/riscv64gc-unknown-linux-musl/release/**/*.d
- runtime/target/riscv64gc-unknown-linux-musl/release/**/*.rlib
- runtime/target/riscv64gc-unknown-linux-musl/release/build
- runtime/target/riscv64gc-unknown-linux-musl/release/build/**/*
- runtime/target/riscv64gc-unknown-linux-musl/release/deps
- runtime/target/riscv64gc-unknown-linux-musl/release/deps/**/*
- runtime/target/riscv64gc-unknown-linux-musl/release/.fingerprint
- runtime/target/riscv64gc-unknown-linux-musl/release/.fingerprint/**/*
- runtime/target/riscv64gc-unknown-linux-musl/release/.cargo-lock
expire_in: 1 week
rules:
- if: $CI_PIPELINE_SOURCE == "push"
changes:
- runtime/**/*
- .gitlab-ci.yml