-
-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy path.gitlab-ci.yml
114 lines (91 loc) · 3.61 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
# GitLab CI to build Rust+Mynewt Firmware for PineTime Smart Watch
# Based on https://github.com/lupyuen/pinetime-rust-mynewt/blob/master/.github/workflows/main.yml
# Official language image. Look for the different tagged releases at: https://hub.docker.com/r/library/rust/tags/
image: "rust:latest"
build:
stage: build
#########################################################################################
# Checkout
variables:
# Clone submodules recursively
GIT_SUBMODULE_STRATEGY: recursive
#########################################################################################
# Download and Cache Dependencies
before_script:
# Show files
- set ; pwd ; ls -l
# Install Go
- pushd /tmp
- wget -qO- https://golang.org/dl/go1.14.7.linux-amd64.tar.gz | tar -xz
- popd
- export PATH=$PATH:/tmp/go/bin
- go version
- ln -s /tmp/go/bin/go /usr/local/bin/go
- /usr/local/bin/go version
# Install newt
- source scripts/install-version.sh
- pushd /tmp
# "master" was previously "$mynewt_version". See https://github.com/apache/mynewt-core/pull/2430
- git clone --branch master https://github.com/apache/mynewt-newt/
- cd mynewt-newt/
- ./build.sh
- newt/newt version
- popd
- export PATH=$PATH:/tmp/mynewt-newt/newt
- newt version
# Download Mynewt source files
- export PATH=$PATH:/tmp/mynewt-newt/newt
- source scripts/install-version.sh
- mkdir repos
- cp -r patch/repos-windows/.configs repos
- pushd repos
- git clone --branch $mcuboot_version https://github.com/JuulLabs-OSS/mcuboot mcuboot
- git clone --branch $mynewt_version https://github.com/apache/mynewt-core apache-mynewt-core
- git clone --branch $nimble_version https://github.com/apache/mynewt-nimble apache-mynewt-nimble
- ls -la
- popd
# Install Rust Target thumbv7em-none-eabihf
- rustup default nightly
- rustup target add thumbv7em-none-eabihf
# Install Embedded Arm Toolchain arm-none-eabi-gcc
- pushd /tmp
- wget -qO- https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz2 | tar -xj
- popd
- export PATH=$PATH:/tmp/gcc-arm-none-eabi-9-2020-q2-update/bin
- arm-none-eabi-gcc --version
#########################################################################################
# Build Bootloader and Rust+Mynewt Application Firmware
script:
# Set PATH
- export PATH=$PATH:/tmp/go/bin:/tmp/mynewt-newt/newt:/tmp/gcc-arm-none-eabi-9-2020-q2-update/bin
# Build Bootloader
- ./scripts/nrf52/build-boot.sh
# Build Application Firmware
- ./scripts/build-app.sh
# Create Application Firmware Image
- ./scripts/nrf52/image-app.sh
# Copy Bootloader and Application Firmware Artifacts to the top level
- cp bin/targets/nrf52_boot/app/@mcuboot/boot/mynewt/mynewt.* .
- cp bin/targets/nrf52_my_sensor/app/apps/my_sensor_app/my_sensor_app.* .
#########################################################################################
# Upload Bootloader and Application Firmware
artifacts:
paths:
# Bootloader
- mynewt.*
# Application Firmware
- my_sensor_app.*
#########################################################################################
# Cache Outputs
cache:
paths:
# - "*.o"
# - /tmp/go
# - /tmp/mynewt-newt
# - /tmp/gcc-arm-none-eabi-9-2020-q2-update
#########################################################################################
# Run Tests
test:
stage: test
script:
- echo "Done!"