Skip to content

Commit

Permalink
ci: Build tests under standard project folder tree
Browse files Browse the repository at this point in the history
This uses standard folder tree to build tests (where nimble is in
repos folder, and not as a top project folder).
  • Loading branch information
sjanc committed Sep 25, 2023
1 parent acc3ee9 commit ac01cf6
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 112 deletions.
28 changes: 5 additions & 23 deletions .github/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
Expand All @@ -17,34 +17,16 @@
# under the License.
#

project.name: "apache-mynewt-nimble"
project.name: "my_project"

project.repositories:
- apache-mynewt-core
- mcuboot
- apache-mynewt-mcumgr

# Use github's distribution mechanism for core ASF libraries.
# This provides mirroring automatically for us.
#
repository.apache-mynewt-core:
type: github
vers: 0.0.0
user: apache
repo: mynewt-core

repository.mcuboot:
type: github
vers: 0.0.0
user: mcu-tools
repo: mcuboot
branch: main

repository.apache-mynewt-mcumgr:
type: github
vers: 0.0.0
user: apache
repo: mynewt-mcumgr

repository.tinyusb:
type: github
vers: 0.0.0
user: hathach
repo: tinyusb
56 changes: 0 additions & 56 deletions .github/project_ports.yml

This file was deleted.

33 changes: 19 additions & 14 deletions .github/workflows/build_targets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,29 @@ jobs:
go version
go install mynewt.apache.org/newt/newt@latest
- name: Setup project
shell: bash
run: |
cp .github/project.yml project.yml
mkdir repos
git clone --depth=1 https://github.com/apache/mynewt-core repos/apache-mynewt-core
git clone --depth=1 https://github.com/mcu-tools/mcuboot.git repos/mcuboot
git clone --depth=1 https://github.com/apache/mynewt-mcumgr repos/apache-mynewt-mcumgr
git clone --depth=1 https://github.com/hathach/tinyusb.git repos/tinyusb
git clone --depth=1 https://github.com/NordicSemiconductor/nrfx --branch v2.11.0 repos/nordic-nrfx
git clone --depth=1 https://github.com/Mbed-TLS/mbedtls.git --branch v2.28.4 repos/mbedtls
newt new build
cp -f .github/project.yml build/project.yml
cd build
newt upgrade --shallow=1
rm -rf targets
rm -rf repos/apache-mynewt-nimble
git clone .. repos/apache-mynewt-nimble
cd ..
- name: Build targets
shell: bash
run: |
cp -r .github/targets targets_ci
ls targets_ci | xargs -n1 sh -c 'echo "Testing $0"; newt build -q targets_ci/$0'
rm -rf targets_ci
cp -r .github/targets build/targets
cd build
ls targets | xargs -n1 sh -c 'echo "Testing $0"; newt build -q targets_ci/$0'
rm -rf targets
cd ..
- name: Build Linux-only targets
if: matrix.os == 'ubuntu-latest'
run: |
cp -r .github/targets_linux targets_ci
ls targets_ci | xargs -n1 sh -c 'echo "Testing $0"; newt build -q targets_ci/$0'
rm -rf targets_ci
cp -r .github/targets_linux build/targets_ci
cd build
ls targets | xargs -n1 sh -c 'echo "Testing $0"; newt build -q targets_ci/$0'
rm -rf targets
cd ..
15 changes: 7 additions & 8 deletions .github/workflows/newt_test_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,12 @@ jobs:
go install mynewt.apache.org/newt/newt@latest
- name: Setup project
run: |
cp .github/project.yml project.yml
mkdir repos
git clone --depth=1 https://github.com/apache/mynewt-core repos/apache-mynewt-core
git clone --depth=1 https://github.com/mcu-tools/mcuboot.git repos/mcuboot
git clone --depth=1 https://github.com/apache/mynewt-mcumgr repos/apache-mynewt-mcumgr
git clone --depth=1 https://github.com/hathach/tinyusb.git repos/tinyusb
git clone --depth=1 https://github.com/NordicSemiconductor/nrfx --branch v2.11.0 repos/nordic-nrfx
git clone --depth=1 https://github.com/Mbed-TLS/mbedtls.git --branch v2.28.4 repos/mbedtls
newt new build
cp -f .github/project.yml build/project.yml
cd build
newt upgrade --shallow=1
rm -rf repos/apache-mynewt-nimble
git clone .. repos/apache-mynewt-nimble
cd ..
- name: newt test all
run: newt test all
19 changes: 8 additions & 11 deletions .github/workflows/ports_syscfg_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,16 @@ jobs:
go install mynewt.apache.org/newt/newt@latest
- name: Setup project
run: |
mkdir /tmp/proj
mkdir /tmp/proj/repos
cp .github/project_ports.yml /tmp/proj/project.yml
git clone --depth=1 https://github.com/apache/mynewt-core /tmp/proj/repos/apache-mynewt-core
git clone --depth=1 https://github.com/mcu-tools/mcuboot.git /tmp/proj/repos/mcuboot
git clone --depth=1 https://github.com/apache/mynewt-mcumgr /tmp/proj/repos/apache-mynewt-mcumgr
git clone --depth=1 https://github.com/hathach/tinyusb.git /tmp/proj/repos/tinyusb
git clone --depth=1 https://github.com/NordicSemiconductor/nrfx --branch v2.11.0 repos/nordic-nrfx
git clone --depth=1 https://github.com/Mbed-TLS/mbedtls.git --branch v2.28.4 repos/mbedtls
cp -r `pwd` /tmp/proj/repos/apache-mynewt-nimble
newt new build
cp -f .github/project.yml build/project.yml
cd build
newt upgrade --shallow=1
rm -rf repos/apache-mynewt-nimble
git clone .. repos/apache-mynewt-nimble
cd ..
- name: Build ports tests targets
run: |
cd /tmp/proj
cd build
./repos/apache-mynewt-nimble/porting/update_generated_files.sh
cd repos/apache-mynewt-nimble
- name: Check ports syscfg (debug)
Expand Down

0 comments on commit ac01cf6

Please sign in to comment.