From c8bb0255a828f5ba14f5707618e5df97c8efa88c Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Mon, 25 Sep 2023 15:41:54 +0200 Subject: [PATCH] ci: Build tests under standard project folder tree This uses standard folder tree to build tests (where nimble is in repos folder, and not as a top project folder). --- .github/project.yml | 28 +++--------- .github/project_ports.yml | 56 ------------------------ .github/workflows/build_targets.yml | 33 ++++++++------ .github/workflows/newt_test_all.yml | 15 +++---- .github/workflows/ports_syscfg_check.yml | 19 ++++---- 5 files changed, 39 insertions(+), 112 deletions(-) delete mode 100644 .github/project_ports.yml diff --git a/.github/project.yml b/.github/project.yml index 10eb2dfce2..4d81374169 100644 --- a/.github/project.yml +++ b/.github/project.yml @@ -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, @@ -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 diff --git a/.github/project_ports.yml b/.github/project_ports.yml deleted file mode 100644 index 0a9b2cf01b..0000000000 --- a/.github/project_ports.yml +++ /dev/null @@ -1,56 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# 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, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# - -project.name: "apache-mynewt-nimble" - -project.repositories: - - apache-mynewt-core - - mcuboot - - apache-mynewt-mcumgr - -repository.apache-mynewt-core: - type: github - vers: 0.0.0 - user: apache - repo: mynewt-core - -repository.apache-mynewt-nimble: - type: github - vers: 0.0.0 - user: apache - repo: mynewt-nimble - -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 diff --git a/.github/workflows/build_targets.yml b/.github/workflows/build_targets.yml index 05b13eb94f..6ab9c9be1d 100644 --- a/.github/workflows/build_targets.yml +++ b/.github/workflows/build_targets.yml @@ -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 $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 + cd build + ls targets | xargs -n1 sh -c 'echo "Testing $0"; newt build -q $0' + rm -rf targets + cd .. diff --git a/.github/workflows/newt_test_all.yml b/.github/workflows/newt_test_all.yml index 44bf601494..a2eff2413d 100644 --- a/.github/workflows/newt_test_all.yml +++ b/.github/workflows/newt_test_all.yml @@ -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 diff --git a/.github/workflows/ports_syscfg_check.yml b/.github/workflows/ports_syscfg_check.yml index e3c41633a4..b261cfa5eb 100644 --- a/.github/workflows/ports_syscfg_check.yml +++ b/.github/workflows/ports_syscfg_check.yml @@ -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)