cirque.yaml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. # Copyright (c) 2020-2023 Project CHIP Authors
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. name: Cirque
  15. on:
  16. push:
  17. pull_request:
  18. merge_group:
  19. workflow_dispatch:
  20. concurrency:
  21. group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }}
  22. cancel-in-progress: true
  23. env:
  24. CHIP_NO_LOG_TIMESTAMPS: true
  25. jobs:
  26. cirque:
  27. name: Cirque
  28. env:
  29. GITHUB_CACHE_PATH: /tmp/cirque-cache
  30. runs-on: ubuntu-latest
  31. if: github.actor != 'restyled-io[bot]'
  32. # need to run with privilege, which isn't supported by job.XXX.contaner
  33. # https://github.com/actions/container-action/issues/2
  34. # container:
  35. # image: ghcr.io/project-chip/chip-build-cirque:0.8
  36. # volumes:
  37. # - "/tmp:/tmp"
  38. # - "/dev/pts:/dev/pts"
  39. # env:
  40. # LOG_DIR: /tmp/cirque_test_output/
  41. # CLEANUP_DOCKER_FOR_CI: 1
  42. # options: "--privileged"
  43. steps:
  44. - name: Checkout
  45. uses: actions/checkout@v4
  46. - name: Checkout submodules
  47. uses: ./.github/actions/checkout-submodules
  48. with:
  49. platform: linux
  50. - name: Bootstrap Cache
  51. uses: ./.github/actions/bootstrap-cache
  52. - name: Bootstrap Cirque
  53. run: |
  54. integrations/docker/images/stage-2/chip-build-cirque/run.sh \
  55. -- sh -c " \
  56. git config --global --add safe.directory '*' \
  57. && bash scripts/bootstrap.sh \
  58. && chown -R $(id -u):$(id -g) .environment \
  59. "
  60. - name: Get Cirque Bootstrap cache key
  61. id: cirque-bootstrap-cache-key
  62. run: echo "val=$(scripts/tests/cirque_tests.sh cachekeyhash)" >> $GITHUB_OUTPUT
  63. - uses: Wandalen/wretry.action@v1.3.0
  64. name: Cirque Bootstrap cache
  65. if: ${{ !env.ACT }}
  66. continue-on-error: true
  67. timeout-minutes: 10
  68. with:
  69. action: buildjet/cache@v3
  70. attempt_limit: 3
  71. attempt_delay: 2000
  72. with: |
  73. key: ${{ runner.os }}-cirque-${{ steps.cirque-bootstrap-cache-key.outputs.val }}
  74. restore-keys: ${{ runner.os }}-cirque-
  75. path: ${{ env.GITHUB_CACHE_PATH }}
  76. - name: Cirque Bootstrap
  77. run: |
  78. integrations/docker/images/stage-2/chip-build-cirque/run.sh \
  79. --env GITHUB_ACTION_RUN=1 \
  80. --env GITHUB_CACHE_PATH=${{ env.GITHUB_CACHE_PATH }} \
  81. --volume /tmp:/tmp \
  82. -- scripts/tests/cirque_tests.sh bootstrap
  83. - name: Artifact suffix
  84. id: outsuffix
  85. uses: haya14busa/action-cond@v1
  86. if: ${{ !env.ACT }}
  87. with:
  88. cond: ${{ github.event.pull_request.number == '' }}
  89. if_true: "${{ github.sha }}"
  90. if_false: "pull-${{ github.event.pull_request.number }}"
  91. - name: Build Binaries
  92. run: |
  93. integrations/docker/images/stage-2/chip-build-cirque/run.sh \
  94. -- sh -c " \
  95. git config --global --add safe.directory '*' \
  96. && scripts/build/gn_gen_cirque.sh \
  97. "
  98. - name: Run Tests
  99. run: |
  100. integrations/docker/images/stage-2/chip-build-cirque/run.sh \
  101. --env LOG_DIR=/tmp/cirque_test_output \
  102. --env CLEANUP_DOCKER_FOR_CI=1 \
  103. --env GITHUB_ACTION_RUN=1 \
  104. --privileged \
  105. --volume /tmp:/tmp \
  106. --volume /dev/pts:/dev/pts \
  107. -- sh -c " \
  108. git config --global --add safe.directory '*' \
  109. && scripts/tests/cirque_tests.sh run_all_tests \
  110. "
  111. - name: Uploading Binaries
  112. uses: actions/upload-artifact@v3
  113. if: ${{ always() && !env.ACT }}
  114. with:
  115. name: cirque_log-${{steps.outsuffix.outputs.value}}-logs
  116. path: /tmp/cirque_test_output/