This is an automated email from the ASF dual-hosted git repository. sjanc pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
commit 42bb81a04b734e5f0cd76bdfe6d41ce12afb690b Author: Szymon Janc <[email protected]> AuthorDate: Wed Oct 14 00:55:50 2026 +0200 ci: Merge build workflows into single workflow Each build and test workflow downloaded all external repositories on its own and applications job built everything sequentially. Merge targets, GCC target, apps, ports and unit tests workflows into single workflow. Prepare job downloads repositories once and passes them to all Linux jobs using newt as workflow artifact, so those jobs don't run newt upgrade at all. Only .git directories of repositories are packed and jobs check out working trees after restore. Prepare job also saves repositories cache. Unit tests job replaces project file with one limiting repositories to those for which tests should be run. Windows and macOS jobs still set up project on their own. Newt is built once per run, for all platforms used by workflow, and passed to other jobs as artifact, so it is never built several times in parallel when cache is empty. Newt is cross-compiled, as it doesn't use cgo. Applications are split into shards built in parallel jobs. Number of GCC target jobs running in parallel is limited to fit ASF job concurrency limit per workflow. README is updated to show single badge for merged workflow. Assisted-by: Claude:claude-opus-5-5 --- .github/actions/newt-install/action.yml | 112 +++++++- .github/actions/newt-project-restore/action.yml | 65 +++++ .github/workflows/build.yml | 359 ++++++++++++++++++++++++ .github/workflows/build_all_apps.yml | 69 ----- .github/workflows/build_cc_target.yml | 66 ----- .github/workflows/build_ports.yml | 112 -------- .github/workflows/build_targets.yml | 83 ------ .github/workflows/newt_test_all.yml | 69 ----- README.md | 20 +- 9 files changed, 526 insertions(+), 429 deletions(-) diff --git a/.github/actions/newt-install/action.yml b/.github/actions/newt-install/action.yml index 58e406799..55e203bde 100644 --- a/.github/actions/newt-install/action.yml +++ b/.github/actions/newt-install/action.yml @@ -20,13 +20,70 @@ name: Install newt description: > Install newt built from master branch of apache/mynewt-newt. Built - binary is cached per newt commit, so newt is rebuilt only when newt - master branch changes. + binaries are cached per newt commit, so newt is rebuilt only when newt + master branch changes. Newt can also be taken from artifact uploaded + by another job of the same workflow run, so that it is built only once. + +inputs: + platforms: + description: > + Space separated list of GOOS/GOARCH platforms to build newt for, in + addition to platform of the runner. Binaries are stored in + directory provided by dist output. + required: false + default: '' + artifact: + description: > + Name of artifact with newt binaries (dist directory) uploaded by + another job. If set, newt is taken from it instead of being built. + required: false + default: '' + +outputs: + dist: + description: Directory with newt binaries, one subdirectory per platform + value: ${{ steps.platform.outputs.dist }} runs: using: composite steps: + - name: Get platforms + id: platform + shell: bash + env: + RUNNER_OS: ${{ runner.os }} + RUNNER_ARCH: ${{ runner.arch }} + PLATFORMS: ${{ inputs.platforms }} + run: | + case "$RUNNER_OS" in + Linux) goos=linux ;; + Windows) goos=windows ;; + macOS) goos=darwin ;; + esac + case "$RUNNER_ARCH" in + X64) goarch=amd64 ;; + ARM64) goarch=arm64 ;; + esac + if [ -z "$goos" ] || [ -z "$goarch" ]; then + echo "::error::Unsupported runner $RUNNER_OS $RUNNER_ARCH" + exit 1 + fi + host="$goos/$goarch" + all=$(echo "$host $PLATFORMS" | tr ' ' '\n' | grep . | sort -u | tr '\n' ' ') + echo "host=$host" >> "$GITHUB_OUTPUT" + echo "all=${all% }" >> "$GITHUB_OUTPUT" + # Relative to workspace, to avoid Windows paths in bash steps + echo "dist=.newt-dist" >> "$GITHUB_OUTPUT" + + - name: Download newt + if: inputs.artifact != '' + uses: actions/download-artifact@v8 + with: + name: ${{ inputs.artifact }} + path: ${{ steps.platform.outputs.dist }} + - name: Get newt master commit + if: inputs.artifact == '' id: newt shell: bash run: | @@ -37,15 +94,18 @@ runs: fi echo "newt master is at $sha" echo "sha=$sha" >> "$GITHUB_OUTPUT" + echo "platforms=$(echo ${{ steps.platform.outputs.all }} | tr '/ ' '_-')" >> "$GITHUB_OUTPUT" - name: Restore newt from cache + if: inputs.artifact == '' id: cache uses: actions/cache/restore@v6 with: - path: ${{ github.workspace }}/.newt-bin - key: newt-${{ runner.os }}-${{ runner.arch }}-${{ steps.newt.outputs.sha }} + path: ${{ steps.platform.outputs.dist }} + key: newt-${{ runner.os }}-${{ steps.newt.outputs.sha }}-${{ steps.newt.outputs.platforms }} - name: Report newt cache status + if: inputs.artifact == '' shell: bash env: CACHE_HIT: ${{ steps.cache.outputs.cache-hit }} @@ -58,35 +118,63 @@ runs: fi - name: Set up Go - if: steps.cache.outputs.cache-hit != 'true' + if: inputs.artifact == '' && steps.cache.outputs.cache-hit != 'true' uses: actions/setup-go@v7 with: go-version: 'stable' cache: false - name: Build newt - if: steps.cache.outputs.cache-hit != 'true' + if: inputs.artifact == '' && steps.cache.outputs.cache-hit != 'true' shell: bash env: - GOBIN: ${{ github.workspace }}/.newt-bin + CGO_ENABLED: 0 + GOPATH: ${{ runner.temp }}/newt-gopath + NEWT_SHA: ${{ steps.newt.outputs.sha }} + PLATFORMS: ${{ steps.platform.outputs.all }} + DIST: ${{ steps.platform.outputs.dist }} run: | go version - go install mynewt.apache.org/newt/newt@${{ steps.newt.outputs.sha }} + for platform in $PLATFORMS; do + goos=${platform%/*} + goarch=${platform#*/} + echo "Building newt for $platform" + GOOS=$goos GOARCH=$goarch \ + go install "mynewt.apache.org/newt/newt@$NEWT_SHA" + # Cross compiled binaries are installed to GOOS_GOARCH subdirectory + src="$GOPATH/bin/${goos}_${goarch}" + [ -d "$src" ] || src="$GOPATH/bin" + mkdir -p "$DIST/${goos}_${goarch}" + cp "$src"/newt* "$DIST/${goos}_${goarch}/" + done + ls -lR "$DIST" # Only master saves cache, so that it is shared with all pull # requests instead of being duplicated in each pull request scope - name: Save newt to cache if: >- - steps.cache.outputs.cache-hit != 'true' && + inputs.artifact == '' && steps.cache.outputs.cache-hit != 'true' && github.ref == 'refs/heads/master' && github.event_name != 'pull_request' uses: actions/cache/save@v6 with: - path: ${{ github.workspace }}/.newt-bin + path: ${{ steps.platform.outputs.dist }} key: ${{ steps.cache.outputs.cache-primary-key }} - name: Add newt to PATH shell: bash + env: + HOST: ${{ steps.platform.outputs.host }} + DIST: ${{ steps.platform.outputs.dist }} run: | - echo "${{ github.workspace }}/.newt-bin" >> "$GITHUB_PATH" - "${{ github.workspace }}/.newt-bin/newt" version + src="$DIST/$(echo "$HOST" | tr / _)" + if ! ls "$src"/newt* > /dev/null 2>&1; then + echo "::error::newt for $HOST not found" + exit 1 + fi + mkdir -p .newt-bin + cp "$src"/newt* .newt-bin/ + # Artifacts don't preserve file permissions + chmod +x .newt-bin/newt* + echo "$GITHUB_WORKSPACE/.newt-bin" >> "$GITHUB_PATH" + .newt-bin/newt version diff --git a/.github/actions/newt-project-restore/action.yml b/.github/actions/newt-project-restore/action.yml new file mode 100644 index 000000000..80db00ce7 --- /dev/null +++ b/.github/actions/newt-project-restore/action.yml @@ -0,0 +1,65 @@ +# +# 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. +# + +name: Restore newt project +description: > + Restore newt and newt project prepared by prepare job of the same + workflow run, so that external repositories are downloaded only once + per run. Project contains only .git directories of repositories, + working trees are checked out after restore. Project file is replaced + with one provided by job. + +inputs: + project: + description: Project file to use (relative to repository root) + required: false + default: .github/project.yml + path: + description: Directory to restore project to + required: false + default: build + +runs: + using: composite + steps: + - name: Download project + uses: actions/download-artifact@v8 + with: + name: newt-project + path: ${{ runner.temp }}/newt-project + + - name: Extract project + shell: bash + run: | + mkdir -p "${{ inputs.path }}" + zstd -d -c "$RUNNER_TEMP/newt-project/newt-project.tar.zst" | tar -x -C "${{ inputs.path }}" + rm -rf "$RUNNER_TEMP/newt-project" + mv "${{ inputs.path }}/.newt-bin" "$GITHUB_WORKSPACE/.newt-bin" + echo "$GITHUB_WORKSPACE/.newt-bin" >> "$GITHUB_PATH" + bash "$GITHUB_WORKSPACE/.github/scripts/checkout_repos.sh" "${{ inputs.path }}" + + # Repositories were set up by prepare job for tested commit, so + # only project file needs to be updated. Project file may limit + # repositories used by newt (e.g. for unit tests). + - name: Set up project file + shell: bash + run: | + cp -f "${{ inputs.project }}" "${{ inputs.path }}/project.yml" + cd "${{ inputs.path }}" + newt info diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..894a9b849 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,359 @@ +# +# 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. +# + +name: Build + +on: + push: + branches: + - master + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + # Builds newt once per run for all platforms used by jobs of this + # workflow, other jobs take newt from artifact uploaded by this job. + newt: + name: Build newt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - name: Build newt + id: newt + uses: ./.github/actions/newt-install + with: + platforms: windows/amd64 darwin/arm64 + - name: Upload newt + uses: actions/upload-artifact@v7 + with: + name: newt + path: ${{ steps.newt.outputs.dist }} + include-hidden-files: true + if-no-files-found: error + retention-days: 1 + + # Downloads external repositories once per run, all Linux jobs use + # project prepared by this job. + prepare: + name: Prepare project + needs: newt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - name: Install newt + uses: ./.github/actions/newt-install + with: + artifact: newt + - name: Set up project + uses: ./.github/actions/newt-project + with: + save-cache: true + # Only .git directories of repositories are packed, working trees + # are checked out by jobs restoring project + - name: Pack project + shell: bash + run: | + cp -r .newt-bin build/.newt-bin + cd build + { + find . -mindepth 1 -maxdepth 1 ! -name repos + find repos -mindepth 1 -maxdepth 1 -name '.*' + find repos -mindepth 2 -maxdepth 2 -name .git + } | tar -cf - -T - | zstd -T0 -3 -o ../newt-project.tar.zst + ls -lh ../newt-project.tar.zst + - name: Upload project + uses: actions/upload-artifact@v7 + with: + name: newt-project + path: newt-project.tar.zst + compression-level: 0 + retention-days: 1 + + apps: + name: Build all apps + needs: prepare + strategy: + fail-fast: false + matrix: + shard: [0, 1] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: carlosperate/[email protected] + with: + release: '15.2.Rel1' + - name: Install Dependencies + run: | + sudo apt-get update + sudo apt-get install -y gcc-multilib ccache + - name: Restore project + uses: ./.github/actions/newt-project-restore + - name: Remove project targets + shell: bash + run: rm -rf build/targets + - name: Restore ccache + uses: ./.github/actions/ccache-restore + with: + key: apps-${{ matrix.shard }} + - name: Build applications + shell: bash + env: + SHARD_INDEX: ${{ matrix.shard }} + SHARD_TOTAL: 2 + run: | + cd build + bash ../.github/test_build_apps.sh + - name: Save ccache + if: always() + uses: ./.github/actions/ccache-save + with: + key: apps-${{ matrix.shard }} + + targets: + name: Build all test targets + needs: prepare + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: carlosperate/[email protected] + with: + release: '15.2.Rel1' + - name: Install Dependencies + run: | + sudo apt-get update + sudo apt-get install -y gcc-multilib ccache + - name: Restore project + uses: ./.github/actions/newt-project-restore + - name: Remove project targets + shell: bash + run: rm -rf build/targets + - name: Restore ccache + uses: ./.github/actions/ccache-restore + with: + key: targets + - name: Build targets + shell: bash + run: | + cp -r .github/targets build/targets + cd build + ls targets | xargs -n1 sh -c 'echo "Testing $0"; newt build -q $0' + rm -rf targets + - name: Build Linux-only targets + shell: bash + run: | + 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 + - name: Save ccache + if: always() + uses: ./.github/actions/ccache-save + with: + key: targets + + targets-other-os: + name: Build all test targets + needs: newt + strategy: + fail-fast: false + matrix: + os: [windows-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v7 + - uses: carlosperate/[email protected] + with: + release: '15.2.Rel1' + - name: Install newt + uses: ./.github/actions/newt-install + with: + artifact: newt + - name: Set up project + uses: ./.github/actions/newt-project + - name: Remove project targets + shell: bash + run: rm -rf build/targets + - name: Build targets + shell: bash + run: | + cp -r .github/targets build/targets + cd build + ls targets | xargs -n1 sh -c 'echo "Testing $0"; newt build -q $0' + rm -rf targets + + gcc-target: + name: Build GCC test target + needs: prepare + strategy: + fail-fast: false + # Limit number of parallel jobs, ASF policy limits job concurrency + # level per workflow + max-parallel: 4 + matrix: + gcc: ['15.2.Rel1', '14.2.Rel1', '13.2.Rel1', '12.2.Rel1', '11.3.Rel1', '10.3-2021.10', '9-2020-q2', '8-2019-q3'] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: carlosperate/[email protected] + with: + release: ${{ matrix.gcc }} + - name: Restore project + uses: ./.github/actions/newt-project-restore + - name: Restore ccache + uses: ./.github/actions/ccache-restore + with: + key: gcc-target-${{ matrix.gcc }} + - name: Build test target + shell: bash + run: | + cd build + newt target create cc_test + newt target set cc_test bsp="@apache-mynewt-core/hw/bsp/nordic_pca10056" + newt target set cc_test app="@apache-mynewt-nimble/apps/btshell" + cp -f ../.github/test_build_apps_syscfg.yml targets/cc_test/syscfg.yml + newt build cc_test + - name: Save ccache + if: always() + uses: ./.github/actions/ccache-save + with: + key: gcc-target-${{ matrix.gcc }} + + unit-tests: + name: Run unit tests + needs: prepare + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - name: Install Dependencies + run: | + sudo apt-get update + sudo apt-get install -y gcc-multilib ccache + # Unit tests project limits repositories to those which tests + # should be run for + - name: Restore project + uses: ./.github/actions/newt-project-restore + with: + project: .github/project_newt_test_all.yml + - name: Restore ccache + uses: ./.github/actions/ccache-restore + with: + key: unit-tests + - name: Switch to main mcuboot + # This is temporary until next mcuboot release is available + shell: bash + run: | + cd build/repos/mcuboot + git fetch --depth=1 origin main + git checkout --detach FETCH_HEAD + - name: newt test all + run: | + cd build + newt test all + - name: Save ccache + if: always() + uses: ./.github/actions/ccache-save + with: + key: unit-tests + + ports: + name: Build ports + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: carlosperate/[email protected] + with: + release: '15.2.Rel1' + - name: Install Dependencies + shell: bash + run: | + sudo apt-get update + sudo apt-get install -y make ccache gcc-multilib g++-multilib kconfig-frontends libmbedtls-dev cmake build-essential + - name: Cache 32-bit Mbed TLS 3.6 + id: cache-mbedtls + uses: actions/cache@v6 + with: + path: ${{ github.workspace }}/mbedtls_install + key: ${{ runner.os }}-mbedtls-3.6.5 + - name: Compile Mbed TLS 3.6 (On Cache Miss) + if: steps.cache-mbedtls.outputs.cache-hit != 'true' + run: | + git clone --depth 1 --branch mbedtls-3.6.5 --recursive https://github.com/Mbed-TLS/mbedtls.git + cd mbedtls + cmake -B build \ + -DCMAKE_C_FLAGS="-m32" \ + -DCMAKE_SHARED_LINKER_FLAGS="-m32" \ + -DCMAKE_EXE_LINKER_FLAGS="-m32" \ + -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/mbedtls_install \ + -DUSE_SHARED_MBEDTLS_LIBRARY=On \ + -DENABLE_TESTING=Off + cmake --build build --target install + - name: Export Mbed TLS Environment Paths + run: | + echo "CPATH=${{ github.workspace }}/mbedtls_install/include" >> $GITHUB_ENV + echo "LIBRARY_PATH=${{ github.workspace }}/mbedtls_install/lib" >> $GITHUB_ENV + echo "LD_LIBRARY_PATH=${{ github.workspace }}/mbedtls_install/lib" >> $GITHUB_ENV + echo "MBEDTLS_DIR=${{ github.workspace }}/mbedtls_install" >> $GITHUB_ENV + - name: Restore ccache + uses: ./.github/actions/ccache-restore + with: + key: ports + - name: Build example ports + shell: bash + run: | + make -C porting/examples/dummy/ clean all + make -C porting/examples/linux/ clean all + make -C porting/examples/linux_blemesh/ clean all + make -C porting/examples/linux_blemesh_shell/ clean all + make -C porting/npl/linux/test/ clean all test + - name: Build RIOT port + shell: bash + if: success() || failure() + continue-on-error: true + run: | + git clone --depth=1 https://github.com/RIOT-OS/RIOT + rm RIOT/pkg/nimble/patches/ -rf + sed -i 's|PKG_URL.*|PKG_URL = '$(pwd)'|' RIOT/pkg/nimble/Makefile + sed -i 's|PKG_VERSION.*|PKG_VERSION = '${{ github.sha }}'|' RIOT/pkg/nimble/Makefile + make -C RIOT/examples/networking/ble/nimble/nimble_gatt + - name: Build Nuttx port + shell: bash + if: success() || failure() + continue-on-error: true + run: | + mkdir nuttx-build + git clone --depth=1 https://github.com/apache/nuttx.git nuttx-build/nuttx + git clone --depth=1 https://github.com/apache/nuttx-apps nuttx-build/apps + ./nuttx-build/nuttx/tools/configure.sh -l nrf52840-dk:sdc_nimble + kconfig-tweak --file nuttx-build/nuttx/.config --set-str NIMBLE_REF ${{ github.sha }} + kconfig-tweak --file nuttx-build/nuttx/.config --enable NIMBLE_PORTING_EXAMPLE + echo '#include "../../../../mynewt-nimble/porting/examples/nuttx/include/syscfg/syscfg.h"'\ + >> nuttx-build/apps/wireless/bluetooth/nimble/include/syscfg/syscfg.h + make -C nuttx-build/nuttx olddefconfig + make -C nuttx-build/nuttx + - name: Save ccache + if: always() + uses: ./.github/actions/ccache-save + with: + key: ports diff --git a/.github/workflows/build_all_apps.yml b/.github/workflows/build_all_apps.yml deleted file mode 100644 index 8dbc306e8..000000000 --- a/.github/workflows/build_all_apps.yml +++ /dev/null @@ -1,69 +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. -# - -name: Apps - -on: - push: - branches: - - master - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -jobs: - targets: - name: Build all apps - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v7 - - uses: carlosperate/[email protected] - with: - release: '15.2.Rel1' - - name: Install Dependencies - shell: bash - run: | - sudo apt-get update - sudo apt-get install -y gcc-multilib ccache - - name: Install newt - uses: ./.github/actions/newt-install - - name: Set up project - uses: ./.github/actions/newt-project - with: - save-cache: true - - name: Remove project targets - shell: bash - run: rm -rf build/targets - - name: Restore ccache - uses: ./.github/actions/ccache-restore - with: - key: apps - - name: Build applications - shell: bash - run: | - cd build - bash ../.github/test_build_apps.sh - cd .. - - name: Save ccache - if: always() - uses: ./.github/actions/ccache-save - with: - key: apps diff --git a/.github/workflows/build_cc_target.yml b/.github/workflows/build_cc_target.yml deleted file mode 100644 index e4d30c465..000000000 --- a/.github/workflows/build_cc_target.yml +++ /dev/null @@ -1,66 +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. -# - -name: GCC target - -on: - push: - branches: - - master - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -jobs: - targets: - name: Build GCC test target - strategy: - fail-fast: false - matrix: - gcc: ['15.2.Rel1', '14.2.Rel1', '13.2.Rel1', '12.2.Rel1', '11.3.Rel1', '10.3-2021.10', '9-2020-q2', '8-2019-q3'] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v7 - - uses: carlosperate/[email protected] - with: - release: ${{ matrix.gcc }} - - name: Install newt - uses: ./.github/actions/newt-install - - name: Set up project - uses: ./.github/actions/newt-project - - name: Restore ccache - uses: ./.github/actions/ccache-restore - with: - key: gcc-target-${{ matrix.gcc }} - - name: Build test target - shell: bash - run: | - cd build - newt target create cc_test - newt target set cc_test bsp="@apache-mynewt-core/hw/bsp/nordic_pca10056" - newt target set cc_test app="@apache-mynewt-nimble/apps/btshell" - cp -f ../.github/test_build_apps_syscfg.yml targets/cc_test/syscfg.yml - newt build cc_test - - name: Save ccache - if: always() - uses: ./.github/actions/ccache-save - with: - key: gcc-target-${{ matrix.gcc }} diff --git a/.github/workflows/build_ports.yml b/.github/workflows/build_ports.yml deleted file mode 100644 index f8b48d4b1..000000000 --- a/.github/workflows/build_ports.yml +++ /dev/null @@ -1,112 +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. -# - -name: Ports - -on: - push: - branches: - - master - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -jobs: - ports: - name: Build ports - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v7 - - uses: carlosperate/[email protected] - with: - release: '15.2.Rel1' - - name: Install Dependencies - shell: bash - run: | - sudo apt-get update - sudo apt-get install -y make ccache gcc-multilib g++-multilib kconfig-frontends libmbedtls-dev cmake build-essential - - name: Cache 32-bit Mbed TLS 3.6 - id: cache-mbedtls - uses: actions/cache@v6 - with: - path: ${{ github.workspace }}/mbedtls_install - key: ${{ runner.os }}-mbedtls-3.6.5 - - name: Compile Mbed TLS 3.6 (On Cache Miss) - if: steps.cache-mbedtls.outputs.cache-hit != 'true' - run: | - git clone --depth 1 --branch mbedtls-3.6.5 --recursive https://github.com/Mbed-TLS/mbedtls.git - cd mbedtls - cmake -B build \ - -DCMAKE_C_FLAGS="-m32" \ - -DCMAKE_SHARED_LINKER_FLAGS="-m32" \ - -DCMAKE_EXE_LINKER_FLAGS="-m32" \ - -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/mbedtls_install \ - -DUSE_SHARED_MBEDTLS_LIBRARY=On \ - -DENABLE_TESTING=Off - cmake --build build --target install - - name: Export Mbed TLS Environment Paths - run: | - echo "CPATH=${{ github.workspace }}/mbedtls_install/include" >> $GITHUB_ENV - echo "LIBRARY_PATH=${{ github.workspace }}/mbedtls_install/lib" >> $GITHUB_ENV - echo "LD_LIBRARY_PATH=${{ github.workspace }}/mbedtls_install/lib" >> $GITHUB_ENV - echo "MBEDTLS_DIR=${{ github.workspace }}/mbedtls_install" >> $GITHUB_ENV - - name: Restore ccache - uses: ./.github/actions/ccache-restore - with: - key: ports - - name: Build example ports - shell: bash - run: | - make -C porting/examples/dummy/ clean all - make -C porting/examples/linux/ clean all - make -C porting/examples/linux_blemesh/ clean all - make -C porting/examples/linux_blemesh_shell/ clean all - make -C porting/npl/linux/test/ clean all test - - name: Build RIOT port - shell: bash - if: success() || failure() - continue-on-error: true - run: | - git clone --depth=1 https://github.com/RIOT-OS/RIOT - rm RIOT/pkg/nimble/patches/ -rf - sed -i 's|PKG_URL.*|PKG_URL = '$(pwd)'|' RIOT/pkg/nimble/Makefile - sed -i 's|PKG_VERSION.*|PKG_VERSION = '${{ github.sha }}'|' RIOT/pkg/nimble/Makefile - make -C RIOT/examples/networking/ble/nimble/nimble_gatt - - name: Build Nuttx port - shell: bash - if: success() || failure() - continue-on-error: true - run: | - mkdir nuttx-build - git clone --depth=1 https://github.com/apache/nuttx.git nuttx-build/nuttx - git clone --depth=1 https://github.com/apache/nuttx-apps nuttx-build/apps - ./nuttx-build/nuttx/tools/configure.sh -l nrf52840-dk:sdc_nimble - kconfig-tweak --file nuttx-build/nuttx/.config --set-str NIMBLE_REF ${{ github.sha }} - kconfig-tweak --file nuttx-build/nuttx/.config --enable NIMBLE_PORTING_EXAMPLE - echo '#include "../../../../mynewt-nimble/porting/examples/nuttx/include/syscfg/syscfg.h"'\ - >> nuttx-build/apps/wireless/bluetooth/nimble/include/syscfg/syscfg.h - make -C nuttx-build/nuttx olddefconfig - make -C nuttx-build/nuttx - - name: Save ccache - if: always() - uses: ./.github/actions/ccache-save - with: - key: ports diff --git a/.github/workflows/build_targets.yml b/.github/workflows/build_targets.yml deleted file mode 100644 index c9a808587..000000000 --- a/.github/workflows/build_targets.yml +++ /dev/null @@ -1,83 +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. -# - -name: Targets - -on: - push: - branches: - - master - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -jobs: - targets: - name: Build all test targets - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest, macos-latest] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v7 - - uses: carlosperate/[email protected] - with: - release: '15.2.Rel1' - - name: Install Dependencies - shell: bash - if: matrix.os == 'ubuntu-latest' - run: | - sudo apt-get update - sudo apt-get install -y gcc-multilib ccache - - name: Install newt - uses: ./.github/actions/newt-install - - name: Set up project - uses: ./.github/actions/newt-project - - name: Remove project targets - shell: bash - run: rm -rf build/targets - - name: Restore ccache - uses: ./.github/actions/ccache-restore - with: - key: targets - - name: Build targets - shell: bash - run: | - 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 - shell: bash - if: matrix.os == 'ubuntu-latest' - run: | - 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 .. - - name: Save ccache - if: always() - uses: ./.github/actions/ccache-save - with: - key: targets diff --git a/.github/workflows/newt_test_all.yml b/.github/workflows/newt_test_all.yml deleted file mode 100644 index 959918e79..000000000 --- a/.github/workflows/newt_test_all.yml +++ /dev/null @@ -1,69 +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. -# - -name: Unit tests - -on: - push: - branches: - - master - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: true - -jobs: - newt_test: - name: Run newt test all - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v7 - - name: Install Dependencies - shell: bash - run: | - sudo apt-get update - sudo apt-get install -y gcc-multilib ccache - - name: Install newt - uses: ./.github/actions/newt-install - - name: Set up project - uses: ./.github/actions/newt-project - with: - project: .github/project_newt_test_all.yml - - name: Restore ccache - uses: ./.github/actions/ccache-restore - with: - key: unit-tests - - name: Switch to main mcuboot - # This is temporary until next mcuboot release is available - shell: bash - run: | - cd build/repos/mcuboot - git fetch --depth=1 origin main - git checkout --detach FETCH_HEAD - - name: newt test all - shell: bash - run: | - cd build - newt test all - - name: Save ccache - if: always() - uses: ./.github/actions/ccache-save - with: - key: unit-tests diff --git a/README.md b/README.md index b98513a23..fc3ebbd6c 100644 --- a/README.md +++ b/README.md @@ -25,24 +25,8 @@ ## Overview -<a href="https://github.com/apache/mynewt-nimble/actions/workflows/build_targets.yml"> - <img src="https://github.com/apache/mynewt-nimble/actions/workflows/build_targets.yml/badge.svg"> -<a/> - -<a href="https://github.com/apache/mynewt-nimble/actions/workflows/build_cc_target.yml"> - <img src="https://github.com/apache/mynewt-nimble/actions/workflows/build_cc_target.yml/badge.svg"> -<a/> - -<a href="https://github.com/apache/mynewt-nimble/actions/workflows/build_ports.yml"> - <img src="https://github.com/apache/mynewt-nimble/actions/workflows/build_ports.yml/badge.svg"> -<a/> - -<a href="https://github.com/apache/mynewt-nimble/actions/workflows/newt_test_all.yml"> - <img src="https://github.com/apache/mynewt-nimble/actions/workflows/newt_test_all.yml/badge.svg"> -<a/> - -<a href="https://github.com/apache/mynewt-nimble/actions/workflows/build_all_apps.yml"> - <img src="https://github.com/apache/mynewt-nimble/actions/workflows/build_all_apps.yml/badge.svg"> +<a href="https://github.com/apache/mynewt-nimble/actions/workflows/build.yml"> + <img src="https://github.com/apache/mynewt-nimble/actions/workflows/build.yml/badge.svg"> <a/> <p>
