diff --git a/.github/matrix_includes_buildmgr.json b/.github/matrix_includes_buildmgr.json index 13a062f13..16f037672 100644 --- a/.github/matrix_includes_buildmgr.json +++ b/.github/matrix_includes_buildmgr.json @@ -2,6 +2,7 @@ { "runs_on":"macos-10.15", "target":"darwin64", + "arch": "amd64", "binary_extension":".mac", "installer_name": "gcc-arm-none-eabi-10-2020-q4-major-mac.tar.bz2", "runOn": "publicRepo" @@ -9,6 +10,15 @@ { "runs_on":"ubuntu-20.04", "target":"linux64", + "arch": "amd64", + "binary_extension":".lin", + "installer_name": "gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2", + "runOn": "always" + }, + { + "runs_on":"ubuntu-20.04", + "target":"linux64", + "arch": "aarch64", "binary_extension":".lin", "installer_name": "gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2", "runOn": "always" @@ -16,6 +26,7 @@ { "runs_on":"windows-2019", "target":"windows64", + "arch": "amd64", "binary_extension":".exe", "installer_name": "gcc-arm-none-eabi-10-2020-q4-major-win32.zip", "runOn": "always" diff --git a/.github/matrix_includes_packchk.json b/.github/matrix_includes_packchk.json index 0f448bc08..452255816 100644 --- a/.github/matrix_includes_packchk.json +++ b/.github/matrix_includes_packchk.json @@ -2,16 +2,25 @@ { "runs_on":"macos-10.15", "target":"darwin64", + "arch": "amd64", "runOn": "publicRepo" }, { "runs_on":"ubuntu-20.04", "target":"linux64", + "arch": "amd64", + "runOn": "always" + }, + { + "runs_on":"ubuntu-20.04", + "target":"linux64", + "arch": "aarch64", "runOn": "always" }, { "runs_on":"windows-2019", "target":"windows64", + "arch": "amd64", "runOn": "always" } ] diff --git a/.github/matrix_includes_packgen.json b/.github/matrix_includes_packgen.json index 50f130a3b..eb8881518 100644 --- a/.github/matrix_includes_packgen.json +++ b/.github/matrix_includes_packgen.json @@ -2,18 +2,28 @@ { "runs_on":"macos-10.15", "target":"darwin64", + "arch": "amd64", "binary": "packgen", "runOn": "publicRepo" }, { "runs_on":"ubuntu-20.04", "target":"linux64", + "arch": "amd64", + "binary": "packgen", + "runOn": "always" + }, + { + "runs_on":"ubuntu-20.04", + "target":"linux64", + "arch": "aarch64", "binary": "packgen", "runOn": "always" }, { "runs_on":"windows-2019", "target":"windows64", + "arch": "amd64", "binary": "packgen.exe", "runOn": "always" } diff --git a/.github/matrix_includes_projmgr.json b/.github/matrix_includes_projmgr.json index 98231930c..71a69d082 100644 --- a/.github/matrix_includes_projmgr.json +++ b/.github/matrix_includes_projmgr.json @@ -2,18 +2,28 @@ { "runs_on":"macos-10.15", "target":"darwin64", + "arch": "amd64", "binary": "csolution", "runOn": "publicRepo" }, { "runs_on":"ubuntu-20.04", "target":"linux64", + "arch": "amd64", + "binary": "csolution", + "runOn": "always" + }, + { + "runs_on":"ubuntu-20.04", + "target":"linux64", + "arch": "aarch64", "binary": "csolution", "runOn": "always" }, { "runs_on":"windows-2019", "target":"windows64", + "arch": "amd64", "binary": "csolution.exe", "runOn": "always" } diff --git a/.github/matrix_includes_test_libs.json b/.github/matrix_includes_test_libs.json index 0f448bc08..452255816 100644 --- a/.github/matrix_includes_test_libs.json +++ b/.github/matrix_includes_test_libs.json @@ -2,16 +2,25 @@ { "runs_on":"macos-10.15", "target":"darwin64", + "arch": "amd64", "runOn": "publicRepo" }, { "runs_on":"ubuntu-20.04", "target":"linux64", + "arch": "amd64", + "runOn": "always" + }, + { + "runs_on":"ubuntu-20.04", + "target":"linux64", + "arch": "aarch64", "runOn": "always" }, { "runs_on":"windows-2019", "target":"windows64", + "arch": "amd64", "runOn": "always" } ] diff --git a/.github/matrix_includes_toolbox.json b/.github/matrix_includes_toolbox.json index 0f448bc08..452255816 100644 --- a/.github/matrix_includes_toolbox.json +++ b/.github/matrix_includes_toolbox.json @@ -2,16 +2,25 @@ { "runs_on":"macos-10.15", "target":"darwin64", + "arch": "amd64", "runOn": "publicRepo" }, { "runs_on":"ubuntu-20.04", "target":"linux64", + "arch": "amd64", + "runOn": "always" + }, + { + "runs_on":"ubuntu-20.04", + "target":"linux64", + "arch": "aarch64", "runOn": "always" }, { "runs_on":"windows-2019", "target":"windows64", + "arch": "amd64", "runOn": "always" } ] diff --git a/.github/workflows/buildmgr.yml b/.github/workflows/buildmgr.yml index 359193a14..179ab5d07 100644 --- a/.github/workflows/buildmgr.yml +++ b/.github/workflows/buildmgr.yml @@ -48,49 +48,18 @@ jobs: fail-fast: true matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }} steps: - - name: Install macos deps - if: ${{ startsWith(matrix.runs_on, 'macos') }} - run: | - brew install \ - ninja - - - name: Install linux deps - if: ${{ startsWith(matrix.runs_on, 'ubuntu') }} - run: | - sudo apt update - sudo apt-get install \ - bc \ - build-essential \ - ninja-build - - - name: Install windows deps - if: ${{ startsWith(matrix.runs_on, 'windows') }} - run: choco install -y ninja - - name: Checkout devtools uses: actions/checkout@v2 with: submodules: true - - name: Create build folder - run: mkdir build - - - name: Configure windows build for amd64 - if: ${{ startsWith(matrix.runs_on, 'windows') }} - uses: ilammy/msvc-dev-cmd@v1 + # https://github.com/Arm-Debug/mcu-build-action + - name: Build + uses: Arm-Debug/mcu-build-action@v1.1 + id: mcu-build with: - arch: amd64 - - - uses: ammaraskar/gcc-problem-matcher@master - if: ${{ startsWith(matrix.runs_on, 'macos') || startsWith(matrix.runs_on, 'ubuntu') }} - - uses: ammaraskar/msvc-problem-matcher@master - if: ${{ startsWith(matrix.runs_on, 'windows') }} - - - name: Build cbuildgen - run: | - cmake -G Ninja -DCMAKE_BUILD_TYPE=Release .. - cmake --build . --target cbuildgen - working-directory: ./build + target: cbuildgen + arch: ${{ matrix.arch }} - name: Rename binary to be integrated to the installer if: ${{ startsWith(matrix.runs_on, 'macos') || startsWith(matrix.runs_on, 'ubuntu') }} @@ -103,7 +72,7 @@ jobs: - name: Archive cbuildgen uses: actions/upload-artifact@v2 with: - name: cbuildgen-${{ matrix.target }} + name: cbuildgen-${{ matrix.target }}-${{ matrix.arch }} path: ./build/tools/buildmgr/cbuildgen/${{ matrix.target }}/Release/cbuildgen${{ matrix.binary_extension }} retention-days: 1 if-no-files-found: error @@ -224,20 +193,20 @@ jobs: - name: Download cbuildgen linux uses: actions/download-artifact@v2 with: - name: cbuildgen-linux64 + name: cbuildgen-linux64-amd64 path: tools/buildmgr/cbuildgen/distribution/bin/ - name: Download cbuildgen macos if: ${{ !github.event.repository.private }} uses: actions/download-artifact@v2 with: - name: cbuildgen-darwin64 + name: cbuildgen-darwin64-amd64 path: tools/buildmgr/cbuildgen/distribution/bin/ - name: Download cbuildgen windows uses: actions/download-artifact@v2 with: - name: cbuildgen-windows64 + name: cbuildgen-windows64-amd64 path: tools/buildmgr/cbuildgen/distribution/bin/ - name: Adding execution permission to the binaries @@ -322,8 +291,6 @@ jobs: run: | sudo apt update sudo apt-get install \ - bc \ - build-essential \ dos2unix \ ninja-build \ libxml2-utils @@ -338,7 +305,7 @@ jobs: submodules: true - name: Setup ARM GCC for Ubuntu and macOS - if: ${{ startsWith(matrix.runs_on, 'ubuntu') || startsWith(matrix.runs_on, 'macos') }} + if: ${{ startsWith(matrix.runs_on, 'macos') || ( startsWith(matrix.runs_on, 'ubuntu') && matrix.arch == 'amd64' ) }} env: installer_name: ${{ matrix.installer_name }} run: | @@ -363,20 +330,6 @@ jobs: key: ${{ env.CACHE_NAME }}-${{ matrix.runs_on }} path: ${{ env.CI_PACK_ROOT }} - - name: Create build folder - run: mkdir build - - - name: Configure windows build for amd64 - if: ${{ startsWith(matrix.runs_on, 'windows') }} - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: amd64 - - - uses: ammaraskar/gcc-problem-matcher@master - if: ${{ startsWith(matrix.runs_on, 'macos') || startsWith(matrix.runs_on, 'ubuntu') }} - - uses: ammaraskar/msvc-problem-matcher@master - if: ${{ startsWith(matrix.runs_on, 'windows') }} - - name: Download cbuild_install uses: actions/download-artifact@v2 with: @@ -393,49 +346,42 @@ jobs: if: ${{ startsWith(matrix.runs_on, 'macos') || startsWith(matrix.runs_on, 'ubuntu') }} run: chmod +x cbuild_install.sh + # https://github.com/Arm-Debug/mcu-build-action - name: Build CbuildUnitTests - run: | - cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug .. - cmake --build . --target CbuildUnitTests - working-directory: build - - - name: Run CbuildUnitTests (for macOS and Ubuntu) - if: ${{ startsWith(matrix.runs_on, 'macos') || startsWith(matrix.runs_on, 'ubuntu') }} - env: - target: ${{ matrix.target }} - run: ./tools/buildmgr/test/unittests/${target}/Debug/CbuildUnitTests --gtest_output=xml:unittest_report_${target}.xml - working-directory: build + uses: Arm-Debug/mcu-build-action@v1.1 + with: + target: CbuildUnitTests + build_type: Debug + arch: ${{ matrix.arch }} - - name: Run CbuildUnitTests (for Windows) - if: ${{ startsWith(matrix.runs_on, 'windows') }} - env: - target: ${{ matrix.target }} - # For some reason, the env variable usage $Env:target does not work properly. - run: .\tools\buildmgr\test\unittests\windows64\Debug\CbuildUnitTests.exe --gtest_output=xml:unittest_report_windows64.xml + - name: Run CbuildUnitTests + run: ctest -V -R CbuildUnitTests working-directory: build - name: Archive unittest uses: actions/upload-artifact@v2 with: - name: unittest_report_${{ matrix.target }} - path: build/unittest_report_${{ matrix.target }}.xml + name: unittest_report_${{ matrix.target }}_${{ matrix.arch }} + path: build/cbuildunit_test_report.xml retention-days: 1 if-no-files-found: error - name: Publish Cbuild Unittest Results uses: mikepenz/action-junit-report@v2 with: - check_name: "Cbuild Unittests [${{ matrix.target }}]" - report_paths: build/unittest_report_${{ matrix.target }}.xml + check_name: "Cbuild Unittests [${{ matrix.target }}_${{ matrix.arch }}]" + report_paths: build/cbuildunit_test_report.xml - - name: Build Cbuild Integration Tests - run: | - cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug .. - cmake --build . --target CbuildIntegTests - working-directory: build + # https://github.com/Arm-Debug/mcu-build-action + - name: Build CbuildIntegTests + uses: Arm-Debug/mcu-build-action@v1.1 + with: + target: CbuildIntegTests + build_type: Debug + arch: ${{ matrix.arch }} - - name: Run Cbuild Integration Tests (excl. AC5, AC6, MultiTargetAC6Tests) for Linux - if: ${{ startsWith(matrix.runs_on, 'ubuntu') }} + - name: Run Cbuild Integration Tests (excl. AC5, AC6, MultiTargetAC6Tests) for Linux amd64 + if: ${{ startsWith(matrix.runs_on, 'ubuntu') && matrix.arch == 'amd64' }} env: target: ${{ matrix.target }} run: ./tools/buildmgr/test/integrationtests/${target}/Debug/CbuildIntegTests --gtest_filter=-*AC5*:*AC6*:*MultiTargetAC6Tests* --gtest_output=xml:integtest_report_${target}.xml @@ -457,17 +403,19 @@ jobs: working-directory: build - name: Archive Cbuild Integration Tests + if: ${{ matrix.arch == 'amd64' }} uses: actions/upload-artifact@v2 with: - name: integtest_report_${{ matrix.target }} + name: integtest_report_${{ matrix.target }}_${{ matrix.arch }} path: build/integtest_report_${{ matrix.target }}.xml retention-days: 1 if-no-files-found: error - name: Publish Cbuild Integration Test Results + if: ${{ matrix.arch == 'amd64' }} uses: mikepenz/action-junit-report@v2 with: - check_name: "Cbuild Integration Tests [${{ matrix.target }}]" + check_name: "Cbuild Integration Tests [${{ matrix.target }}-${{ matrix.arch }}]" report_paths: build/integtest_report_${{ matrix.target }}.xml sanity-check-native: @@ -494,6 +442,7 @@ jobs: run: chmod +x cbuild_install.sh - name: Run cbuild_install.sh + if: ${{ matrix.arch == 'amd64' }} shell: bash run: | echo "${{ github.workspace }}/cbuild" > config @@ -504,6 +453,7 @@ jobs: ./cbuild_install.sh < config - name: Test cbuildgen + if: ${{ matrix.arch == 'amd64' }} shell: bash run: | ${{ github.workspace }}/cbuild/bin/cbuildgen | grep "(cbuildgen): Build Process Manager" diff --git a/.github/workflows/packchk.yml b/.github/workflows/packchk.yml index ee192b68a..f61d164ad 100644 --- a/.github/workflows/packchk.yml +++ b/.github/workflows/packchk.yml @@ -43,53 +43,20 @@ jobs: fail-fast: true matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }} steps: - - name: Install macos deps - if: ${{ startsWith(matrix.runs_on, 'macos') }} - run: | - brew install \ - ninja - - - name: Install linux deps - if: ${{ startsWith(matrix.runs_on, 'ubuntu') }} - run: | - sudo apt update - sudo apt-get install \ - bc \ - build-essential \ - ninja-build - - - name: Install windows deps - if: ${{ startsWith(matrix.runs_on, 'windows') }} - run: choco install -y ninja - - name: Checkout devtools uses: actions/checkout@v2 with: submodules: recursive - - name: Create build folder - run: | - mkdir build - - - name: Configure windows build for amd64 - if: ${{ startsWith(matrix.runs_on, 'windows') }} - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: amd64 - - - uses: ammaraskar/gcc-problem-matcher@master - if: ${{ startsWith(matrix.runs_on, 'macos') || startsWith(matrix.runs_on, 'ubuntu') }} - - uses: ammaraskar/msvc-problem-matcher@master - if: ${{ startsWith(matrix.runs_on, 'windows') }} - + # https://github.com/Arm-Debug/mcu-build-action - name: Build packchk - run: | - cmake -G Ninja -DCMAKE_BUILD_TYPE=Release .. - cmake --build . --target packchkdist - working-directory: ./build + uses: Arm-Debug/mcu-build-action@v1.1 + with: + target: packchkdist + arch: ${{ matrix.arch }} - - name: Attach installer to release - if: ${{ github.event_name == 'release' }} + - name: Attach installer to amd64 binaries release + if: ${{ github.event_name == 'release' && matrix.arch == 'amd64' }} uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} @@ -106,69 +73,48 @@ jobs: fail-fast: false matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }} steps: - - name: Install macos deps - if: ${{ startsWith(matrix.runs_on, 'macos') }} - run: | - brew install \ - ninja - - - name: Install linux deps - if: ${{ startsWith(matrix.runs_on, 'ubuntu') }} - run: | - sudo apt update - sudo apt-get install \ - bc \ - build-essential \ - ninja-build - - - name: Install windows deps - if: ${{ startsWith(matrix.runs_on, 'windows') }} - run: choco install -y ninja - - name: Checkout devtools uses: actions/checkout@v2 with: submodules: recursive - - name: Create build folder - run: | - mkdir build - - - name: Configure windows build for amd64 - if: ${{ startsWith(matrix.runs_on, 'windows') }} - uses: ilammy/msvc-dev-cmd@v1 + # https://github.com/Arm-Debug/mcu-build-action + - name: Build PackChkUnitTests + uses: Arm-Debug/mcu-build-action@v1.1 with: - arch: amd64 - - - uses: ammaraskar/gcc-problem-matcher@master - if: ${{ startsWith(matrix.runs_on, 'macos') || startsWith(matrix.runs_on, 'ubuntu') }} - - uses: ammaraskar/msvc-problem-matcher@master - if: ${{ startsWith(matrix.runs_on, 'windows') }} + arch: ${{ matrix.arch }} + build_type: Debug + target: PackChkUnitTests - - name: Build and run packchk unit tests + - name: Run packchk unit tests run: | - cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug .. - cmake --build . --target PackChkUnitTests ctest -V -R PackChkUnitTests working-directory: ./build - - name: Build and run packchk integ tests + # https://github.com/Arm-Debug/mcu-build-action + - name: Build PackChkIntegTests + uses: Arm-Debug/mcu-build-action@v1.1 + with: + arch: ${{ matrix.arch }} + build_type: Debug + target: PackChkIntegTests + + - name: Run packchk integ tests run: | - cmake --build . --target PackChkIntegTests ctest -V -R PackChkIntegTests working-directory: ./build - name: Archive unit test results uses: actions/upload-artifact@v2 with: - name: unit_test_result-${{ matrix.target }} + name: unit_test_result-${{ matrix.target }}-${{ matrix.arch }} path: ./build/test_reports/packchkunittest-*.xml if-no-files-found: error - name: Archive integration test results uses: actions/upload-artifact@v2 with: - name: integ_test_result-${{ matrix.target }} + name: integ_test_result-${{ matrix.target }}-${{ matrix.arch }} path: ./build/test_reports/packchkintegtest-*.xml if-no-files-found: error @@ -184,9 +130,6 @@ jobs: run: | sudo apt update sudo apt-get install \ - bc \ - build-essential \ - ninja-build \ lcov - name: Checkout devtools @@ -194,16 +137,28 @@ jobs: with: submodules: recursive - - name: Create build folder - run: mkdir build + # https://github.com/Arm-Debug/mcu-build-action + - name: Build PackChkIntegTests + uses: Arm-Debug/mcu-build-action@v1.1 + with: + add_cmake_variables: -DCOVERAGE=ON + arch: amd64 + build_type: Debug + target: PackChkIntegTests - - name: Build and run packchk tests + # https://github.com/Arm-Debug/mcu-build-action + - name: Build PackChkUnitTests + uses: Arm-Debug/mcu-build-action@v1.1 + with: + add_cmake_variables: -DCOVERAGE=ON + arch: amd64 + build_type: Debug + target: PackChkUnitTests + + - name: Run packchk tests run: | - cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCOVERAGE=ON .. - cmake --build . --target PackChkIntegTests - ctest -V -C Debug -R PackChkIntegTests - cmake --build . --target PackChkUnitTests ctest -V -C Debug -R PackChkUnitTests + ctest -V -C Debug -R PackChkIntegTests working-directory: ./build - name: Generate coverage report @@ -279,39 +234,39 @@ jobs: - name: Download unit test report windows uses: actions/download-artifact@v2 with: - name: unit_test_result-windows64 + name: unit_test_result-windows64-amd64 path: testreports/ - - name: Download unit test report linux + - name: Download unit test report linux amd64 uses: actions/download-artifact@v2 with: - name: unit_test_result-linux64 + name: unit_test_result-linux64-amd64 path: testreports/ - name: Download unit test report macos if: ${{ !github.event.repository.private }} uses: actions/download-artifact@v2 with: - name: unit_test_result-darwin64 + name: unit_test_result-darwin64-amd64 path: testreports/ - name: Download integ test report windows uses: actions/download-artifact@v2 with: - name: integ_test_result-windows64 + name: integ_test_result-windows64-amd64 path: testreports/ - - name: Download integ test report linux + - name: Download integ test report linux amd64 uses: actions/download-artifact@v2 with: - name: integ_test_result-linux64 + name: integ_test_result-linux64-amd64 path: testreports/ - name: Download integ test report macos if: ${{ !github.event.repository.private }} uses: actions/download-artifact@v2 with: - name: integ_test_result-darwin64 + name: integ_test_result-darwin64-amd64 path: testreports/ - name: Event File diff --git a/.github/workflows/packgen.yml b/.github/workflows/packgen.yml index 9ef4a1ab1..350441326 100644 --- a/.github/workflows/packgen.yml +++ b/.github/workflows/packgen.yml @@ -39,54 +39,23 @@ jobs: fail-fast: true matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }} steps: - - name: Install macos deps - if: ${{ startsWith(matrix.runs_on, 'macos') }} - run: | - brew install \ - ninja - - - name: Install linux deps - if: ${{ startsWith(matrix.runs_on, 'ubuntu') }} - run: | - sudo apt update - sudo apt-get install \ - bc \ - build-essential \ - ninja-build - - - name: Install windows deps - if: ${{ startsWith(matrix.runs_on, 'windows') }} - run: choco install -y ninja - - name: Checkout devtools uses: actions/checkout@v2 with: submodules: true - - name: Create build folder - run: mkdir build - - - name: Configure windows build for amd64 - if: ${{ startsWith(matrix.runs_on, 'windows') }} - uses: ilammy/msvc-dev-cmd@v1 + # https://github.com/Arm-Debug/mcu-build-action + - name: Build + uses: Arm-Debug/mcu-build-action@v1.1 + id: mcu-build with: - arch: amd64 - - - uses: ammaraskar/gcc-problem-matcher@master - if: ${{ startsWith(matrix.runs_on, 'macos') || startsWith(matrix.runs_on, 'ubuntu') }} - - uses: ammaraskar/msvc-problem-matcher@master - if: ${{ startsWith(matrix.runs_on, 'windows') }} - - - name: Build packgen - run: | - cmake -G Ninja -DCMAKE_BUILD_TYPE=Release .. - cmake --build . --target packgen - working-directory: ./build + target: packgen + arch: ${{ matrix.arch }} - name: Archive packgen uses: actions/upload-artifact@v2 with: - name: packgen-${{ matrix.target }} + name: packgen-${{ matrix.target }}-${{ matrix.arch }} path: ./build/tools/packgen/${{ matrix.target }}/Release/${{ matrix.binary }} retention-days: 1 if-no-files-found: error @@ -111,22 +80,22 @@ jobs: cp -r tools/packgen/test/data/CMakeTestProject/ tools/packgen/distribution/doc/examples/ cp -r tools/packgen/test/data/CMakeTestMultipleBuilds/ tools/packgen/distribution/doc/examples/ - - name: Download packgen linux + - name: Download packgen linux amd64 uses: actions/download-artifact@v2 with: - name: packgen-linux64 + name: packgen-linux64-amd64 path: tools/packgen/distribution/bin/linux64/ - - name: Download packgen macos + - name: Download packgen macos amd64 uses: actions/download-artifact@v2 with: - name: packgen-darwin64 + name: packgen-darwin64-amd64 path: tools/packgen/distribution/bin/darwin64/ - - name: Download packgen windows + - name: Download packgen windows amd64 uses: actions/download-artifact@v2 with: - name: packgen-windows64 + name: packgen-windows64-amd64 path: tools/packgen/distribution/bin/windows64/ - name: Zip distribution folder @@ -150,62 +119,35 @@ jobs: fail-fast: true matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }} steps: - - name: Install macos deps - if: ${{ startsWith(matrix.runs_on, 'macos') }} - run: | - brew install \ - ninja - - - name: Install linux deps - if: ${{ startsWith(matrix.runs_on, 'ubuntu') }} - run: | - sudo apt update - sudo apt-get install \ - bc \ - build-essential \ - ninja-build - - - name: Install windows deps - if: ${{ startsWith(matrix.runs_on, 'windows') }} - run: choco install -y ninja - - name: Checkout devtools uses: actions/checkout@v2 with: submodules: true - - name: Create build folder - run: mkdir build - - - name: Configure windows build for amd64 - if: ${{ startsWith(matrix.runs_on, 'windows') }} - uses: ilammy/msvc-dev-cmd@v1 + # https://github.com/Arm-Debug/mcu-build-action + - name: Build PackGenUnitTests + uses: Arm-Debug/mcu-build-action@v1.1 with: - arch: amd64 - - - uses: ammaraskar/gcc-problem-matcher@master - if: ${{ startsWith(matrix.runs_on, 'macos') || startsWith(matrix.runs_on, 'ubuntu') }} - - uses: ammaraskar/msvc-problem-matcher@master - if: ${{ startsWith(matrix.runs_on, 'windows') }} + target: PackGenUnitTests + build_type: Debug + arch: ${{ matrix.arch }} - - name: Build and run packgen unit tests + - name: Run packgen unit tests run: | - cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug .. - cmake --build . --target PackGenUnitTests ctest -C Debug -R PackGenUnitTests working-directory: ./build - name: Archive unit tests results + if: ${{ always() }} uses: actions/upload-artifact@v2 with: - name: unittest-${{ matrix.target }} + name: unittest-${{ matrix.target }}-${{ matrix.arch }} path: ./build/packgenunit_test_report.xml retention-days: 1 if-no-files-found: error - if: ${{ always() }} - name: Publish packgen unit test results uses: mikepenz/action-junit-report@v2 with: - check_name: "Packgen unit tests [${{ matrix.target }}]" + check_name: "Packgen unit tests [${{ matrix.target }}-${{ matrix.arch }}]" report_paths: build/packgenunit_test_report.xml diff --git a/.github/workflows/projmgr.yml b/.github/workflows/projmgr.yml index 5095554bd..e1f539ade 100644 --- a/.github/workflows/projmgr.yml +++ b/.github/workflows/projmgr.yml @@ -51,103 +51,73 @@ jobs: matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }} steps: - - name: Install macos deps - if: ${{ startsWith(matrix.runs_on, 'macos') }} - run: | - brew install \ - ninja \ - python \ - swig - - - name: Install linux deps - if: ${{ startsWith(matrix.runs_on, 'ubuntu') }} - run: | - sudo apt update - sudo apt-get install \ - bc \ - build-essential \ - ninja-build \ - python-dev \ - swig - - - name: Install windows deps - if: ${{ startsWith(matrix.runs_on, 'windows') }} - run: choco install -y ninja python swig - - name: Checkout devtools uses: actions/checkout@v2 with: submodules: true - - name: Create build folders - run: | - mkdir build - mkdir buildswig - - - name: Configure windows build for amd64 - if: ${{ startsWith(matrix.runs_on, 'windows') }} - uses: ilammy/msvc-dev-cmd@v1 + # https://github.com/Arm-Debug/mcu-build-action + - name: Build + uses: Arm-Debug/mcu-build-action@v1.1 with: - arch: amd64 - - - uses: ammaraskar/gcc-problem-matcher@master - if: ${{ startsWith(matrix.runs_on, 'macos') || startsWith(matrix.runs_on, 'ubuntu') }} - - uses: ammaraskar/msvc-problem-matcher@master - if: ${{ startsWith(matrix.runs_on, 'windows') }} - - - name: Build projmgr - run: | - cmake -G Ninja -DCMAKE_BUILD_TYPE=Release .. - cmake --build . --target projmgr - working-directory: ./build + target: projmgr + arch: ${{ matrix.arch }} - name: Archive projmgr uses: actions/upload-artifact@v2 with: - name: projmgr-${{ matrix.target }} + name: projmgr-${{ matrix.target }}-${{ matrix.arch }} path: ./build/tools/projmgr/${{ matrix.target }}/Release/${{ matrix.binary }} retention-days: 1 if-no-files-found: error - - name: Build projmgr swig libs windows + # https://github.com/Arm-Debug/mcu-build-action + - name: Build swig libs windows if: ${{ startsWith(matrix.runs_on, 'windows') }} - run: | - cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DSWIG_LIBS=ON .. - cmake --build . --target projmgr-python --config Release - working-directory: ./buildswig + uses: Arm-Debug/mcu-build-action@v1.1 + with: + add_cmake_variables: -DSWIG_LIBS=ON + add_cmake_build_args: --config Release + arch: ${{ matrix.arch }} + build_folder: buildswig + target: projmgr-python - - name: Build projmgr swig libs macos ubuntu - if: ${{ startsWith(matrix.runs_on, 'macos') || startsWith(matrix.runs_on, 'ubuntu') }} - run: | - cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DSWIG_LIBS=ON .. - cmake --build . --target projmgr-python projmgr-go --config Release - working-directory: ./buildswig + # https://github.com/Arm-Debug/mcu-build-action + - name: Build swig libs macos and ubuntu amd64 + if: ${{ startsWith(matrix.runs_on, 'macos') || ( startsWith(matrix.runs_on, 'ubuntu') && matrix.arch == 'amd64' ) }} + uses: Arm-Debug/mcu-build-action@v1.1 + with: + add_cmake_variables: -DSWIG_LIBS=ON + add_cmake_build_args: --config Release + arch: ${{ matrix.arch }} + build_folder: buildswig + target: projmgr-python projmgr-go - name: Archive projmgr swig python libs windows if: ${{ startsWith(matrix.runs_on, 'windows') }} uses: actions/upload-artifact@v2 with: - name: projmgr-swig-python-${{ matrix.target }} + name: projmgr-swig-python-${{ matrix.target }}-${{ matrix.arch }} path: | ./buildswig/tools/projmgr/swig/python/projmgr.py ./buildswig/tools/projmgr/swig/python/_projmgr.pyd retention-days: 1 - - name: Archive projmgr swig python libs macos ubuntu - if: ${{ startsWith(matrix.runs_on, 'macos') || startsWith(matrix.runs_on, 'ubuntu') }} + - name: Archive projmgr swig python libs macos ubuntu amd64 + if: ${{ startsWith(matrix.runs_on, 'macos') || ( startsWith(matrix.runs_on, 'ubuntu') && matrix.arch == 'amd64' ) }} uses: actions/upload-artifact@v2 with: - name: projmgr-swig-python-${{ matrix.target }} + name: projmgr-swig-python-${{ matrix.target }}-${{ matrix.arch }} path: | ./buildswig/tools/projmgr/swig/python/projmgr.py ./buildswig/tools/projmgr/swig/python/_projmgr.so retention-days: 1 - - name: Archive projmgr swig go libs macos ubuntu - if: ${{ startsWith(matrix.runs_on, 'macos') || startsWith(matrix.runs_on, 'ubuntu') }} + - name: Archive projmgr swig go libs macos ubuntu amd64 + if: ${{ startsWith(matrix.runs_on, 'macos') || ( startsWith(matrix.runs_on, 'ubuntu') && matrix.arch == 'amd64' ) }} uses: actions/upload-artifact@v2 with: - name: projmgr-swig-go-${{ matrix.target }} + name: projmgr-swig-go-${{ matrix.target }}-${{ matrix.arch }} path: | ./buildswig/tools/projmgr/swig/go/projmgr.go ./buildswig/tools/projmgr/swig/go/projmgr.so @@ -173,54 +143,54 @@ jobs: cp -r tools/projmgr/schemas/* tools/projmgr/distribution/etc/ cp -r tools/projmgr/templates/* tools/projmgr/distribution/etc/ - - name: Download projmgr linux + - name: Download projmgr linux amd64 uses: actions/download-artifact@v2 with: - name: projmgr-linux64 + name: projmgr-linux64-amd64 path: tools/projmgr/distribution/bin/linux64/ - - name: Download projmgr macos + - name: Download projmgr macos amd64 uses: actions/download-artifact@v2 with: - name: projmgr-darwin64 + name: projmgr-darwin64-amd64 path: tools/projmgr/distribution/bin/darwin64/ - - name: Download projmgr windows + - name: Download projmgr windows amd64 uses: actions/download-artifact@v2 with: - name: projmgr-windows64 + name: projmgr-windows64-amd64 path: tools/projmgr/distribution/bin/windows64/ - name: Download projmgr-swig-python linux uses: actions/download-artifact@v2 with: - name: projmgr-swig-python-linux64 + name: projmgr-swig-python-linux64-amd64 path: tools/projmgr/distribution/lib/linux64/python/ - name: Download projmgr-swig-python macos if: ${{ !github.event.repository.private }} uses: actions/download-artifact@v2 with: - name: projmgr-swig-python-darwin64 + name: projmgr-swig-python-darwin64-amd64 path: tools/projmgr/distribution/lib/darwin64/python/ - name: Download projmgr-swig-python windows uses: actions/download-artifact@v2 with: - name: projmgr-swig-python-windows64 + name: projmgr-swig-python-windows64-amd64 path: tools/projmgr/distribution/lib/windows64/python/ - name: Download projmgr-swig-go linux uses: actions/download-artifact@v2 with: - name: projmgr-swig-go-linux64 + name: projmgr-swig-go-linux64-amd64 path: tools/projmgr/distribution/lib/linux64/go/ - name: Download projmgr-swig-go macos if: ${{ !github.event.repository.private }} uses: actions/download-artifact@v2 with: - name: projmgr-swig-go-darwin64 + name: projmgr-swig-go-darwin64-amd64 path: tools/projmgr/distribution/lib/darwin64/go/ - name: Zip distribution folder @@ -292,68 +262,41 @@ jobs: matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }} steps: - - name: Install macos deps - if: ${{ startsWith(matrix.runs_on, 'macos') }} - run: | - brew install \ - ninja - - - name: Install linux deps - if: ${{ startsWith(matrix.runs_on, 'ubuntu') }} - run: | - sudo apt update - sudo apt-get install \ - bc \ - build-essential \ - ninja-build - - - name: Install windows deps - if: ${{ startsWith(matrix.runs_on, 'windows') }} - run: choco install -y ninja - - name: Checkout devtools uses: actions/checkout@v2 with: submodules: true - - name: Create build folder - run: mkdir build - - - name: Configure windows build for amd64 - if: ${{ startsWith(matrix.runs_on, 'windows') }} - uses: ilammy/msvc-dev-cmd@v1 + # https://github.com/Arm-Debug/mcu-build-action + - name: Build ProjMgrUnitTests + uses: Arm-Debug/mcu-build-action@v1.1 with: - arch: amd64 - - - uses: ammaraskar/gcc-problem-matcher@master - if: ${{ startsWith(matrix.runs_on, 'macos') || startsWith(matrix.runs_on, 'ubuntu') }} - - uses: ammaraskar/msvc-problem-matcher@master - if: ${{ startsWith(matrix.runs_on, 'windows') }} + arch: ${{ matrix.arch }} + build_type: Debug + target: ProjMgrUnitTests - - name: Build and run projmgr unit tests + - name: Run projmgr unit tests run: | - cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug .. - cmake --build . --target ProjMgrUnitTests ctest -V -C Debug -R ProjMgrUnitTests working-directory: ./build - name: Archive unit tests results + if: ${{ always() }} uses: actions/upload-artifact@v2 with: - name: unittest-${{ matrix.target }} + name: unittest-${{ matrix.target }}-${{ matrix.arch }} path: ./build/Testing/Temporary/LastTest.log retention-days: 1 if-no-files-found: error - if: ${{ always() }} - name: Archive gtest report + if: ${{ always() }} uses: actions/upload-artifact@v2 with: - name: unit_gtest-${{ matrix.target }} + name: unit_gtest-${{ matrix.target }}-${{ matrix.arch }} path: ./build/test_reports/projmgrunittest-*.xml retention-days: 1 if-no-files-found: error - if: ${{ always() }} coverage: if: | @@ -367,9 +310,6 @@ jobs: run: | sudo apt update sudo apt-get install \ - bc \ - build-essential \ - ninja-build \ lcov - name: Checkout devtools @@ -377,15 +317,17 @@ jobs: with: submodules: true - - name: Create build folder - run: mkdir build - - - uses: ammaraskar/gcc-problem-matcher@master + # https://github.com/Arm-Debug/mcu-build-action + - name: Build ProjMgrUnitTests + uses: Arm-Debug/mcu-build-action@v1.1 + with: + add_cmake_variables: -DCOVERAGE=ON + arch: amd64 + build_type: Debug + target: ProjMgrUnitTests - - name: Build and run projmgr unit tests + - name: Run ProjMgrUnitTests run: | - cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCOVERAGE=ON .. - cmake --build . --target ProjMgrUnitTests ctest -V -C Debug -R ProjMgrUnitTests working-directory: ./build @@ -431,19 +373,19 @@ jobs: - name: Download gtest report windows uses: actions/download-artifact@v2 with: - name: unit_gtest-windows64 + name: unit_gtest-windows64-amd64 path: testreport/ - name: Download gtest report linux uses: actions/download-artifact@v2 with: - name: unit_gtest-linux64 + name: unit_gtest-linux64-amd64 path: testreport/ - name: Download gtest report macos uses: actions/download-artifact@v2 with: - name: unit_gtest-darwin64 + name: unit_gtest-darwin64-amd64 path: testreport/ - name: Publish Unit Test Results diff --git a/.github/workflows/test_libs.yml b/.github/workflows/test_libs.yml index 78740a005..474ef486f 100644 --- a/.github/workflows/test_libs.yml +++ b/.github/workflows/test_libs.yml @@ -27,65 +27,54 @@ jobs: fail-fast: false matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }} steps: + - name: Checkout devtools + uses: actions/checkout@v2 + with: + submodules: true + + # https://github.com/Arm-Debug/mcu-build-action + - name: Build all libs + uses: Arm-Debug/mcu-build-action@v1.1 + id: mcu-build + with: + add_cmake_variables: '-DLIBS_ONLY=ON' + arch: ${{ matrix.arch }} + target: all + - name: Install macos deps if: ${{ startsWith(matrix.runs_on, 'macos') }} run: | brew install \ - ninja + dos2unix \ + wget - name: Install linux deps if: ${{ startsWith(matrix.runs_on, 'ubuntu') }} run: | sudo apt update sudo apt-get install \ - bc \ - build-essential \ - ninja-build - - - name: Install windows deps - if: ${{ startsWith(matrix.runs_on, 'windows') }} - run: choco install -y ninja - - - name: Checkout devtools - uses: actions/checkout@v2 - with: - submodules: true - - - name: Create build folder - run: mkdir build - - - name: Configure windows build for amd64 - if: ${{ startsWith(matrix.runs_on, 'windows') }} - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: amd64 - - - uses: ammaraskar/gcc-problem-matcher@master - if: ${{ startsWith(matrix.runs_on, 'macos') || startsWith(matrix.runs_on, 'ubuntu') }} - - uses: ammaraskar/msvc-problem-matcher@master - if: ${{ startsWith(matrix.runs_on, 'windows') }} - - - name: Build libs unittest - run: | - cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DLIBS_ONLY=ON .. - cmake --build . - working-directory: ./build + dos2unix \ + libxml2-utils + # CrossPlatformUnitTests failing for aarch64 - name: Run libs unittest + if: ${{ matrix.arch != 'aarch64' }} run: | ctest -C Debug -V working-directory: ./build - name: Archive libs unittest reports + if: ${{ matrix.arch != 'aarch64' }} uses: actions/upload-artifact@v2 with: - name: libs_unittest_report_${{ matrix.target }} + name: libs_unittest_report_${{ matrix.target }}_${{ matrix.arch }} path: build/*_test_report.xml retention-days: 1 if-no-files-found: error - name: Publish libs unittest reports + if: ${{ matrix.arch != 'aarch64' }} uses: mikepenz/action-junit-report@v2 with: - check_name: libs_unittest_report_${{ matrix.target }} + check_name: libs_unittest_report_${{ matrix.target }}_${{ matrix.arch }} report_paths: build/*_test_report.xml diff --git a/.github/workflows/toolbox.yml b/.github/workflows/toolbox.yml index 87cfef8a6..0db00552e 100644 --- a/.github/workflows/toolbox.yml +++ b/.github/workflows/toolbox.yml @@ -123,47 +123,13 @@ jobs: strategy: fail-fast: true matrix: ${{ fromJson(needs.matrix_prep.outputs.matrix) }} - steps: - - name: Install macos deps - if: ${{ startsWith(matrix.runs_on, 'macos') }} - run: | - brew install \ - ninja - - - name: Install linux deps - if: ${{ startsWith(matrix.runs_on, 'ubuntu') }} - run: | - sudo apt update - sudo apt-get install \ - bc \ - build-essential \ - ninja-build - - - name: Install windows deps - if: ${{ startsWith(matrix.runs_on, 'windows') }} - run: choco install -y ninja - - name: Checkout devtools uses: actions/checkout@v2 with: submodules: true - - name: Create build folder - run: mkdir build - - - name: Configure windows build for amd64 - if: ${{ startsWith(matrix.runs_on, 'windows') }} - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: amd64 - - - uses: ammaraskar/gcc-problem-matcher@master - if: ${{ startsWith(matrix.runs_on, 'macos') || startsWith(matrix.runs_on, 'ubuntu') }} - - - uses: ammaraskar/msvc-problem-matcher@master - if: ${{ startsWith(matrix.runs_on, 'windows') }} - + # https://github.com/Arm-Debug/mcu-build-action - name: Download cmsis-toolbox installer uses: actions/download-artifact@v2 with: @@ -174,33 +140,38 @@ jobs: if: ${{ startsWith(matrix.runs_on, 'macos') || startsWith(matrix.runs_on, 'ubuntu') }} run: chmod +x cmsis-toolbox.sh - - name: Build and run Toolbox tests + - name: Build ToolboxTests + uses: Arm-Debug/mcu-build-action@v1.1 + with: + arch: ${{ matrix.arch }} + build_type: Debug + target: ToolboxTests + + - name: Run Toolbox tests run: | - cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug .. - cmake --build . --target ToolboxTests ctest -V -C Debug -R ToolboxTests working-directory: ./build - name: Archive tests results + if: ${{ always() }} uses: actions/upload-artifact@v2 with: - name: toolboxtest-${{ matrix.target }} + name: toolboxtest-${{ matrix.target }}-${{ matrix.arch }} path: ./build/Testing/Temporary/LastTest.log retention-days: 1 if-no-files-found: error - if: ${{ always() }} - name: Archive gtest report + if: ${{ always() }} uses: actions/upload-artifact@v2 with: - name: toolbox_test-${{ matrix.target }} + name: toolbox_test-${{ matrix.target }}-${{ matrix.arch }} path: ./build/test_reports/toolboxtests-*.xml retention-days: 1 if-no-files-found: error - if: ${{ always() }} - name: Publish Toolbox Test Results uses: mikepenz/action-junit-report@v2 with: - check_name: toolbox_test-${{ matrix.target }} + check_name: toolbox_test-${{ matrix.target }}-${{ matrix.arch }} report_paths: build/test_reports/toolboxtests-${{ matrix.target }}.xml diff --git a/README.md b/README.md index 0b63b7786..759290b13 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ Note that some of the required tools are platform dependent: Make sure 'git' and 'bash' paths are listed under the PATH environment variable and set the git bash priority higher in the path. ``` - + ~~~ ☑️ GCC/Clang on Windows: Currently GCC and Clang (MSYS2/MinGW distribution) compilers do not work @@ -141,7 +141,7 @@ This is a three step process: As usual, the actual build steps vary by platform. -- **Linux/MacOS**:\ +- **Linux/MacOS amd64**:\ On Linux or MacOS use the following commands.\ **Note:** If `DCMAKE_BUILD_TYPE` is not selected, the binaries shall build @@ -155,6 +155,13 @@ As usual, the actual build steps vary by platform. cmake -DCMAKE_BUILD_TYPE=Debug .. ``` +- **Linux cross-compiling aarch64:**\ + For cross-compiling aarch64 you need to generate with `-DCMAKE_TOOLCHAIN_FILE=../cmake/TC-linux-aarch64.cmake`: + + ```bash + cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=../cmake/TC-linux-aarch64.cmake .. + ``` + - **Windows:**\ On Windows system use the following command to generate the complete workspace: @@ -267,7 +274,7 @@ By default, few special tests are skipped from execution as they are dependent o ~~~ Make sure you have the proper **[Arm Compilers licenses](https://developer.arm.com/tools-and-software/software-development-tools/license-management/resources/product-and-toolkit-configuration)**. - + ## Build Documentation Some components provide Doxygen-based documentation which needs to be generated before @@ -277,7 +284,7 @@ documentations, see build target suffix `-docs`. ``` ☑️ Note: The *-docs build targets require doxygen to be available. If CMake fails to - detect the correct version of doxygen a warning message appears and the build + detect the correct version of doxygen a warning message appears and the build targets are skipped. ``` diff --git a/cmake/GetCMakeTargets.cmake b/cmake/GetCMakeTargets.cmake index 3fd532151..b48c6714c 100644 --- a/cmake/GetCMakeTargets.cmake +++ b/cmake/GetCMakeTargets.cmake @@ -24,7 +24,7 @@ function(get_targets) list(TRANSFORM all_targets APPEND "\n") list(INSERT all_targets 0 "CMake Targets ${CMAKE_BINARY_DIR}\n") string (REPLACE ";" "" all_targets "${all_targets}") - + # write to file file(WRITE ${CMAKE_BINARY_DIR}/targets "${all_targets}") endfunction() diff --git a/cmake/TC-linux-aarch64.cmake b/cmake/TC-linux-aarch64.cmake new file mode 100644 index 000000000..12875df0d --- /dev/null +++ b/cmake/TC-linux-aarch64.cmake @@ -0,0 +1,11 @@ +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_SYSTEM_PROCESSOR arm) + +set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc) +set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++) +set(CMAKE_CROSSCOMPILING_EMULATOR qemu-aarch64 -L /usr/aarch64-linux-gnu) + +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)