Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into stm32h5
Browse files Browse the repository at this point in the history
  • Loading branch information
kywwilson11 committed Oct 16, 2024
2 parents 12999a1 + addfe12 commit 35f6f61
Show file tree
Hide file tree
Showing 1,369 changed files with 36,768 additions and 22,902 deletions.
15 changes: 15 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
*Note: Please adhere to [Contributing Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).*

## Summary

*Update this section with information on why change is necessary,
what it exactly does and how, if new feature shows up, provide
references (dependencies, similar problems and solutions), etc.*

## Impact

*Update this section, where applicable, on how change affects users,
build process, hardware, documentation, security, compatibility, etc.*

## Testing

*Update this section with details on how did you verify the change,
what Host was used for build (OS, CPU, compiler, ..), what Target was
used for verification (arch, board:config, ..), etc. Providing build
and runtime logs from before and after change is highly appreciated.*


74 changes: 69 additions & 5 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,72 @@
- changed-files:
- any-glob-to-any-file: 'arch/z80/**'

# add board labels

"Board: arm":
- changed-files:
- any-glob-to-any-file: 'boards/arm/**'

"Board: arm64":
- changed-files:
- any-glob-to-any-file: 'boards/arm64/**'

"Board: avr":
- changed-files:
- any-glob-to-any-file: 'boards/avr/**'

"Board: hc":
- changed-files:
- any-glob-to-any-file: 'boards/hc/**'

"Board: mips":
- changed-files:
- any-glob-to-any-file: 'boards/mips/**'

"Board: openrisc":
- changed-files:
- any-glob-to-any-file: 'boards/or1k/**'

"Board: renesas":
- changed-files:
- any-glob-to-any-file: 'boards/renesas/**'

"Board: risc-v":
- changed-files:
- any-glob-to-any-file: 'boards/risc-v/**'

"Board: simulator":
- changed-files:
- any-glob-to-any-file: 'boards/sim/**'

"Board: sparc":
- changed-files:
- any-glob-to-any-file: 'boards/sparc/**'

"Board: tricore":
- changed-files:
- any-glob-to-any-file: 'boards/tricore/**'

"Board: x86":
- changed-files:
- any-glob-to-any-file: 'boards/x86/**'

"Board: x86_64":
- changed-files:
- any-glob-to-any-file: 'boards/x86_64/**'

"Board: xtensa":
- changed-files:
- any-glob-to-any-file: 'boards/xtensa/**'

"Board: z16":
- changed-files:
- any-glob-to-any-file: 'boards/z16/**'

"Board: z80":
- changed-files:
- any-glob-to-any-file: 'boards/z80/**'

# add area labels

"Area: Audio":
Expand All @@ -104,13 +170,9 @@
"Area: Bluetooth":
- changed-files:
- any-glob-to-any-file: 'wireless/bluetooth/**'
- any-glob-to-any-file: 'nuttx/drivers/wireless/bluetooth/**'
- any-glob-to-any-file: 'drivers/wireless/bluetooth/**'
- any-glob-to-any-file: 'include/nuttx/wireless/bluetooth/**'

"Area: Board support":
- changed-files:
- any-glob-to-any-file: 'boards/**'

"Area: Build system":
- changed-files:
- any-glob-to-any-file: 'Makefile'
Expand Down Expand Up @@ -169,6 +231,8 @@
- any-glob-to-any-file: 'sched/**'
- any-glob-to-any-file: 'syscall/**'
- any-glob-to-any-file: 'libs/**'
- any-glob-to-any-file: 'include/*.h'
- any-glob-to-any-file: 'include/nuttx/*.h'

"Area: PCI":
- changed-files:
Expand Down
1 change: 1 addition & 0 deletions .github/linters/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
ignore = W503,W605,E203
max-complexity = 27
max-line-length = 125
multi_line_output=3
show-source = True
statistics = True

Expand Down
100 changes: 82 additions & 18 deletions .github/workflows/arch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,28 @@ jobs:
# If PR is Not Created or Modified: Build all targets
pr=${{github.event.pull_request.number}}
if [[ "$pr" == "" ]]; then
echo "Not a Created or Modified PR, will build all targets"
exit
fi
# Get the Labels for the PR: "Arch: risc-v \n Size: XS"
# Get the Labels for the PR: "Arch: risc-v \n Board: risc-v \n Size: XS"
# If GitHub CLI Fails: Build all targets
labels=$(gh pr view $pr --repo $GITHUB_REPOSITORY --json labels --jq '.labels[] | .name' || echo "")
numlabels=$(gh pr view $pr --repo $GITHUB_REPOSITORY --json labels --jq '.[] | length' || echo "")
echo "numlabels=$numlabels" | tee -a $GITHUB_OUTPUT
# Identify the Size and Arch Labels
# Identify the Size, Arch and Board Labels
if [[ "$labels" == *"Size: "* ]]; then
echo 'labels_contain_size=1' | tee -a $GITHUB_OUTPUT
fi
if [[ "$labels" == *"Arch: "* ]]; then
echo 'labels_contain_arch=1' | tee -a $GITHUB_OUTPUT
fi
if [[ "$labels" == *"Board: "* ]]; then
echo 'labels_contain_board=1' | tee -a $GITHUB_OUTPUT
fi
# Get the Arch Label
if [[ "$labels" == *"Arch: arm64"* ]]; then
echo 'arch_contains_arm64=1' | tee -a $GITHUB_OUTPUT
elif [[ "$labels" == *"Arch: arm"* ]]; then
Expand All @@ -64,6 +73,22 @@ jobs:
elif [[ "$labels" == *"Arch: xtensa"* ]]; then
echo 'arch_contains_xtensa=1' | tee -a $GITHUB_OUTPUT
fi
# Get the Board Label
if [[ "$labels" == *"Board: arm64"* ]]; then
echo 'board_contains_arm64=1' | tee -a $GITHUB_OUTPUT
elif [[ "$labels" == *"Board: arm"* ]]; then
echo 'board_contains_arm=1' | tee -a $GITHUB_OUTPUT
elif [[ "$labels" == *"Board: risc-v"* ]]; then
echo 'board_contains_riscv=1' | tee -a $GITHUB_OUTPUT
elif [[ "$labels" == *"Board: simulator"* ]]; then
echo 'board_contains_sim=1' | tee -a $GITHUB_OUTPUT
elif [[ "$labels" == *"Board: x86_64"* ]]; then
echo 'board_contains_x86_64=1' | tee -a $GITHUB_OUTPUT
elif [[ "$labels" == *"Board: xtensa"* ]]; then
echo 'board_contains_xtensa=1' | tee -a $GITHUB_OUTPUT
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -73,22 +98,61 @@ jobs:
run: |
# Fetch the outputs from the previous step
numlabels=${{ steps.get-arch.outputs.numlabels }}
labels_contain_size=${{ steps.get-arch.outputs.labels_contain_size }}
labels_contain_arch=${{ steps.get-arch.outputs.labels_contain_arch }}
labels_contain_board=${{ steps.get-arch.outputs.labels_contain_board }}
arch_contains_arm=${{ steps.get-arch.outputs.arch_contains_arm }}
arch_contains_arm64=${{ steps.get-arch.outputs.arch_contains_arm64 }}
arch_contains_riscv=${{ steps.get-arch.outputs.arch_contains_riscv }}
arch_contains_sim=${{ steps.get-arch.outputs.arch_contains_sim }}
arch_contains_x86_64=${{ steps.get-arch.outputs.arch_contains_x86_64 }}
arch_contains_xtensa=${{ steps.get-arch.outputs.arch_contains_xtensa }}
labels_contain_size=${{ steps.get-arch.outputs.labels_contain_size }}
numlabels=${{ steps.get-arch.outputs.numlabels }}
board_contains_arm=${{ steps.get-arch.outputs.board_contains_arm }}
board_contains_arm64=${{ steps.get-arch.outputs.board_contains_arm64 }}
board_contains_riscv=${{ steps.get-arch.outputs.board_contains_riscv }}
board_contains_sim=${{ steps.get-arch.outputs.board_contains_sim }}
board_contains_x86_64=${{ steps.get-arch.outputs.board_contains_x86_64 }}
board_contains_xtensa=${{ steps.get-arch.outputs.board_contains_xtensa }}
# inputs.boards is a JSON Array: ["arm-01", "risc-v-01", "xtensa-01", ...]
# We compact and remove the newlines
boards=$( echo '${{ inputs.boards }}' | jq --compact-output ".")
numboards=$( echo "$boards" | jq "length" )
# We consider only PRs with 2 labels, including size
if [[ "$numlabels" != "2" || "$labels_contain_size" != "1" ]]; then
# We consider only Simple PRs with:
# Arch + Size Labels Only
# Board + Size Labels Only
# Arch + Board + Size Labels Only
if [[ "$labels_contain_size" != "1" ]]; then
echo "Size Label Missing, will build all targets"
quit=1
elif [[ "$numlabels" == "2" && "$labels_contain_arch" == "1" ]]; then
echo "Arch + Size Labels Only"
elif [[ "$numlabels" == "2" && "$labels_contain_board" == "1" ]]; then
echo "Board + Size Labels Only"
elif [[ "$numlabels" == "3" && "$labels_contain_arch" == "1" && "$labels_contain_board" == "1" ]]; then
# Arch and Board must be the same
if [[
"$arch_contains_arm" != "$board_contains_arm" ||
"$arch_contains_arm64" != "$board_contains_arm64" ||
"$arch_contains_riscv" != "$board_contains_riscv" ||
"$arch_contains_sim" != "$board_contains_sim" ||
"$arch_contains_x86_64" != "$board_contains_x86_64" ||
"$arch_contains_xtensa" != "$board_contains_xtensa"
]]; then
echo "Arch and Board are not the same, will build all targets"
quit=1
else
echo "Arch + Board + Size Labels Only"
fi
else
echo "Not a Simple PR, will build all targets"
quit=1
fi
# If Not a Simple PR: Build all targets
if [[ "$quit" == "1" ]]; then
echo "selected_builds=$boards" | tee -a $GITHUB_OUTPUT
exit
fi
Expand All @@ -100,38 +164,38 @@ jobs:
board=$( echo "$boards" | jq ".[$i]" )
skip_build=0
# For "Arch: arm": Build arm-01, arm-02, ...
if [[ "$arch_contains_arm" == "1" ]]; then
# For "Arch / Board: arm": Build arm-01, arm-02, ...
if [[ "$arch_contains_arm" == "1" || "$board_contains_arm" == "1" ]]; then
if [[ "$board" != *"arm"* ]]; then
skip_build=1
fi
# For "Arch: arm64": Build other
elif [[ "$arch_contains_arm64" == "1" ]]; then
# For "Arch / Board: arm64": Build other
elif [[ "$arch_contains_arm64" == "1" || "$board_contains_arm64" == "1" ]]; then
if [[ "$board" != *"other"* ]]; then
skip_build=1
fi
# For "Arch: risc-v": Build risc-v-01, risc-v-02
elif [[ "$arch_contains_riscv" == "1" ]]; then
# For "Arch / Board: risc-v": Build risc-v-01, risc-v-02
elif [[ "$arch_contains_riscv" == "1" || "$board_contains_riscv" == "1" ]]; then
if [[ "$board" != *"risc-v"* ]]; then
skip_build=1
fi
# For "Arch: simulator": Build sim-01, sim-02
elif [[ "$arch_contains_sim" == "1" ]]; then
# For "Arch / Board: simulator": Build sim-01, sim-02
elif [[ "$arch_contains_sim" == "1" || "$board_contains_sim" == "1" ]]; then
if [[ "$board" != *"sim"* ]]; then
skip_build=1
fi

# For "Arch: x86_64": Build other
elif [[ "$arch_contains_x86_64" == "1" ]]; then
# For "Arch / Board: x86_64": Build other
elif [[ "$arch_contains_x86_64" == "1" || "$board_contains_x86_64" == "1" ]]; then
if [[ "$board" != *"other"* ]]; then
skip_build=1
fi

# For "Arch: xtensa": Build xtensa-01, xtensa-02
elif [[ "$arch_contains_xtensa" == "1" ]]; then
# For "Arch / Board: xtensa": Build xtensa-01, xtensa-02
elif [[ "$arch_contains_xtensa" == "1" || "$board_contains_xtensa" == "1" ]]; then
if [[ "$board" != *"xtensa"* ]]; then
skip_build=1
fi
Expand Down
59 changes: 57 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,11 @@ jobs:
[
"arm-01", "other", "risc-v-01", "sim-01", "xtensa-01",
"arm-02", "risc-v-02", "sim-02", "xtensa-02",
"arm-03", "arm-04", "arm-05", "arm-06", "arm-07", "arm-08", "arm-09", "arm-10", "arm-11", "arm-12", "arm-13"
"arm-03", "risc-v-03",
"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"
]
# Run the selected Linux Builds
Expand Down Expand Up @@ -324,10 +328,61 @@ jobs:
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
./cibuild.sh -g -i -A -C -N -R testlist/${{matrix.boards}}.dat
./cibuild.sh -g -i -A -C -R testlist/${{matrix.boards}}.dat
- uses: actions/upload-artifact@v4
with:
name: msys2-${{matrix.boards}}-builds
path: buildartifacts/
continue-on-error: true

# 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
4 changes: 3 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ jobs:
- name: Check Pull Request
run: |
echo "::add-matcher::nuttx/.github/nxstyle.json"
pip install cmake-format
python3 -m venv .venv
source .venv/bin/activate
pip install cmake-format black isort flake8
cd nuttx
commits="${{ github.event.pull_request.base.sha }}..HEAD"
git log --oneline $commits
Expand Down
Loading

0 comments on commit 35f6f61

Please sign in to comment.