Skip to content

Commit 02db524

Browse files
sjancutzig
authored andcommitted
ci: mynewt: Use newt for downloading dependencies
This makes sure that Mynewt targets have all required dependencies downloaded. Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
1 parent 742978e commit 02db524

File tree

3 files changed

+49
-12
lines changed

3 files changed

+49
-12
lines changed

.github/workflows/mynewt.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ jobs:
1818
- uses: actions/checkout@v2
1919
with:
2020
fetch-depth: 0
21+
- uses: actions/setup-go@v3
22+
with:
23+
go-version: 'stable'
2124
- name: Print the environment
2225
run: |
2326
uname -a

ci/mynewt_install.sh

+9-12
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,19 @@ install_newt() {
3030
popd
3131
}
3232

33-
shallow_clone_mynewt() {
34-
mkdir -p repos/apache-mynewt-core
35-
git clone --depth=1 https://github.com/apache/mynewt-core repos/apache-mynewt-core
33+
install_mynewt() {
34+
build="$PWD/build"
35+
newt new "$build"
3636
[[ $? -ne 0 ]] && exit 1
3737

38-
# nrfx is now taken from original repository
39-
git clone --depth=1 --branch v3.3.0 https://github.com/NordicSemiconductor/nrfx.git repos/nordic-nrfx
40-
[[ $? -ne 0 ]] && exit 1
38+
cp -f ci/mynewt_project.yml "$build"/project.yml
4139

42-
# Mbed-TLS is now taken from original repository
43-
git clone --depth=1 --branch v2.28.4 https://github.com/Mbed-TLS/mbedtls.git repos/mbedtls
40+
pushd "$build"
41+
newt upgrade --shallow=1
4442
[[ $? -ne 0 ]] && exit 1
4543

46-
# CMSIS is now taken from original repository
47-
git clone --depth=1 --branch 5.4.0 https://github.com/ARM-software/CMSIS_5.git repos/arm-CMSIS_5
48-
[[ $? -ne 0 ]] && exit 1
44+
popd
45+
mv "$build"/repos .
4946
}
5047

5148
arm_toolchain_install() {
@@ -78,6 +75,6 @@ mkdir -p $HOME/bin
7875
export PATH=$HOME/bin:$PATH
7976

8077
install_newt
81-
shallow_clone_mynewt
78+
install_mynewt
8279
arm_toolchain_install
8380
native_test_setup

ci/mynewt_project.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
project.name: "my_project"
21+
22+
# Use github's distribution mechanism for core ASF libraries.
23+
# This provides mirroring automatically for us.
24+
#
25+
repository.apache-mynewt-core:
26+
type: github
27+
vers: 0.0.0
28+
user: apache
29+
repo: mynewt-core
30+
31+
project.repositories.allowed:
32+
- apache-mynewt-core
33+
- apache-mynewt-nimble
34+
- apache-mynewt-mcumgr
35+
- mbedtls
36+
- nordic-nrfx
37+
- arm-CMSIS_5

0 commit comments

Comments
 (0)