From bd2694c848985c94c8003fc960f9bd1e01562005 Mon Sep 17 00:00:00 2001 From: xuxin19 Date: Tue, 8 Oct 2024 12:20:05 +0800 Subject: [PATCH] build ci:add msvc windows native ci workflow Signed-off-by: xuxin19 --- .github/workflows/build.yml | 51 +++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e7898d80f71b0..546c121826db4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -331,3 +331,54 @@ jobs: 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: Linux + 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 \ No newline at end of file