| # Copyright (c) 2020-2021 Project CHIP Authors |
| # |
| # 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. |
| |
| name: Tests |
| |
| on: |
| push: |
| pull_request: |
| 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 |
| |
| jobs: |
| test_suites_linux: |
| name: Test Suites - Linux |
| timeout-minutes: 60 |
| |
| strategy: |
| matrix: |
| type: [tsan] |
| eventloop: [eventloop_same, eventloop_separate] |
| env: |
| USE_SEPARATE_EVENTLOOP: ${{ matrix.eventloop == 'eventloop_separate' }} |
| USE_TSAN: ${{ matrix.type == 'tsan' }} |
| |
| if: github.actor != 'restyled-io[bot]' |
| runs-on: ubuntu-latest |
| |
| container: |
| image: connectedhomeip/chip-build:0.5.28 |
| options: |
| --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 |
| net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" |
| |
| steps: |
| - name: Checkout |
| uses: actions/checkout@v2 |
| with: |
| submodules: true |
| - name: Try to ensure the directories for core dumping exist and we can write them. |
| run: | |
| mkdir /tmp/cores || true |
| sysctl -w kernel.core_pattern=/tmp/cores/core.%u.%p.%t || true |
| mkdir objdir-clone || true |
| - name: Bootstrap |
| timeout-minutes: 10 |
| run: scripts/build/gn_bootstrap.sh |
| - name: Uploading bootstrap logs |
| uses: actions/upload-artifact@v2 |
| if: ${{ always() }} && ${{ !env.ACT }} |
| with: |
| name: bootstrap-logs-linux-${{ matrix.type }}-${{ matrix.eventloop }} |
| path: | |
| .environment/gn_out/.ninja_log |
| .environment/pigweed-venv/*.log |
| - name: Build all clusters app |
| timeout-minutes: 5 |
| run: | |
| scripts/examples/gn_build_example.sh examples/all-clusters-app/linux out/debug/standalone/ chip_config_network_layer_ble=false is_tsan=${USE_TSAN} |
| - name: Build TV app |
| timeout-minutes: 5 |
| run: | |
| scripts/examples/gn_build_example.sh examples/tv-app/linux out/debug/standalone/ chip_config_network_layer_ble=false is_tsan=${USE_TSAN} |
| - name: Build chip-tool |
| timeout-minutes: 5 |
| run: | |
| scripts/examples/gn_build_example.sh examples/chip-tool out/debug/standalone/ is_tsan=${USE_TSAN} config_use_separate_eventloop=${USE_SEPARATE_EVENTLOOP} |
| - name: Copy objdir |
| run: | |
| # The idea is to not upload our objdir unless builds have |
| # actually succeeded, because that just wastes space. |
| rsync -a out/debug/standalone/ objdir-clone || true |
| - name: Run Tests |
| timeout-minutes: 20 |
| run: | |
| scripts/tests/test_suites.sh -n |
| - name: Run TV Tests |
| timeout-minutes: 10 |
| run: | |
| scripts/tests/test_suites.sh -n -a tv |
| - name: Uploading core files |
| uses: actions/upload-artifact@v2 |
| if: ${{ failure() }} && ${{ !env.ACT }} |
| with: |
| name: crash-core-linux-${{ matrix.type }}-${{ matrix.eventloop }} |
| path: /tmp/cores/ |
| # Cores are big; don't hold on to them too long. |
| retention-days: 5 |
| - name: Uploading objdir for debugging |
| uses: actions/upload-artifact@v2 |
| if: ${{ failure() }} && ${{ !env.ACT }} |
| with: |
| name: crash-objdir-linux-${{ matrix.type }}-${{ matrix.eventloop }} |
| path: objdir-clone/ |
| # objdirs are big; don't hold on to them too long. |
| retention-days: 5 |
| test_suites_darwin: |
| name: Test Suites - Darwin |
| timeout-minutes: 60 |
| |
| strategy: |
| matrix: |
| type: [tsan] |
| eventloop: [eventloop_same, eventloop_separate] |
| env: |
| USE_SEPARATE_EVENTLOOP: ${{ matrix.eventloop == 'eventloop_separate' }} |
| USE_TSAN: ${{ matrix.type == 'tsan' }} |
| |
| if: github.actor != 'restyled-io[bot]' |
| runs-on: macos-latest |
| |
| steps: |
| - name: Checkout |
| uses: actions/checkout@v2 |
| with: |
| submodules: true |
| - name: Setup Environment |
| # coreutils for stdbuf |
| run: brew install openssl pkg-config 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: Fix pkgconfig link |
| working-directory: /usr/local/lib/pkgconfig |
| run: | |
| pwd |
| ls -la /usr/local/Cellar/ |
| ls -la /usr/local/Cellar/openssl@1.1 |
| OPEN_SSL_VERSION=`ls -la /usr/local/Cellar/openssl@1.1 | cat | tail -n1 | awk '{print $NF}'` |
| ln -s /usr/local/Cellar/openssl@1.1/$OPEN_SSL_VERSION/lib/pkgconfig/* . |
| - name: Bootstrap |
| timeout-minutes: 25 |
| run: scripts/build/gn_bootstrap.sh |
| - name: Uploading bootstrap logs |
| uses: actions/upload-artifact@v2 |
| if: ${{ always() }} && ${{ !env.ACT }} |
| with: |
| name: bootstrap-logs-darwin-${{ matrix.type }}-${{ matrix.eventloop }} |
| path: | |
| .environment/gn_out/.ninja_log |
| .environment/pigweed-venv/*.log |
| - name: Run Build Test Server |
| timeout-minutes: 10 |
| run: | |
| scripts/examples/gn_build_example.sh examples/all-clusters-app/linux out/debug/standalone/ chip_config_network_layer_ble=false is_tsan=${USE_TSAN} |
| - name: Build chip-tool |
| timeout-minutes: 10 |
| run: | |
| scripts/examples/gn_build_example.sh examples/chip-tool out/debug/standalone/ is_tsan=${USE_TSAN} config_use_separate_eventloop=${USE_SEPARATE_EVENTLOOP} |
| - name: Copy objdir |
| run: | |
| # The idea is to not upload our objdir unless builds have |
| # actually succeeded, because that just wastes space. |
| rsync -a out/debug/standalone/ objdir-clone || true |
| - name: Run Test Suites |
| timeout-minutes: 35 |
| run: | |
| scripts/tests/test_suites.sh |
| - name: Uploading application logs |
| uses: actions/upload-artifact@v2 |
| if: ${{ failure() }} && ${{ !env.ACT }} |
| with: |
| name: test-suite-app-logs-${{ matrix.type }}-${{ matrix.eventloop }} |
| path: /tmp/test_suites_app_logs/ |
| retention-days: 5 |
| - name: Uploading core files |
| uses: actions/upload-artifact@v2 |
| if: ${{ failure() }} && ${{ !env.ACT }} |
| with: |
| name: crash-core-darwin-${{ matrix.type }}-${{ matrix.eventloop }} |
| path: /cores/ |
| # Cores are big; don't hold on to them too long. |
| retention-days: 5 |
| - name: Uploading diagnostic logs |
| uses: actions/upload-artifact@v2 |
| if: ${{ failure() }} && ${{ !env.ACT }} |
| with: |
| name: crash-log-darwin-${{ matrix.type }}-${{ matrix.eventloop }} |
| path: ~/Library/Logs/DiagnosticReports/ |
| - name: Uploading objdir for debugging |
| uses: actions/upload-artifact@v2 |
| if: ${{ failure() }} && ${{ !env.ACT }} |
| with: |
| name: crash-objdir-darwin-${{ matrix.type }}-${{ matrix.eventloop }} |
| path: objdir-clone/ |
| # objdirs are big; don't hold on to them too long. |
| retention-days: 5 |