From 033ecff35af7dc2846bdf10066b4bedd35f9e8c8 Mon Sep 17 00:00:00 2001 From: Mathieu Kardous Date: Mon, 30 Oct 2023 10:21:17 -0400 Subject: [PATCH] Add lit-icd to CI builds --- .github/workflows/darwin-tests.yaml | 262 +++++++++++----------- .github/workflows/examples-linux-arm.yaml | 117 +++++----- 2 files changed, 190 insertions(+), 189 deletions(-) diff --git a/.github/workflows/darwin-tests.yaml b/.github/workflows/darwin-tests.yaml index 21f2a227be1a72..974b5d489e821d 100644 --- a/.github/workflows/darwin-tests.yaml +++ b/.github/workflows/darwin-tests.yaml @@ -15,145 +15,145 @@ name: Darwin Tests on: - push: - pull_request: - merge_group: - workflow_dispatch: + push: + pull_request: + merge_group: + workflow_dispatch: concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == - 'pull_request' && github.event.number) || (github.event_name == - 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true + group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == + 'pull_request' && github.event.number) || (github.event_name == + 'workflow_dispatch' && github.run_number) || github.sha }} + cancel-in-progress: true env: - CHIP_NO_LOG_TIMESTAMPS: true + CHIP_NO_LOG_TIMESTAMPS: true jobs: - test_suites_chip_tool_darwin: - name: Test Suites - Darwin + test_suites_chip_tool_darwin: + name: Test Suites - Darwin - strategy: - matrix: - build_variant: [no-ble-asan-clang] - env: - BUILD_VARIANT: ${{matrix.build_variant}} + strategy: + matrix: + build_variant: [no-ble-asan-clang] + env: + BUILD_VARIANT: ${{matrix.build_variant}} - # We can't use the pigweed clang to build the Darwin framework once we start using - # Swift, because it does not handle CLANG_ENABLE_MODULES correctly. - # - # But the Xcode clang does not handle LSan correctly. Since we can't easily apply - # LSAN_OPTIONS to just everything except darwin-framework-tool, instead disable asan for - # it. - BUILD_VARIANT_FRAMEWORK_TOOL: no-ble - LSAN_OPTIONS: detect_leaks=1 malloc_context_size=40 suppressions=scripts/tests/chiptest/lsan-mac-suppressions.txt + # We can't use the pigweed clang to build the Darwin framework once we start using + # Swift, because it does not handle CLANG_ENABLE_MODULES correctly. + # + # But the Xcode clang does not handle LSan correctly. Since we can't easily apply + # LSAN_OPTIONS to just everything except darwin-framework-tool, instead disable asan for + # it. + BUILD_VARIANT_FRAMEWORK_TOOL: no-ble + LSAN_OPTIONS: detect_leaks=1 malloc_context_size=40 suppressions=scripts/tests/chiptest/lsan-mac-suppressions.txt - if: github.actor != 'restyled-io[bot]' - runs-on: macos-latest + if: github.actor != 'restyled-io[bot]' + runs-on: macos-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup Environment - # coreutils for stdbuf - run: brew install coreutils - - name: - Try to ensure the directories for core dumping and diagnostic - log collection exist and we can write them. - run: | - sudo chown ${USER} /cores || true - mkdir -p ~/Library/Logs/DiagnosticReports || true - mkdir objdir-clone || true - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: darwin - bootstrap-log-name: bootstrap-logs-darwin-${{ matrix.build_variant }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Environment + # coreutils for stdbuf + run: brew install coreutils + - name: Try to ensure the directories for core dumping and diagnostic + log collection exist and we can write them. + run: | + sudo chown ${USER} /cores || true + mkdir -p ~/Library/Logs/DiagnosticReports || true + mkdir objdir-clone || true + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: darwin + bootstrap-log-name: bootstrap-logs-darwin-${{ matrix.build_variant }} - - name: Run macOS Darwin Framework Tool Build Debug - working-directory: src/darwin/Framework - # Keep whatever Xcode settings - # for OTHER_CFLAGS exist by using ${inherited}. - # - # Enable -Wconversion by hand as well, because it seems to not be - # enabled by default in the Xcode config. - # - # Disable availability annotations, since we are not building against a system - # Matter.framework. - run: xcodebuild -target "darwin-framework-tool" -sdk macosx -configuration Debug OTHER_CFLAGS='${inherited} -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1' - - name: Delete Defaults - run: defaults delete com.apple.dt.xctest.tool - continue-on-error: true - - name: Clean Build - run: xcodebuild clean - working-directory: src/darwin/Framework - - name: Build Apps - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target darwin-x64-darwin-framework-tool-${BUILD_VARIANT_FRAMEWORK_TOOL} \ - --target darwin-x64-all-clusters-${BUILD_VARIANT} \ - --target darwin-x64-lock-${BUILD_VARIANT} \ - --target darwin-x64-ota-provider-${BUILD_VARIANT} \ - --target darwin-x64-ota-requestor-${BUILD_VARIANT} \ - --target darwin-x64-tv-app-${BUILD_VARIANT} \ - --target darwin-x64-bridge-${BUILD_VARIANT} \ - build \ - --copy-artifacts-to objdir-clone \ - " - - name: Run Tests - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/tests/run_test_suite.py \ - --chip-tool ./out/darwin-x64-darwin-framework-tool-${BUILD_VARIANT_FRAMEWORK_TOOL}/darwin-framework-tool \ - --target-skip-glob '{TestAccessControlConstraints}' \ - run \ - --iterations 1 \ - --test-timeout-seconds 120 \ - --all-clusters-app ./out/darwin-x64-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \ - --lock-app ./out/darwin-x64-lock-${BUILD_VARIANT}/chip-lock-app \ - --ota-provider-app ./out/darwin-x64-ota-provider-${BUILD_VARIANT}/chip-ota-provider-app \ - --ota-requestor-app ./out/darwin-x64-ota-requestor-${BUILD_VARIANT}/chip-ota-requestor-app \ - --tv-app ./out/darwin-x64-tv-app-${BUILD_VARIANT}/chip-tv-app \ - --bridge-app ./out/darwin-x64-bridge-${BUILD_VARIANT}/chip-bridge-app \ - " - - name: Run OTA Test - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/tests/run_darwin_framework_ota_test.py \ - run \ - --darwin-framework-tool ./out/darwin-x64-darwin-framework-tool-${BUILD_VARIANT_FRAMEWORK_TOOL}/darwin-framework-tool \ - --ota-requestor-app ./out/darwin-x64-ota-requestor-${BUILD_VARIANT}/chip-ota-requestor-app \ - --ota-data-file /tmp/rawImage \ - --ota-image-file /tmp/otaImage \ - --ota-destination-file /tmp/downloadedImage \ - --ota-candidate-file /tmp/otaCandidateJSON \ - " - - name: Uploading core files - uses: actions/upload-artifact@v3 - if: ${{ failure() && !env.ACT }} - with: - name: crash-core-darwin-${{ matrix.build_variant }} - path: /cores/ - # Cores are big; don't hold on to them too long. - retention-days: 5 - - name: Uploading diagnostic logs - uses: actions/upload-artifact@v3 - if: ${{ failure() && !env.ACT }} - with: - name: crash-log-darwin-${{ matrix.build_variant }} - path: ~/Library/Logs/DiagnosticReports/ - - name: Uploading framework build log - uses: actions/upload-artifact@v3 - if: ${{ failure() && !env.ACT }} - with: - name: framework-build-log-darwin-${{BUILD_VARIANT_FRAMEWORK_TOOL}} - path: out/darwin-x64-darwin-framework-tool-${{BUILD_VARIANT_FRAMEWORK_TOOL}}/darwin_framework_build.log - - name: Uploading objdir for debugging - uses: actions/upload-artifact@v3 - if: ${{ failure() && !env.ACT }} - with: - name: crash-objdir-darwin-${{ matrix.build_variant }} - path: objdir-clone/ - # objdirs are big; don't hold on to them too long. - retention-days: 5 + - name: Run macOS Darwin Framework Tool Build Debug + working-directory: src/darwin/Framework + # Keep whatever Xcode settings + # for OTHER_CFLAGS exist by using ${inherited}. + # + # Enable -Wconversion by hand as well, because it seems to not be + # enabled by default in the Xcode config. + # + # Disable availability annotations, since we are not building against a system + # Matter.framework. + run: xcodebuild -target "darwin-framework-tool" -sdk macosx -configuration Debug OTHER_CFLAGS='${inherited} -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1' + - name: Delete Defaults + run: defaults delete com.apple.dt.xctest.tool + continue-on-error: true + - name: Clean Build + run: xcodebuild clean + working-directory: src/darwin/Framework + - name: Build Apps + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target darwin-x64-darwin-framework-tool-${BUILD_VARIANT_FRAMEWORK_TOOL} \ + --target darwin-x64-all-clusters-${BUILD_VARIANT} \ + --target darwin-x64-lock-${BUILD_VARIANT} \ + --target darwin-x64-ota-provider-${BUILD_VARIANT} \ + --target darwin-x64-ota-requestor-${BUILD_VARIANT} \ + --target darwin-x64-tv-app-${BUILD_VARIANT} \ + --target darwin-x64-bridge-${BUILD_VARIANT} \ + --target darwin-x64-lit-icd-${BUILD_VARIANT} \ + build \ + --copy-artifacts-to objdir-clone \ + " + - name: Run Tests + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/tests/run_test_suite.py \ + --chip-tool ./out/darwin-x64-darwin-framework-tool-${BUILD_VARIANT_FRAMEWORK_TOOL}/darwin-framework-tool \ + --target-skip-glob '{TestAccessControlConstraints}' \ + run \ + --iterations 1 \ + --test-timeout-seconds 120 \ + --all-clusters-app ./out/darwin-x64-all-clusters-${BUILD_VARIANT}/chip-all-clusters-app \ + --lock-app ./out/darwin-x64-lock-${BUILD_VARIANT}/chip-lock-app \ + --ota-provider-app ./out/darwin-x64-ota-provider-${BUILD_VARIANT}/chip-ota-provider-app \ + --ota-requestor-app ./out/darwin-x64-ota-requestor-${BUILD_VARIANT}/chip-ota-requestor-app \ + --tv-app ./out/darwin-x64-tv-app-${BUILD_VARIANT}/chip-tv-app \ + --bridge-app ./out/darwin-x64-bridge-${BUILD_VARIANT}/chip-bridge-app \ + " + - name: Run OTA Test + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/tests/run_darwin_framework_ota_test.py \ + run \ + --darwin-framework-tool ./out/darwin-x64-darwin-framework-tool-${BUILD_VARIANT_FRAMEWORK_TOOL}/darwin-framework-tool \ + --ota-requestor-app ./out/darwin-x64-ota-requestor-${BUILD_VARIANT}/chip-ota-requestor-app \ + --ota-data-file /tmp/rawImage \ + --ota-image-file /tmp/otaImage \ + --ota-destination-file /tmp/downloadedImage \ + --ota-candidate-file /tmp/otaCandidateJSON \ + " + - name: Uploading core files + uses: actions/upload-artifact@v3 + if: ${{ failure() && !env.ACT }} + with: + name: crash-core-darwin-${{ matrix.build_variant }} + path: /cores/ + # Cores are big; don't hold on to them too long. + retention-days: 5 + - name: Uploading diagnostic logs + uses: actions/upload-artifact@v3 + if: ${{ failure() && !env.ACT }} + with: + name: crash-log-darwin-${{ matrix.build_variant }} + path: ~/Library/Logs/DiagnosticReports/ + - name: Uploading framework build log + uses: actions/upload-artifact@v3 + if: ${{ failure() && !env.ACT }} + with: + name: framework-build-log-darwin-${{BUILD_VARIANT_FRAMEWORK_TOOL}} + path: out/darwin-x64-darwin-framework-tool-${{BUILD_VARIANT_FRAMEWORK_TOOL}}/darwin_framework_build.log + - name: Uploading objdir for debugging + uses: actions/upload-artifact@v3 + if: ${{ failure() && !env.ACT }} + with: + name: crash-objdir-darwin-${{ matrix.build_variant }} + path: objdir-clone/ + # objdirs are big; don't hold on to them too long. + retention-days: 5 diff --git a/.github/workflows/examples-linux-arm.yaml b/.github/workflows/examples-linux-arm.yaml index 4645b4e897d3ff..3225ee864d6dcc 100644 --- a/.github/workflows/examples-linux-arm.yaml +++ b/.github/workflows/examples-linux-arm.yaml @@ -15,71 +15,72 @@ name: Build example - Linux ARM on: - push: - pull_request: - merge_group: + push: + pull_request: + merge_group: concurrency: - group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} - cancel-in-progress: true + group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }} + cancel-in-progress: true env: - CHIP_NO_LOG_TIMESTAMPS: true - + CHIP_NO_LOG_TIMESTAMPS: true + jobs: - arm_crosscompile: - name: Linux ARM Cross compile + arm_crosscompile: + name: Linux ARM Cross compile - runs-on: ubuntu-latest - if: github.actor != 'restyled-io[bot]' + runs-on: ubuntu-latest + if: github.actor != 'restyled-io[bot]' - container: - image: ghcr.io/project-chip/chip-build-crosscompile:22 - volumes: - - "/tmp/bloat_reports:/tmp/bloat_reports" + container: + image: ghcr.io/project-chip/chip-build-crosscompile:22 + volumes: + - "/tmp/bloat_reports:/tmp/bloat_reports" - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Checkout submodules & Bootstrap - uses: ./.github/actions/checkout-submodules-and-bootstrap - with: - platform: linux + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Checkout submodules & Bootstrap + uses: ./.github/actions/checkout-submodules-and-bootstrap + with: + platform: linux - - name: Set up environment for size reports - uses: ./.github/actions/setup-size-reports - if: ${{ !env.ACT }} - with: - gh-context: ${{ toJson(github) }} + - name: Set up environment for size reports + uses: ./.github/actions/setup-size-reports + if: ${{ !env.ACT }} + with: + gh-context: ${{ toJson(github) }} - - name: Build Some samples - run: | - ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target linux-arm64-chip-cert-clang \ - --target linux-arm64-all-clusters-clang \ - --target linux-arm64-chip-tool-ipv6only-clang \ - --target linux-arm64-chip-tool-nodeps-ipv6only \ - --target linux-arm64-lock-clang \ - --target linux-arm64-minmdns-clang \ - --target linux-arm64-light-rpc-ipv6only-clang \ - --target linux-arm64-thermostat-no-ble-clang \ - build \ - " - - name: Bloat report - chip-tool - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - linux arm64 chip-tool-ipv6only \ - out/linux-arm64-chip-tool-ipv6only-clang/chip-tool \ - /tmp/bloat_reports/ - - name: Bloat report - thermostat - run: | - .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ - linux arm64 thermostat-no-ble \ - out/linux-arm64-thermostat-no-ble-clang/thermostat-app \ - /tmp/bloat_reports/ - - name: Uploading Size Reports - uses: ./.github/actions/upload-size-reports - if: ${{ !env.ACT }} - with: - platform-name: Linux + - name: Build Some samples + run: | + ./scripts/run_in_build_env.sh \ + "./scripts/build/build_examples.py \ + --target linux-arm64-chip-cert-clang \ + --target linux-arm64-all-clusters-clang \ + --target linux-arm64-chip-tool-ipv6only-clang \ + --target linux-arm64-chip-tool-nodeps-ipv6only \ + --target linux-arm64-lock-clang \ + --target linux-arm64-minmdns-clang \ + --target linux-arm64-light-rpc-ipv6only-clang \ + --target linux-arm64-thermostat-no-ble-clang \ + --target linux-arm64-lit-icd-no-ble-clang \ + build \ + " + - name: Bloat report - chip-tool + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + linux arm64 chip-tool-ipv6only \ + out/linux-arm64-chip-tool-ipv6only-clang/chip-tool \ + /tmp/bloat_reports/ + - name: Bloat report - thermostat + run: | + .environment/pigweed-venv/bin/python3 scripts/tools/memory/gh_sizes.py \ + linux arm64 thermostat-no-ble \ + out/linux-arm64-thermostat-no-ble-clang/thermostat-app \ + /tmp/bloat_reports/ + - name: Uploading Size Reports + uses: ./.github/actions/upload-size-reports + if: ${{ !env.ACT }} + with: + platform-name: Linux