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-core.git
The following commit(s) were added to refs/heads/master by this push:
new 32c1a4db9 ci: Build GCC test target with all releases in single job
32c1a4db9 is described below
commit 32c1a4db93489b52ec11729576fdc6531a5e7c1b
Author: Szymon Janc <[email protected]>
AuthorDate: Tue Oct 20 23:17:24 2026 +0200
ci: Build GCC test target with all releases in single job
GCC test target was built in matrix job, one job per toolchain release.
Each of those 8 jobs restored project artifact (1.26 GB, 30-170 s) and
own ccache for building two targets (30-95 s). With max-parallel 2 the
matrix took about 23 runner minutes and about 40 minutes of wall time.
Build all releases in single job instead. Project and ccache are
restored once and new gcc-target-build composite action installs each
release, builds targets with it and removes it afterwards. Builds for
remaining releases run even if one fails, so job reports all failing
releases. All releases share single ccache with bigger size limit,
entries are separated by CCACHE_COMPILERCHECK=content.
This also lowers number of concurrent jobs in workflow, which is
limited by ASF policy.
Assisted-by: Claude:claude-opus-5-5
---
.github/actions/ccache-restore/action.yml | 3 +-
.github/actions/gcc-target-build/action.yml | 66 +++++++++++++++++++++++++++++
.github/workflows/build.yml | 63 +++++++++++++++++++--------
3 files changed, 113 insertions(+), 19 deletions(-)
diff --git a/.github/actions/ccache-restore/action.yml
b/.github/actions/ccache-restore/action.yml
index 13ae7ab5c..e754643ca 100644
--- a/.github/actions/ccache-restore/action.yml
+++ b/.github/actions/ccache-restore/action.yml
@@ -21,7 +21,8 @@ name: Restore ccache
description: >
Install ccache, put it in front of compilers used by newt and restore
ccache directory from cache. Must be used after toolchain is installed
- so that ccache wrappers are found in PATH before real compilers.
+ so that ccache wrappers are found in PATH before real compilers (unless
+ job sets PATH itself, see gcc-target-build).
Supported only on Linux, does nothing on other systems.
inputs:
diff --git a/.github/actions/gcc-target-build/action.yml
b/.github/actions/gcc-target-build/action.yml
new file mode 100644
index 000000000..f1527eb6c
--- /dev/null
+++ b/.github/actions/gcc-target-build/action.yml
@@ -0,0 +1,66 @@
+#
+# 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 GCC test target
+description: >
+ Install given release of GNU Arm Embedded Toolchain, build test targets
+ with it and remove it afterwards. Used to build test targets with many
+ toolchain releases in single job. Expects project restored in build
+ directory and ccache restored.
+
+inputs:
+ release:
+ description: GNU Arm Embedded Toolchain release name
+ required: true
+
+runs:
+ using: composite
+ steps:
+ - name: Install toolchain
+ id: gcc
+ uses: carlosperate/[email protected]
+ with:
+ release: ${{ inputs.release }}
+
+ - name: Build targets
+ shell: bash
+ env:
+ GCC_PATH: ${{ steps.gcc.outputs.path }}
+ run: |
+ # Toolchain action only prepends to PATH so it also contains
+ # previously installed releases. Set PATH explicitly, ccache
+ # wrappers first so that they find this toolchain as next one.
+ export PATH="$RUNNER_TEMP/ccache-bin:$GCC_PATH:$PATH"
+ arm-none-eabi-gcc --version | head -1
+ cd build
+ # Command lines are same for all releases, so newt would not
+ # rebuild objects built with previous toolchain release.
+ rm -rf bin
+ newt build
@apache-mynewt-core/targets/coverity/btshell_nrf52840_coverity
+ newt build
@apache-mynewt-core/targets/coverity/btshell_nrf52840_coverity2
+
+ - name: Remove toolchain
+ if: always() && steps.gcc.outputs.path != ''
+ shell: bash
+ env:
+ GCC_PATH: ${{ steps.gcc.outputs.path }}
+ run: |
+ # Toolchain is installed in directory in home directory
+ dir="${GCC_PATH#"$HOME"/}"
+ rm -rf "$HOME/${dir%%/*}"
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index f19d36671..e71bf56de 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -345,36 +345,63 @@ jobs:
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: 2
- 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
+ id: project
uses: ./.github/actions/newt-project-restore
- name: Restore ccache
uses: ./.github/actions/ccache-restore
with:
- key: gcc-target-${{ matrix.gcc }}
- - name: Build targets
- shell: bash
- run: |
- cd build
- newt build
@apache-mynewt-core/targets/coverity/btshell_nrf52840_coverity
- newt build
@apache-mynewt-core/targets/coverity/btshell_nrf52840_coverity2
+ key: gcc-target
+ max-size: 1G
+ # Build with remaining releases even if build with one fails
+ - name: Build with GCC 15.2.Rel1
+ if: ${{ !cancelled() && steps.project.outcome == 'success' }}
+ uses: ./.github/actions/gcc-target-build
+ with:
+ release: 15.2.Rel1
+ - name: Build with GCC 14.2.Rel1
+ if: ${{ !cancelled() && steps.project.outcome == 'success' }}
+ uses: ./.github/actions/gcc-target-build
+ with:
+ release: 14.2.Rel1
+ - name: Build with GCC 13.2.Rel1
+ if: ${{ !cancelled() && steps.project.outcome == 'success' }}
+ uses: ./.github/actions/gcc-target-build
+ with:
+ release: 13.2.Rel1
+ - name: Build with GCC 12.2.Rel1
+ if: ${{ !cancelled() && steps.project.outcome == 'success' }}
+ uses: ./.github/actions/gcc-target-build
+ with:
+ release: 12.2.Rel1
+ - name: Build with GCC 11.3.Rel1
+ if: ${{ !cancelled() && steps.project.outcome == 'success' }}
+ uses: ./.github/actions/gcc-target-build
+ with:
+ release: 11.3.Rel1
+ - name: Build with GCC 10.3-2021.10
+ if: ${{ !cancelled() && steps.project.outcome == 'success' }}
+ uses: ./.github/actions/gcc-target-build
+ with:
+ release: 10.3-2021.10
+ - name: Build with GCC 9-2020-q2
+ if: ${{ !cancelled() && steps.project.outcome == 'success' }}
+ uses: ./.github/actions/gcc-target-build
+ with:
+ release: 9-2020-q2
+ - name: Build with GCC 8-2019-q3
+ if: ${{ !cancelled() && steps.project.outcome == 'success' }}
+ uses: ./.github/actions/gcc-target-build
+ with:
+ release: 8-2019-q3
- name: Save ccache
if: always()
uses: ./.github/actions/ccache-save
with:
- key: gcc-target-${{ matrix.gcc }}
+ key: gcc-target
unit-tests:
name: Run unit tests