twisted_trunk.yml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. name: Twisted Trunk
  2. on:
  3. schedule:
  4. - cron: 0 8 * * *
  5. workflow_dispatch:
  6. concurrency:
  7. group: ${{ github.workflow }}-${{ github.ref }}
  8. cancel-in-progress: true
  9. jobs:
  10. mypy:
  11. runs-on: ubuntu-latest
  12. steps:
  13. - uses: actions/checkout@v3
  14. - name: Install Rust
  15. uses: dtolnay/rust-toolchain@e12eda571dc9a5ee5d58eecf4738ec291c66f295
  16. with:
  17. toolchain: stable
  18. - uses: Swatinem/rust-cache@v2
  19. - uses: matrix-org/setup-python-poetry@v1
  20. with:
  21. python-version: "3.x"
  22. extras: "all"
  23. - run: |
  24. poetry remove twisted
  25. poetry add --extras tls git+https://github.com/twisted/twisted.git#trunk
  26. poetry install --no-interaction --extras "all test"
  27. - name: Remove warn_unused_ignores from mypy config
  28. run: sed '/warn_unused_ignores = True/d' -i mypy.ini
  29. - run: poetry run mypy
  30. trial:
  31. runs-on: ubuntu-latest
  32. steps:
  33. - uses: actions/checkout@v3
  34. - run: sudo apt-get -qq install xmlsec1
  35. - name: Install Rust
  36. uses: dtolnay/rust-toolchain@e12eda571dc9a5ee5d58eecf4738ec291c66f295
  37. with:
  38. toolchain: stable
  39. - uses: Swatinem/rust-cache@v2
  40. - uses: matrix-org/setup-python-poetry@v1
  41. with:
  42. python-version: "3.x"
  43. extras: "all test"
  44. - run: |
  45. poetry remove twisted
  46. poetry add --extras tls git+https://github.com/twisted/twisted.git#trunk
  47. poetry install --no-interaction --extras "all test"
  48. - run: poetry run trial --jobs 2 tests
  49. - name: Dump logs
  50. # Logs are most useful when the command fails, always include them.
  51. if: ${{ always() }}
  52. # Note: Dumps to workflow logs instead of using actions/upload-artifact
  53. # This keeps logs colocated with failing jobs
  54. # It also ignores find's exit code; this is a best effort affair
  55. run: >-
  56. find _trial_temp -name '*.log'
  57. -exec echo "::group::{}" \;
  58. -exec cat {} \;
  59. -exec echo "::endgroup::" \;
  60. || true
  61. sytest:
  62. runs-on: ubuntu-latest
  63. container:
  64. image: matrixdotorg/sytest-synapse:buster
  65. volumes:
  66. - ${{ github.workspace }}:/src
  67. steps:
  68. - uses: actions/checkout@v3
  69. - name: Install Rust
  70. uses: dtolnay/rust-toolchain@e12eda571dc9a5ee5d58eecf4738ec291c66f295
  71. with:
  72. toolchain: stable
  73. - uses: Swatinem/rust-cache@v2
  74. - name: Patch dependencies
  75. # Note: The poetry commands want to create a virtualenv in /src/.venv/,
  76. # but the sytest-synapse container expects it to be in /venv/.
  77. # We symlink it before running poetry so that poetry actually
  78. # ends up installing to `/venv`.
  79. run: |
  80. ln -s -T /venv /src/.venv
  81. poetry remove twisted
  82. poetry add --extras tls git+https://github.com/twisted/twisted.git#trunk
  83. poetry install --no-interaction --extras "all test"
  84. working-directory: /src
  85. - name: Run SyTest
  86. run: /bootstrap.sh synapse
  87. working-directory: /src
  88. env:
  89. # Use offline mode to avoid reinstalling the pinned version of
  90. # twisted.
  91. OFFLINE: 1
  92. - name: Summarise results.tap
  93. if: ${{ always() }}
  94. run: /sytest/scripts/tap_to_gha.pl /logs/results.tap
  95. - name: Upload SyTest logs
  96. uses: actions/upload-artifact@v3
  97. if: ${{ always() }}
  98. with:
  99. name: Sytest Logs - ${{ job.status }} - (${{ join(matrix.*, ', ') }})
  100. path: |
  101. /logs/results.tap
  102. /logs/**/*.log*
  103. complement:
  104. if: "${{ !failure() && !cancelled() }}"
  105. runs-on: ubuntu-latest
  106. strategy:
  107. fail-fast: false
  108. matrix:
  109. include:
  110. - arrangement: monolith
  111. database: SQLite
  112. - arrangement: monolith
  113. database: Postgres
  114. - arrangement: workers
  115. database: Postgres
  116. steps:
  117. - name: Run actions/checkout@v3 for synapse
  118. uses: actions/checkout@v3
  119. with:
  120. path: synapse
  121. - name: Prepare Complement's Prerequisites
  122. run: synapse/.ci/scripts/setup_complement_prerequisites.sh
  123. # This step is specific to the 'Twisted trunk' test run:
  124. - name: Patch dependencies
  125. run: |
  126. set -x
  127. DEBIAN_FRONTEND=noninteractive sudo apt-get install -yqq python3 pipx
  128. pipx install poetry==1.3.2
  129. poetry remove -n twisted
  130. poetry add -n --extras tls git+https://github.com/twisted/twisted.git#trunk
  131. poetry lock --no-update
  132. working-directory: synapse
  133. - run: |
  134. set -o pipefail
  135. TEST_ONLY_SKIP_DEP_HASH_VERIFICATION=1 POSTGRES=${{ (matrix.database == 'Postgres') && 1 || '' }} WORKERS=${{ (matrix.arrangement == 'workers') && 1 || '' }} COMPLEMENT_DIR=`pwd`/complement synapse/scripts-dev/complement.sh -json 2>&1 | synapse/.ci/scripts/gotestfmt
  136. shell: bash
  137. name: Run Complement Tests
  138. # open an issue if the build fails, so we know about it.
  139. open-issue:
  140. if: failure()
  141. needs:
  142. - mypy
  143. - trial
  144. - sytest
  145. - complement
  146. runs-on: ubuntu-latest
  147. steps:
  148. - uses: actions/checkout@v3
  149. - uses: JasonEtco/create-an-issue@e27dddc79c92bc6e4562f268fffa5ed752639abd # v2.9.1
  150. env:
  151. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  152. with:
  153. update_existing: true
  154. filename: .ci/twisted_trunk_build_failed_issue_template.md