2020-03-05 14:00:35 +08:00
|
|
|
# Licensed 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.
|
|
|
|
#
|
2020-04-15 13:15:04 +08:00
|
|
|
name: Build
|
2020-03-05 14:00:35 +08:00
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
2020-07-21 06:18:26 +08:00
|
|
|
paths-ignore:
|
2020-08-15 04:01:22 +08:00
|
|
|
- 'Documentation/**'
|
2023-08-22 21:14:59 +08:00
|
|
|
- 'tools/ci/docker/linux/**'
|
2020-04-23 15:40:21 +08:00
|
|
|
push:
|
2020-07-21 06:18:26 +08:00
|
|
|
paths-ignore:
|
2020-08-15 04:01:22 +08:00
|
|
|
- 'Documentation/**'
|
2020-04-23 15:40:21 +08:00
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- 'releases/*'
|
|
|
|
tags:
|
2020-03-05 14:00:35 +08:00
|
|
|
|
2022-08-29 18:01:51 +08:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2021-12-17 21:48:15 +08:00
|
|
|
concurrency:
|
|
|
|
group: build-${{ github.event.pull_request.number || github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2020-03-05 14:00:35 +08:00
|
|
|
jobs:
|
CI: Apply the Refactored Build Rules based on Arch Labels
This PR continues to enhance the CI Workflow, to skip the unnecessary NuttX Builds. The PR will update the CI Build Workflow `build.yml`, to call the Refactored Build Rules in `arch.yml` (which is a Reusable Workflow).
The original rules were migrated from `build.yml` to `arch.yml`:
- We target only the Simple PRs: One Arch Label + One Size Label (e.g. "Arch: risc-v, Size: XS")
- For "Arch: risc-v": Build `risc-v-01`, `risc-v-02`
- For "Arch: xtensa": Build `xtensa-01`, `xtensa-02`
- The above rules apply when the PR is Created or Modified
- When the PR is Merged: All targets shall be built
This PR applies the New and Updated Rules defined in `arch.yml`:
- For "Arch: arm": Build `arm-01`, `arm-02`, ...
- For "Arch: arm64": Build `other`
- For "Arch: simulator": Build `sim-01`, `sim-02`
- For "Arch: x86_64": Build `other`
- For Simple PRs (One Arch Label + One Size Label): Skip the macOS and Windows builds (`macos`, `macos/sim-*`, `msys2`) since these builds are costly and slow
- Except for "Arch: Simulator", which will enable the macOS Builds for `sim-01` and `sim-02`
- If GitHub CLI Fails: Build all targets
The code is explained here: https://github.com/apache/nuttx/issues/13775
2024-10-07 15:20:40 +08:00
|
|
|
|
|
|
|
# Fetch the source from nuttx and nuttx-apps repos
|
2020-04-23 15:40:21 +08:00
|
|
|
Fetch-Source:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Determine Target Branches
|
|
|
|
id: gittargets
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
OS_REF=""
|
|
|
|
APPS_REF=""
|
2020-05-02 11:59:52 +08:00
|
|
|
|
2020-04-23 15:40:21 +08:00
|
|
|
REF=$GITHUB_REF
|
2020-05-02 11:59:52 +08:00
|
|
|
|
2020-04-23 15:40:21 +08:00
|
|
|
# If a base ref is set this is a PR and we will want to use
|
|
|
|
# the base ref instead of the ref that triggered the event
|
|
|
|
if [ ${GITHUB_BASE_REF} ]; then
|
|
|
|
REF=refs/heads/$GITHUB_BASE_REF
|
|
|
|
fi
|
2020-05-02 11:59:52 +08:00
|
|
|
|
2020-04-23 15:40:21 +08:00
|
|
|
echo "Working with ref: $REF"
|
2020-05-02 11:59:52 +08:00
|
|
|
|
2020-04-23 15:40:21 +08:00
|
|
|
# We modify for all tags and release branches
|
|
|
|
if [[ $REF =~ refs/heads/releases/*|refs/tags/* ]]; then
|
|
|
|
if [[ $REF =~ refs/heads/* ]]
|
|
|
|
then
|
|
|
|
REF_NAME=${REF##refs/heads/}
|
|
|
|
echo "Working with a branch: $REF_NAME"
|
|
|
|
else
|
|
|
|
REF_NAME=${REF##refs/tags/}
|
|
|
|
echo "Working with a tag: $REF_NAME"
|
|
|
|
fi
|
2020-05-02 11:59:52 +08:00
|
|
|
|
2020-04-23 15:40:21 +08:00
|
|
|
# Determine the repo and leave that unset to use the normal checkout behavior
|
|
|
|
# of using the merge commit instead of HEAD
|
|
|
|
case $GITHUB_REPOSITORY in
|
2022-11-23 02:59:48 +08:00
|
|
|
"apache/nuttx")
|
2020-04-23 15:40:21 +08:00
|
|
|
# OS
|
|
|
|
echo "Triggered by change in OS"
|
|
|
|
APPS_REF=$REF_NAME
|
|
|
|
;;
|
2020-05-02 11:59:52 +08:00
|
|
|
|
2022-11-23 02:59:48 +08:00
|
|
|
"apache/nuttx-apps" )
|
2020-04-23 15:40:21 +08:00
|
|
|
# APPS
|
|
|
|
OS_REF=$REF_NAME
|
|
|
|
echo "Triggered by change in APPS"
|
|
|
|
;;
|
2020-05-02 11:59:52 +08:00
|
|
|
|
2020-04-23 15:40:21 +08:00
|
|
|
*)
|
|
|
|
echo "Trigger by change on $GITHUB_REPOSITORY. This is unexpected."
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
2020-05-02 11:59:52 +08:00
|
|
|
|
2023-05-16 13:17:26 +08:00
|
|
|
echo "name=$OS_REF" >> $GITHUB_OUTPUT
|
2024-10-03 11:20:30 +08:00
|
|
|
echo "apps_ref=$APPS_REF" >> $GITHUB_OUTPUT
|
2020-05-02 11:59:52 +08:00
|
|
|
|
2020-04-23 15:40:21 +08:00
|
|
|
- name: Checkout nuttx repo
|
2023-09-11 10:40:23 +08:00
|
|
|
uses: actions/checkout@v4
|
2020-04-23 15:40:21 +08:00
|
|
|
with:
|
2022-11-23 02:59:48 +08:00
|
|
|
repository: apache/nuttx
|
2020-04-23 15:40:21 +08:00
|
|
|
ref: ${{ steps.gittargets.outputs.os_ref }}
|
|
|
|
path: sources/nuttx
|
|
|
|
fetch-depth: 1
|
2020-09-03 04:11:56 +08:00
|
|
|
- name: Checkout nuttx repo tags
|
|
|
|
run: git -C sources/nuttx fetch --tags
|
2020-05-02 11:59:52 +08:00
|
|
|
|
2020-04-23 15:40:21 +08:00
|
|
|
- name: Checkout apps repo
|
2023-09-11 10:40:23 +08:00
|
|
|
uses: actions/checkout@v4
|
2020-04-23 15:40:21 +08:00
|
|
|
with:
|
2022-11-23 02:59:48 +08:00
|
|
|
repository: apache/nuttx-apps
|
2020-04-23 15:40:21 +08:00
|
|
|
ref: ${{ steps.gittargets.outputs.apps_ref }}
|
|
|
|
path: sources/apps
|
|
|
|
fetch-depth: 1
|
2020-05-02 11:59:52 +08:00
|
|
|
|
2020-09-12 01:26:27 +08:00
|
|
|
- name: Tar sources
|
|
|
|
run: tar zcf sources.tar.gz sources
|
2022-02-25 04:17:25 +08:00
|
|
|
|
2020-04-23 15:40:21 +08:00
|
|
|
- name: Archive Source Bundle
|
2024-07-22 20:21:32 +08:00
|
|
|
uses: actions/upload-artifact@v4
|
2020-04-23 15:40:21 +08:00
|
|
|
with:
|
|
|
|
name: source-bundle
|
|
|
|
path: sources.tar.gz
|
|
|
|
|
CI: Apply the Refactored Build Rules based on Arch Labels
This PR continues to enhance the CI Workflow, to skip the unnecessary NuttX Builds. The PR will update the CI Build Workflow `build.yml`, to call the Refactored Build Rules in `arch.yml` (which is a Reusable Workflow).
The original rules were migrated from `build.yml` to `arch.yml`:
- We target only the Simple PRs: One Arch Label + One Size Label (e.g. "Arch: risc-v, Size: XS")
- For "Arch: risc-v": Build `risc-v-01`, `risc-v-02`
- For "Arch: xtensa": Build `xtensa-01`, `xtensa-02`
- The above rules apply when the PR is Created or Modified
- When the PR is Merged: All targets shall be built
This PR applies the New and Updated Rules defined in `arch.yml`:
- For "Arch: arm": Build `arm-01`, `arm-02`, ...
- For "Arch: arm64": Build `other`
- For "Arch: simulator": Build `sim-01`, `sim-02`
- For "Arch: x86_64": Build `other`
- For Simple PRs (One Arch Label + One Size Label): Skip the macOS and Windows builds (`macos`, `macos/sim-*`, `msys2`) since these builds are costly and slow
- Except for "Arch: Simulator", which will enable the macOS Builds for `sim-01` and `sim-02`
- If GitHub CLI Fails: Build all targets
The code is explained here: https://github.com/apache/nuttx/issues/13775
2024-10-07 15:20:40 +08:00
|
|
|
# Select the Linux Builds based on PR Arch Label
|
|
|
|
Linux-Arch:
|
|
|
|
uses: apache/nuttx/.github/workflows/arch.yml@master
|
2020-04-23 15:40:21 +08:00
|
|
|
needs: Fetch-Source
|
CI: Apply the Refactored Build Rules based on Arch Labels
This PR continues to enhance the CI Workflow, to skip the unnecessary NuttX Builds. The PR will update the CI Build Workflow `build.yml`, to call the Refactored Build Rules in `arch.yml` (which is a Reusable Workflow).
The original rules were migrated from `build.yml` to `arch.yml`:
- We target only the Simple PRs: One Arch Label + One Size Label (e.g. "Arch: risc-v, Size: XS")
- For "Arch: risc-v": Build `risc-v-01`, `risc-v-02`
- For "Arch: xtensa": Build `xtensa-01`, `xtensa-02`
- The above rules apply when the PR is Created or Modified
- When the PR is Merged: All targets shall be built
This PR applies the New and Updated Rules defined in `arch.yml`:
- For "Arch: arm": Build `arm-01`, `arm-02`, ...
- For "Arch: arm64": Build `other`
- For "Arch: simulator": Build `sim-01`, `sim-02`
- For "Arch: x86_64": Build `other`
- For Simple PRs (One Arch Label + One Size Label): Skip the macOS and Windows builds (`macos`, `macos/sim-*`, `msys2`) since these builds are costly and slow
- Except for "Arch: Simulator", which will enable the macOS Builds for `sim-01` and `sim-02`
- If GitHub CLI Fails: Build all targets
The code is explained here: https://github.com/apache/nuttx/issues/13775
2024-10-07 15:20:40 +08:00
|
|
|
with:
|
|
|
|
os: Linux
|
|
|
|
boards: |
|
|
|
|
[
|
CI: Split the Build Jobs for Arm64 and x86_64
This PR creates the new CI Build Jobs `arm64-01` and `x86_64-01`. The new jobs will split and offload the Arm64 and x86_64 Build Targets from `other`. This will reduce our usage of GitHub Runners, to comply with the ASF Policy for GitHub Actions. (Recently we see more PRs for Arm64 and x86_64)
Before the Split: Simple PRs (One Arch and/or One Board) for Arm64 and x86_64 require almost 1 hour for CI Build
- `other` (57 mins): AVR, SPARC, x86, PinePhone, QEMU Arm64, QEMU x86_64
After the Split: Simple PRs for Arm64 and x86_64 will complete under 30 mins
- `other` (24 mins): AVR, SPARC, x86
- `arm64-01` (29 mins): PinePhone, QEMU Arm64
- `x86_64-01` (9 mins): QEMU x86_64
To skip more unnecessary builds: Our Build Rules `arch.yml` shall ignore the label "Area: Documentation", so that a Simple PR + Docs is still a Simple PR. Previously we experienced longer CI Build Times, just because we added docs to our Simple PR. (Now our PR shall be built exactly like a Simple PR)
The updated CI code is explained here: https://github.com/apache/nuttx/issues/13775
2024-10-15 11:05:47 +08:00
|
|
|
"arm-01", "risc-v-01", "sim-01", "xtensa-01", "arm64-01", "x86_64-01", "other",
|
CI: Apply the Refactored Build Rules based on Arch Labels
This PR continues to enhance the CI Workflow, to skip the unnecessary NuttX Builds. The PR will update the CI Build Workflow `build.yml`, to call the Refactored Build Rules in `arch.yml` (which is a Reusable Workflow).
The original rules were migrated from `build.yml` to `arch.yml`:
- We target only the Simple PRs: One Arch Label + One Size Label (e.g. "Arch: risc-v, Size: XS")
- For "Arch: risc-v": Build `risc-v-01`, `risc-v-02`
- For "Arch: xtensa": Build `xtensa-01`, `xtensa-02`
- The above rules apply when the PR is Created or Modified
- When the PR is Merged: All targets shall be built
This PR applies the New and Updated Rules defined in `arch.yml`:
- For "Arch: arm": Build `arm-01`, `arm-02`, ...
- For "Arch: arm64": Build `other`
- For "Arch: simulator": Build `sim-01`, `sim-02`
- For "Arch: x86_64": Build `other`
- For Simple PRs (One Arch Label + One Size Label): Skip the macOS and Windows builds (`macos`, `macos/sim-*`, `msys2`) since these builds are costly and slow
- Except for "Arch: Simulator", which will enable the macOS Builds for `sim-01` and `sim-02`
- If GitHub CLI Fails: Build all targets
The code is explained here: https://github.com/apache/nuttx/issues/13775
2024-10-07 15:20:40 +08:00
|
|
|
"arm-02", "risc-v-02", "sim-02", "xtensa-02",
|
2024-10-21 14:57:21 +08:00
|
|
|
"arm-03", "risc-v-03", "sim-03",
|
CI: Split the RISC-V Build Jobs into smaller jobs
To speed up the CI Workflow, this PR splits the CI Build Jobs for RISC-V into smaller jobs. Each job will now complete within 1 hour.
Before the PR: There are 2 jobs for RISC-V, each requiring more than 1.5 hours
- `risc-v-01` (1 hour 42 mins): BL602, Ox64, ESP32-C3 / C6 / H2
- `risc-v-02` (1 hour 41 mins): K230, Icicle, QEMU, RV32M1-Vega
After the PR: The build is spread across 6 jobs for RISC-V, each job completes within 1 hour
- `risc-v-01` (19 mins): BL602, Ox64
- `risc-v-02` (44 mins): ESP32-C3
- `risc-v-03` (45 mins): ESP32-C6, ESP32-H2
- `risc-v-04` (31 mins): K230, Icicle
- `risc-v-05` (41 mins): QEMU CITest
- `risc-v-06` (38 mins): Rest of QEMU, RV32M1-Vega
Following the same convention as the Arm32 Build Jobs, the above jobs are sorted by Target Name. Performance of the RISC-V Build Jobs is discussed in https://github.com/apache/nuttx/issues/13775
2024-10-09 22:00:12 +08:00
|
|
|
"arm-04", "risc-v-04",
|
|
|
|
"arm-05", "risc-v-05",
|
|
|
|
"arm-06", "risc-v-06",
|
|
|
|
"arm-07", "arm-08", "arm-09", "arm-10", "arm-11", "arm-12", "arm-13", "arm-14"
|
CI: Apply the Refactored Build Rules based on Arch Labels
This PR continues to enhance the CI Workflow, to skip the unnecessary NuttX Builds. The PR will update the CI Build Workflow `build.yml`, to call the Refactored Build Rules in `arch.yml` (which is a Reusable Workflow).
The original rules were migrated from `build.yml` to `arch.yml`:
- We target only the Simple PRs: One Arch Label + One Size Label (e.g. "Arch: risc-v, Size: XS")
- For "Arch: risc-v": Build `risc-v-01`, `risc-v-02`
- For "Arch: xtensa": Build `xtensa-01`, `xtensa-02`
- The above rules apply when the PR is Created or Modified
- When the PR is Merged: All targets shall be built
This PR applies the New and Updated Rules defined in `arch.yml`:
- For "Arch: arm": Build `arm-01`, `arm-02`, ...
- For "Arch: arm64": Build `other`
- For "Arch: simulator": Build `sim-01`, `sim-02`
- For "Arch: x86_64": Build `other`
- For Simple PRs (One Arch Label + One Size Label): Skip the macOS and Windows builds (`macos`, `macos/sim-*`, `msys2`) since these builds are costly and slow
- Except for "Arch: Simulator", which will enable the macOS Builds for `sim-01` and `sim-02`
- If GitHub CLI Fails: Build all targets
The code is explained here: https://github.com/apache/nuttx/issues/13775
2024-10-07 15:20:40 +08:00
|
|
|
]
|
|
|
|
|
|
|
|
# Run the selected Linux Builds
|
|
|
|
Linux:
|
|
|
|
needs: Linux-Arch
|
|
|
|
if: ${{ needs.Linux-Arch.outputs.skip_all_builds != '1' }}
|
2020-04-23 15:40:21 +08:00
|
|
|
runs-on: ubuntu-latest
|
2020-03-15 14:26:48 +08:00
|
|
|
env:
|
|
|
|
DOCKER_BUILDKIT: 1
|
2020-03-05 14:00:35 +08:00
|
|
|
|
|
|
|
strategy:
|
build.yml: Limit the GitHub Runners
This PR modifies NuttX CI and GitHub Actions, to comply with ASF Policy. Right now, every NuttX Pull Request will trigger 24 Concurrent Jobs (GitHub Runners), executing them in parallel: https://lupyuen.github.io/articles/ci
According to ASF Policy: We should run at most 15 Concurrent Jobs: https://infra.apache.org/github-actions-policy.html
Thus we'll cut down the Concurrent Jobs from 24 down to 15. That's 12 Linux Jobs, 2 macOS, 1 Windows. (Each job takes 30 mins to 2 hours)
(1) Right now our "Linux > Strategy" is a flat list of 20 Linux Jobs, all executed in parallel
(2) We change "Linux > Strategy" to prioritise by Target Architecture, and limit to 12 concurrent jobs
(3) So NuttX CI will initially execute 12 Build Jobs across Arm32, Arm64, RISC-V, Simulator and Xtensa. As they complete, NuttX CI will execute the remaining 8 Build Jobs (for Arm32).
(4) This will extend the Overall Build Duration from [2 hours](https://github.com/apache/nuttx/actions/runs/10817443237) to [2.25 hours](https://github.com/lupyuen4/ci-nuttx/actions/runs/10828246630)
(5) We'll also limit macOS Jobs to 2, Windows Jobs to 1
2024-09-12 21:28:01 +08:00
|
|
|
max-parallel: 12
|
2020-03-05 14:00:35 +08:00
|
|
|
matrix:
|
CI: Apply the Refactored Build Rules based on Arch Labels
This PR continues to enhance the CI Workflow, to skip the unnecessary NuttX Builds. The PR will update the CI Build Workflow `build.yml`, to call the Refactored Build Rules in `arch.yml` (which is a Reusable Workflow).
The original rules were migrated from `build.yml` to `arch.yml`:
- We target only the Simple PRs: One Arch Label + One Size Label (e.g. "Arch: risc-v, Size: XS")
- For "Arch: risc-v": Build `risc-v-01`, `risc-v-02`
- For "Arch: xtensa": Build `xtensa-01`, `xtensa-02`
- The above rules apply when the PR is Created or Modified
- When the PR is Merged: All targets shall be built
This PR applies the New and Updated Rules defined in `arch.yml`:
- For "Arch: arm": Build `arm-01`, `arm-02`, ...
- For "Arch: arm64": Build `other`
- For "Arch: simulator": Build `sim-01`, `sim-02`
- For "Arch: x86_64": Build `other`
- For Simple PRs (One Arch Label + One Size Label): Skip the macOS and Windows builds (`macos`, `macos/sim-*`, `msys2`) since these builds are costly and slow
- Except for "Arch: Simulator", which will enable the macOS Builds for `sim-01` and `sim-02`
- If GitHub CLI Fails: Build all targets
The code is explained here: https://github.com/apache/nuttx/issues/13775
2024-10-07 15:20:40 +08:00
|
|
|
boards: ${{ fromJSON(needs.Linux-Arch.outputs.selected_builds) }}
|
2020-03-05 14:00:35 +08:00
|
|
|
|
2020-04-23 15:40:21 +08:00
|
|
|
steps:
|
build.yml: Skip the CI Builds that don't match the Arch Label
This PR proposes to enhance the CI Workflow, to skip the unnecessary NuttX Builds. Currently, NuttX Devs wait for the CI Builds to complete across All Architectures (Arm32, Arm64, RISC-V, Xtensa), even though they modified a Single Architecture. With this PR, the CI Workflow will build only the Modified Architecture.
The solution uses the Arch Labels for PRs. We target only the Simple PRs: One Arch Label + One Size Label (e.g. "Arch: risc-v, Size: XS")
- If "Arch: arm / arm64" is the only non-size label, then we build `other`, `arm-01`, `arm-02`, ...
- If "Arch: risc-v" is the only non-size label, then build `risc-v-01`, `risc-v-02`
- If "Arch: xtensa" is the only non-size label, then build `xtensa-01`, `xtensa-02`
- The above rules apply when the PR is Created or Modified
- When the PR is Merged: All targets shall be built
The code is explained here: https://github.com/apache/nuttx/issues/13775
2024-10-03 06:28:16 +08:00
|
|
|
|
2020-04-23 15:40:21 +08:00
|
|
|
- name: Download Source Artifact
|
2024-07-22 20:21:32 +08:00
|
|
|
uses: actions/download-artifact@v4
|
2020-04-23 15:40:21 +08:00
|
|
|
with:
|
|
|
|
name: source-bundle
|
2020-09-12 01:26:27 +08:00
|
|
|
path: .
|
2022-02-25 04:17:25 +08:00
|
|
|
|
2020-09-12 01:26:27 +08:00
|
|
|
- name: Extract sources
|
|
|
|
run: tar zxf sources.tar.gz
|
2022-02-25 04:17:25 +08:00
|
|
|
|
2020-04-23 15:40:21 +08:00
|
|
|
- name: Docker Login
|
2023-09-18 10:10:25 +08:00
|
|
|
uses: docker/login-action@v3
|
2020-04-23 15:40:21 +08:00
|
|
|
with:
|
2022-02-25 04:17:25 +08:00
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.actor }}
|
2020-04-23 15:40:21 +08:00
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
2020-05-02 11:59:52 +08:00
|
|
|
|
2020-04-23 15:40:21 +08:00
|
|
|
- name: Docker Pull
|
2022-11-23 02:59:48 +08:00
|
|
|
run: docker pull ghcr.io/apache/nuttx/apache-nuttx-ci-linux
|
2022-02-25 04:17:25 +08:00
|
|
|
|
2020-05-05 13:27:57 +08:00
|
|
|
- name: Export NuttX Repo SHA
|
2020-12-15 09:01:37 +08:00
|
|
|
run: echo "nuttx_sha=`git -C sources/nuttx rev-parse HEAD`" >> $GITHUB_ENV
|
2022-02-25 04:17:25 +08:00
|
|
|
|
2020-04-23 15:40:21 +08:00
|
|
|
- name: Run builds
|
2021-04-05 10:55:34 +08:00
|
|
|
uses: ./sources/nuttx/.github/actions/ci-container
|
2020-04-23 15:40:21 +08:00
|
|
|
env:
|
|
|
|
BLOBDIR: /tools/blobs
|
|
|
|
with:
|
|
|
|
run: |
|
2020-06-01 05:19:21 +08:00
|
|
|
echo "::add-matcher::sources/nuttx/.github/gcc.json"
|
2021-04-05 10:55:34 +08:00
|
|
|
export ARTIFACTDIR=`pwd`/buildartifacts
|
2022-06-23 05:33:15 +08:00
|
|
|
git config --global --add safe.directory /github/workspace/sources/nuttx
|
2022-06-25 09:28:22 +08:00
|
|
|
git config --global --add safe.directory /github/workspace/sources/apps
|
2021-04-05 10:55:34 +08:00
|
|
|
cd sources/nuttx/tools/ci
|
2022-09-14 17:59:17 +08:00
|
|
|
if [ "X${{matrix.boards}}" = "Xcodechecker" ]; then
|
2024-07-17 00:07:08 +08:00
|
|
|
./cibuild.sh -c -A -N -R --codechecker testlist/${{matrix.boards}}.dat
|
2022-09-14 17:59:17 +08:00
|
|
|
else
|
2024-08-01 23:39:27 +08:00
|
|
|
./cibuild.sh -c -A -N -R -S testlist/${{matrix.boards}}.dat
|
2022-09-14 17:59:17 +08:00
|
|
|
fi
|
2022-02-25 04:17:25 +08:00
|
|
|
|
2024-07-22 20:21:32 +08:00
|
|
|
- uses: actions/upload-artifact@v4
|
2022-09-14 17:59:17 +08:00
|
|
|
if: ${{ always() }}
|
2020-10-26 12:18:43 +08:00
|
|
|
with:
|
2024-07-22 20:21:32 +08:00
|
|
|
name: linux-${{matrix.boards}}-builds
|
2020-10-26 12:18:43 +08:00
|
|
|
path: buildartifacts/
|
2020-12-23 15:06:12 +08:00
|
|
|
continue-on-error: true
|
2020-04-09 13:33:16 +08:00
|
|
|
|
CI: Apply the Refactored Build Rules based on Arch Labels
This PR continues to enhance the CI Workflow, to skip the unnecessary NuttX Builds. The PR will update the CI Build Workflow `build.yml`, to call the Refactored Build Rules in `arch.yml` (which is a Reusable Workflow).
The original rules were migrated from `build.yml` to `arch.yml`:
- We target only the Simple PRs: One Arch Label + One Size Label (e.g. "Arch: risc-v, Size: XS")
- For "Arch: risc-v": Build `risc-v-01`, `risc-v-02`
- For "Arch: xtensa": Build `xtensa-01`, `xtensa-02`
- The above rules apply when the PR is Created or Modified
- When the PR is Merged: All targets shall be built
This PR applies the New and Updated Rules defined in `arch.yml`:
- For "Arch: arm": Build `arm-01`, `arm-02`, ...
- For "Arch: arm64": Build `other`
- For "Arch: simulator": Build `sim-01`, `sim-02`
- For "Arch: x86_64": Build `other`
- For Simple PRs (One Arch Label + One Size Label): Skip the macOS and Windows builds (`macos`, `macos/sim-*`, `msys2`) since these builds are costly and slow
- Except for "Arch: Simulator", which will enable the macOS Builds for `sim-01` and `sim-02`
- If GitHub CLI Fails: Build all targets
The code is explained here: https://github.com/apache/nuttx/issues/13775
2024-10-07 15:20:40 +08:00
|
|
|
# Select the macOS Builds based on PR Arch Label
|
|
|
|
macOS-Arch:
|
|
|
|
uses: apache/nuttx/.github/workflows/arch.yml@master
|
|
|
|
needs: Fetch-Source
|
|
|
|
with:
|
2024-10-17 14:33:44 +08:00
|
|
|
os: macOS
|
CI: Apply the Refactored Build Rules based on Arch Labels
This PR continues to enhance the CI Workflow, to skip the unnecessary NuttX Builds. The PR will update the CI Build Workflow `build.yml`, to call the Refactored Build Rules in `arch.yml` (which is a Reusable Workflow).
The original rules were migrated from `build.yml` to `arch.yml`:
- We target only the Simple PRs: One Arch Label + One Size Label (e.g. "Arch: risc-v, Size: XS")
- For "Arch: risc-v": Build `risc-v-01`, `risc-v-02`
- For "Arch: xtensa": Build `xtensa-01`, `xtensa-02`
- The above rules apply when the PR is Created or Modified
- When the PR is Merged: All targets shall be built
This PR applies the New and Updated Rules defined in `arch.yml`:
- For "Arch: arm": Build `arm-01`, `arm-02`, ...
- For "Arch: arm64": Build `other`
- For "Arch: simulator": Build `sim-01`, `sim-02`
- For "Arch: x86_64": Build `other`
- For Simple PRs (One Arch Label + One Size Label): Skip the macOS and Windows builds (`macos`, `macos/sim-*`, `msys2`) since these builds are costly and slow
- Except for "Arch: Simulator", which will enable the macOS Builds for `sim-01` and `sim-02`
- If GitHub CLI Fails: Build all targets
The code is explained here: https://github.com/apache/nuttx/issues/13775
2024-10-07 15:20:40 +08:00
|
|
|
boards: |
|
2024-10-21 14:57:21 +08:00
|
|
|
["macos", "sim-01", "sim-02", "sim-03"]
|
CI: Apply the Refactored Build Rules based on Arch Labels
This PR continues to enhance the CI Workflow, to skip the unnecessary NuttX Builds. The PR will update the CI Build Workflow `build.yml`, to call the Refactored Build Rules in `arch.yml` (which is a Reusable Workflow).
The original rules were migrated from `build.yml` to `arch.yml`:
- We target only the Simple PRs: One Arch Label + One Size Label (e.g. "Arch: risc-v, Size: XS")
- For "Arch: risc-v": Build `risc-v-01`, `risc-v-02`
- For "Arch: xtensa": Build `xtensa-01`, `xtensa-02`
- The above rules apply when the PR is Created or Modified
- When the PR is Merged: All targets shall be built
This PR applies the New and Updated Rules defined in `arch.yml`:
- For "Arch: arm": Build `arm-01`, `arm-02`, ...
- For "Arch: arm64": Build `other`
- For "Arch: simulator": Build `sim-01`, `sim-02`
- For "Arch: x86_64": Build `other`
- For Simple PRs (One Arch Label + One Size Label): Skip the macOS and Windows builds (`macos`, `macos/sim-*`, `msys2`) since these builds are costly and slow
- Except for "Arch: Simulator", which will enable the macOS Builds for `sim-01` and `sim-02`
- If GitHub CLI Fails: Build all targets
The code is explained here: https://github.com/apache/nuttx/issues/13775
2024-10-07 15:20:40 +08:00
|
|
|
|
|
|
|
# Run the selected macOS Builds
|
2020-04-15 13:15:04 +08:00
|
|
|
macOS:
|
2022-06-17 08:32:28 +08:00
|
|
|
permissions:
|
|
|
|
contents: none
|
2023-07-03 04:30:58 +08:00
|
|
|
runs-on: macos-13
|
CI: Apply the Refactored Build Rules based on Arch Labels
This PR continues to enhance the CI Workflow, to skip the unnecessary NuttX Builds. The PR will update the CI Build Workflow `build.yml`, to call the Refactored Build Rules in `arch.yml` (which is a Reusable Workflow).
The original rules were migrated from `build.yml` to `arch.yml`:
- We target only the Simple PRs: One Arch Label + One Size Label (e.g. "Arch: risc-v, Size: XS")
- For "Arch: risc-v": Build `risc-v-01`, `risc-v-02`
- For "Arch: xtensa": Build `xtensa-01`, `xtensa-02`
- The above rules apply when the PR is Created or Modified
- When the PR is Merged: All targets shall be built
This PR applies the New and Updated Rules defined in `arch.yml`:
- For "Arch: arm": Build `arm-01`, `arm-02`, ...
- For "Arch: arm64": Build `other`
- For "Arch: simulator": Build `sim-01`, `sim-02`
- For "Arch: x86_64": Build `other`
- For Simple PRs (One Arch Label + One Size Label): Skip the macOS and Windows builds (`macos`, `macos/sim-*`, `msys2`) since these builds are costly and slow
- Except for "Arch: Simulator", which will enable the macOS Builds for `sim-01` and `sim-02`
- If GitHub CLI Fails: Build all targets
The code is explained here: https://github.com/apache/nuttx/issues/13775
2024-10-07 15:20:40 +08:00
|
|
|
needs: macOS-Arch
|
|
|
|
if: ${{ needs.macOS-Arch.outputs.skip_all_builds != '1' }}
|
2020-04-09 13:33:16 +08:00
|
|
|
strategy:
|
build.yml: Limit the GitHub Runners
This PR modifies NuttX CI and GitHub Actions, to comply with ASF Policy. Right now, every NuttX Pull Request will trigger 24 Concurrent Jobs (GitHub Runners), executing them in parallel: https://lupyuen.github.io/articles/ci
According to ASF Policy: We should run at most 15 Concurrent Jobs: https://infra.apache.org/github-actions-policy.html
Thus we'll cut down the Concurrent Jobs from 24 down to 15. That's 12 Linux Jobs, 2 macOS, 1 Windows. (Each job takes 30 mins to 2 hours)
(1) Right now our "Linux > Strategy" is a flat list of 20 Linux Jobs, all executed in parallel
(2) We change "Linux > Strategy" to prioritise by Target Architecture, and limit to 12 concurrent jobs
(3) So NuttX CI will initially execute 12 Build Jobs across Arm32, Arm64, RISC-V, Simulator and Xtensa. As they complete, NuttX CI will execute the remaining 8 Build Jobs (for Arm32).
(4) This will extend the Overall Build Duration from [2 hours](https://github.com/apache/nuttx/actions/runs/10817443237) to [2.25 hours](https://github.com/lupyuen4/ci-nuttx/actions/runs/10828246630)
(5) We'll also limit macOS Jobs to 2, Windows Jobs to 1
2024-09-12 21:28:01 +08:00
|
|
|
max-parallel: 2
|
2020-04-09 13:33:16 +08:00
|
|
|
matrix:
|
CI: Apply the Refactored Build Rules based on Arch Labels
This PR continues to enhance the CI Workflow, to skip the unnecessary NuttX Builds. The PR will update the CI Build Workflow `build.yml`, to call the Refactored Build Rules in `arch.yml` (which is a Reusable Workflow).
The original rules were migrated from `build.yml` to `arch.yml`:
- We target only the Simple PRs: One Arch Label + One Size Label (e.g. "Arch: risc-v, Size: XS")
- For "Arch: risc-v": Build `risc-v-01`, `risc-v-02`
- For "Arch: xtensa": Build `xtensa-01`, `xtensa-02`
- The above rules apply when the PR is Created or Modified
- When the PR is Merged: All targets shall be built
This PR applies the New and Updated Rules defined in `arch.yml`:
- For "Arch: arm": Build `arm-01`, `arm-02`, ...
- For "Arch: arm64": Build `other`
- For "Arch: simulator": Build `sim-01`, `sim-02`
- For "Arch: x86_64": Build `other`
- For Simple PRs (One Arch Label + One Size Label): Skip the macOS and Windows builds (`macos`, `macos/sim-*`, `msys2`) since these builds are costly and slow
- Except for "Arch: Simulator", which will enable the macOS Builds for `sim-01` and `sim-02`
- If GitHub CLI Fails: Build all targets
The code is explained here: https://github.com/apache/nuttx/issues/13775
2024-10-07 15:20:40 +08:00
|
|
|
boards: ${{ fromJSON(needs.macOS-Arch.outputs.selected_builds) }}
|
2020-04-09 13:33:16 +08:00
|
|
|
steps:
|
2020-04-23 15:40:21 +08:00
|
|
|
- name: Download Source Artifact
|
2024-07-22 20:21:32 +08:00
|
|
|
uses: actions/download-artifact@v4
|
2020-04-23 15:40:21 +08:00
|
|
|
with:
|
|
|
|
name: source-bundle
|
2020-09-12 01:26:27 +08:00
|
|
|
path: .
|
2022-02-25 04:17:25 +08:00
|
|
|
|
2020-09-12 01:26:27 +08:00
|
|
|
- name: Extract sources
|
|
|
|
run: tar zxf sources.tar.gz
|
2022-02-25 04:17:25 +08:00
|
|
|
|
2020-04-23 15:40:21 +08:00
|
|
|
- name: Restore Tools Cache
|
|
|
|
id: cache-tools
|
2024-01-22 10:55:53 +08:00
|
|
|
uses: actions/cache@v4
|
2020-04-23 15:40:21 +08:00
|
|
|
env:
|
|
|
|
cache-name: ${{ runner.os }}-cache-tools
|
|
|
|
with:
|
2022-12-10 18:05:41 +08:00
|
|
|
path: ./sources/tools
|
2024-03-14 22:54:47 +08:00
|
|
|
key: ${{ runner.os }}-tools-${{ hashFiles('./sources/nuttx/tools/ci/platforms/darwin.sh') }}
|
2020-04-23 15:40:21 +08:00
|
|
|
|
2020-05-05 13:27:57 +08:00
|
|
|
- name: Export NuttX Repo SHA
|
2020-12-15 09:01:37 +08:00
|
|
|
run: echo "nuttx_sha=`git -C sources/nuttx rev-parse HEAD`" >> $GITHUB_ENV
|
2022-02-25 04:17:25 +08:00
|
|
|
|
2022-11-21 12:46:51 +08:00
|
|
|
# Released version of Cython has issues with Python 11. Set runner to use Python 3.10
|
|
|
|
# https://github.com/cython/cython/issues/4500
|
2023-12-11 10:18:11 +08:00
|
|
|
- uses: actions/setup-python@v5
|
2022-11-21 12:46:51 +08:00
|
|
|
with:
|
2022-12-12 05:54:21 +08:00
|
|
|
python-version: '3.10'
|
2020-04-23 15:40:21 +08:00
|
|
|
- name: Run Builds
|
|
|
|
run: |
|
2020-06-01 05:19:21 +08:00
|
|
|
echo "::add-matcher::sources/nuttx/.github/gcc.json"
|
2021-04-05 10:55:34 +08:00
|
|
|
export ARTIFACTDIR=`pwd`/buildartifacts
|
|
|
|
cd sources/nuttx/tools/ci
|
2022-12-10 18:29:47 +08:00
|
|
|
./cibuild.sh -i -c -A -R testlist/${{matrix.boards}}.dat
|
2022-02-25 04:17:25 +08:00
|
|
|
|
2024-07-22 20:21:32 +08:00
|
|
|
- uses: actions/upload-artifact@v4
|
2020-10-26 12:18:43 +08:00
|
|
|
with:
|
2024-07-22 20:21:32 +08:00
|
|
|
name: macos-${{matrix.boards}}-builds
|
2020-10-26 12:18:43 +08:00
|
|
|
path: buildartifacts/
|
2020-12-23 15:06:12 +08:00
|
|
|
continue-on-error: true
|
2024-01-09 01:15:00 +08:00
|
|
|
|
CI: Apply the Refactored Build Rules based on Arch Labels
This PR continues to enhance the CI Workflow, to skip the unnecessary NuttX Builds. The PR will update the CI Build Workflow `build.yml`, to call the Refactored Build Rules in `arch.yml` (which is a Reusable Workflow).
The original rules were migrated from `build.yml` to `arch.yml`:
- We target only the Simple PRs: One Arch Label + One Size Label (e.g. "Arch: risc-v, Size: XS")
- For "Arch: risc-v": Build `risc-v-01`, `risc-v-02`
- For "Arch: xtensa": Build `xtensa-01`, `xtensa-02`
- The above rules apply when the PR is Created or Modified
- When the PR is Merged: All targets shall be built
This PR applies the New and Updated Rules defined in `arch.yml`:
- For "Arch: arm": Build `arm-01`, `arm-02`, ...
- For "Arch: arm64": Build `other`
- For "Arch: simulator": Build `sim-01`, `sim-02`
- For "Arch: x86_64": Build `other`
- For Simple PRs (One Arch Label + One Size Label): Skip the macOS and Windows builds (`macos`, `macos/sim-*`, `msys2`) since these builds are costly and slow
- Except for "Arch: Simulator", which will enable the macOS Builds for `sim-01` and `sim-02`
- If GitHub CLI Fails: Build all targets
The code is explained here: https://github.com/apache/nuttx/issues/13775
2024-10-07 15:20:40 +08:00
|
|
|
# Select the msys2 Builds based on PR Arch Label
|
|
|
|
msys2-Arch:
|
|
|
|
uses: apache/nuttx/.github/workflows/arch.yml@master
|
2024-01-09 01:15:00 +08:00
|
|
|
needs: Fetch-Source
|
CI: Apply the Refactored Build Rules based on Arch Labels
This PR continues to enhance the CI Workflow, to skip the unnecessary NuttX Builds. The PR will update the CI Build Workflow `build.yml`, to call the Refactored Build Rules in `arch.yml` (which is a Reusable Workflow).
The original rules were migrated from `build.yml` to `arch.yml`:
- We target only the Simple PRs: One Arch Label + One Size Label (e.g. "Arch: risc-v, Size: XS")
- For "Arch: risc-v": Build `risc-v-01`, `risc-v-02`
- For "Arch: xtensa": Build `xtensa-01`, `xtensa-02`
- The above rules apply when the PR is Created or Modified
- When the PR is Merged: All targets shall be built
This PR applies the New and Updated Rules defined in `arch.yml`:
- For "Arch: arm": Build `arm-01`, `arm-02`, ...
- For "Arch: arm64": Build `other`
- For "Arch: simulator": Build `sim-01`, `sim-02`
- For "Arch: x86_64": Build `other`
- For Simple PRs (One Arch Label + One Size Label): Skip the macOS and Windows builds (`macos`, `macos/sim-*`, `msys2`) since these builds are costly and slow
- Except for "Arch: Simulator", which will enable the macOS Builds for `sim-01` and `sim-02`
- If GitHub CLI Fails: Build all targets
The code is explained here: https://github.com/apache/nuttx/issues/13775
2024-10-07 15:20:40 +08:00
|
|
|
with:
|
2024-10-17 14:33:44 +08:00
|
|
|
os: msys2
|
CI: Apply the Refactored Build Rules based on Arch Labels
This PR continues to enhance the CI Workflow, to skip the unnecessary NuttX Builds. The PR will update the CI Build Workflow `build.yml`, to call the Refactored Build Rules in `arch.yml` (which is a Reusable Workflow).
The original rules were migrated from `build.yml` to `arch.yml`:
- We target only the Simple PRs: One Arch Label + One Size Label (e.g. "Arch: risc-v, Size: XS")
- For "Arch: risc-v": Build `risc-v-01`, `risc-v-02`
- For "Arch: xtensa": Build `xtensa-01`, `xtensa-02`
- The above rules apply when the PR is Created or Modified
- When the PR is Merged: All targets shall be built
This PR applies the New and Updated Rules defined in `arch.yml`:
- For "Arch: arm": Build `arm-01`, `arm-02`, ...
- For "Arch: arm64": Build `other`
- For "Arch: simulator": Build `sim-01`, `sim-02`
- For "Arch: x86_64": Build `other`
- For Simple PRs (One Arch Label + One Size Label): Skip the macOS and Windows builds (`macos`, `macos/sim-*`, `msys2`) since these builds are costly and slow
- Except for "Arch: Simulator", which will enable the macOS Builds for `sim-01` and `sim-02`
- If GitHub CLI Fails: Build all targets
The code is explained here: https://github.com/apache/nuttx/issues/13775
2024-10-07 15:20:40 +08:00
|
|
|
boards: |
|
|
|
|
["msys2"]
|
|
|
|
|
|
|
|
# Run the selected msys2 Builds
|
|
|
|
msys2:
|
|
|
|
needs: msys2-Arch
|
|
|
|
if: ${{ needs.msys2-Arch.outputs.skip_all_builds != '1' }}
|
2024-01-09 01:15:00 +08:00
|
|
|
runs-on: windows-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
build.yml: Limit the GitHub Runners
This PR modifies NuttX CI and GitHub Actions, to comply with ASF Policy. Right now, every NuttX Pull Request will trigger 24 Concurrent Jobs (GitHub Runners), executing them in parallel: https://lupyuen.github.io/articles/ci
According to ASF Policy: We should run at most 15 Concurrent Jobs: https://infra.apache.org/github-actions-policy.html
Thus we'll cut down the Concurrent Jobs from 24 down to 15. That's 12 Linux Jobs, 2 macOS, 1 Windows. (Each job takes 30 mins to 2 hours)
(1) Right now our "Linux > Strategy" is a flat list of 20 Linux Jobs, all executed in parallel
(2) We change "Linux > Strategy" to prioritise by Target Architecture, and limit to 12 concurrent jobs
(3) So NuttX CI will initially execute 12 Build Jobs across Arm32, Arm64, RISC-V, Simulator and Xtensa. As they complete, NuttX CI will execute the remaining 8 Build Jobs (for Arm32).
(4) This will extend the Overall Build Duration from [2 hours](https://github.com/apache/nuttx/actions/runs/10817443237) to [2.25 hours](https://github.com/lupyuen4/ci-nuttx/actions/runs/10828246630)
(5) We'll also limit macOS Jobs to 2, Windows Jobs to 1
2024-09-12 21:28:01 +08:00
|
|
|
max-parallel: 1
|
2024-01-09 01:15:00 +08:00
|
|
|
matrix:
|
CI: Apply the Refactored Build Rules based on Arch Labels
This PR continues to enhance the CI Workflow, to skip the unnecessary NuttX Builds. The PR will update the CI Build Workflow `build.yml`, to call the Refactored Build Rules in `arch.yml` (which is a Reusable Workflow).
The original rules were migrated from `build.yml` to `arch.yml`:
- We target only the Simple PRs: One Arch Label + One Size Label (e.g. "Arch: risc-v, Size: XS")
- For "Arch: risc-v": Build `risc-v-01`, `risc-v-02`
- For "Arch: xtensa": Build `xtensa-01`, `xtensa-02`
- The above rules apply when the PR is Created or Modified
- When the PR is Merged: All targets shall be built
This PR applies the New and Updated Rules defined in `arch.yml`:
- For "Arch: arm": Build `arm-01`, `arm-02`, ...
- For "Arch: arm64": Build `other`
- For "Arch: simulator": Build `sim-01`, `sim-02`
- For "Arch: x86_64": Build `other`
- For Simple PRs (One Arch Label + One Size Label): Skip the macOS and Windows builds (`macos`, `macos/sim-*`, `msys2`) since these builds are costly and slow
- Except for "Arch: Simulator", which will enable the macOS Builds for `sim-01` and `sim-02`
- If GitHub CLI Fails: Build all targets
The code is explained here: https://github.com/apache/nuttx/issues/13775
2024-10-07 15:20:40 +08:00
|
|
|
boards: ${{ fromJSON(needs.msys2-Arch.outputs.selected_builds) }}
|
2024-01-09 01:15:00 +08:00
|
|
|
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: msys2 {0}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: msys2/setup-msys2@v2
|
|
|
|
with:
|
|
|
|
msystem: MSYS
|
|
|
|
update: false
|
|
|
|
install: >-
|
|
|
|
base-devel
|
|
|
|
gcc
|
|
|
|
gperf
|
|
|
|
automake
|
|
|
|
autoconf
|
|
|
|
git
|
|
|
|
python3
|
|
|
|
ncurses-devel
|
|
|
|
unzip
|
|
|
|
zip
|
|
|
|
tio
|
|
|
|
zlib-devel
|
|
|
|
cmake
|
|
|
|
ninja
|
|
|
|
python-pip
|
|
|
|
vim
|
|
|
|
|
|
|
|
- name: pip3 install
|
|
|
|
run: |
|
2024-07-29 17:30:02 +08:00
|
|
|
python3 -m venv --system-site-packages /usr/local
|
2024-01-09 01:15:00 +08:00
|
|
|
pip3 install --root-user-action=ignore --no-cache-dir pyelftools cxxfilt kconfiglib
|
|
|
|
|
|
|
|
- run: git config --global core.autocrlf false
|
|
|
|
|
|
|
|
- name: Download Source Artifact
|
2024-07-22 20:21:32 +08:00
|
|
|
uses: actions/download-artifact@v4
|
2024-01-09 01:15:00 +08:00
|
|
|
with:
|
|
|
|
name: source-bundle
|
|
|
|
path: .
|
|
|
|
|
|
|
|
- name: Extract sources
|
|
|
|
run: tar zxf sources.tar.gz
|
|
|
|
|
|
|
|
- name: Export NuttX Repo SHA
|
|
|
|
run: echo "nuttx_sha=`git -C sources/nuttx rev-parse HEAD`" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Run Builds
|
|
|
|
run: |
|
|
|
|
echo "::add-matcher::sources/nuttx/.github/gcc.json"
|
|
|
|
export ARTIFACTDIR=`pwd`/buildartifacts
|
|
|
|
git config --global --add safe.directory /github/workspace/sources/nuttx
|
|
|
|
git config --global --add safe.directory /github/workspace/sources/apps
|
|
|
|
cd sources/nuttx/tools/ci
|
2024-10-10 09:47:56 +08:00
|
|
|
./cibuild.sh -g -i -A -C -R testlist/${{matrix.boards}}.dat
|
2024-01-09 01:15:00 +08:00
|
|
|
|
2024-07-22 20:21:32 +08:00
|
|
|
- uses: actions/upload-artifact@v4
|
2024-01-09 01:15:00 +08:00
|
|
|
with:
|
2024-07-22 20:21:32 +08:00
|
|
|
name: msys2-${{matrix.boards}}-builds
|
2024-01-09 01:15:00 +08:00
|
|
|
path: buildartifacts/
|
|
|
|
continue-on-error: true
|
2024-10-08 12:20:05 +08:00
|
|
|
|
|
|
|
# Select the msvc Builds based on PR Arch Label
|
|
|
|
msvc-Arch:
|
|
|
|
uses: apache/nuttx/.github/workflows/arch.yml@master
|
|
|
|
needs: Fetch-Source
|
|
|
|
with:
|
|
|
|
os: msvc
|
|
|
|
boards: |
|
|
|
|
["msvc_placeholder_with_sim_keyword"]
|
|
|
|
|
|
|
|
# Build with MSVC in Windows native
|
|
|
|
msvc:
|
|
|
|
needs: msvc-Arch
|
|
|
|
if: ${{ needs.msvc-Arch.outputs.skip_all_builds != '1' }}
|
|
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
# Set up Python environment and install kconfiglib
|
|
|
|
- name: Set up Python and install kconfiglib
|
|
|
|
uses: actions/setup-python@v5
|
|
|
|
with:
|
|
|
|
python-version: '3.10'
|
|
|
|
- name: Install kconfiglib
|
|
|
|
run: |
|
|
|
|
pip install kconfiglib
|
|
|
|
|
|
|
|
- run: git config --global core.autocrlf false
|
|
|
|
|
|
|
|
- name: Download Source Artifact
|
|
|
|
uses: actions/download-artifact@v4
|
|
|
|
with:
|
|
|
|
name: source-bundle
|
|
|
|
path: .
|
|
|
|
|
|
|
|
- name: Extract sources
|
|
|
|
run: |
|
|
|
|
7z x sources.tar.gz -y
|
|
|
|
7z x sources.tar -y
|
|
|
|
|
|
|
|
# Build the project using the given CMake commands
|
|
|
|
- name: Configure and build with CMake
|
|
|
|
run: |
|
|
|
|
cd sources/nuttx
|
|
|
|
cmake -B vs2022 -DBOARD_CONFIG=sim/windows -G"Visual Studio 17 2022" -A Win32
|
|
|
|
cmake --build vs2022
|
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: msvc-builds
|
|
|
|
path: buildartifacts/
|
|
|
|
continue-on-error: true
|