1
0

twisted_trunk.yml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. name: Twisted Trunk
  2. on:
  3. schedule:
  4. - cron: 0 8 * * *
  5. workflow_dispatch:
  6. inputs:
  7. twisted_ref:
  8. description: Commit, branch or tag to checkout from upstream Twisted.
  9. required: false
  10. default: 'trunk'
  11. type: string
  12. concurrency:
  13. group: ${{ github.workflow }}-${{ github.ref }}
  14. cancel-in-progress: true
  15. jobs:
  16. mypy:
  17. runs-on: ubuntu-latest
  18. steps:
  19. - uses: actions/checkout@v3
  20. - name: Install Rust
  21. uses: dtolnay/rust-toolchain@stable
  22. - uses: Swatinem/rust-cache@v2
  23. - uses: matrix-org/setup-python-poetry@v1
  24. with:
  25. python-version: "3.x"
  26. extras: "all"
  27. - run: |
  28. poetry remove twisted
  29. poetry add --extras tls git+https://github.com/twisted/twisted.git#${{ inputs.twisted_ref }}
  30. poetry install --no-interaction --extras "all test"
  31. - name: Remove warn_unused_ignores from mypy config
  32. run: sed '/warn_unused_ignores = True/d' -i mypy.ini
  33. - run: poetry run mypy
  34. trial:
  35. runs-on: ubuntu-latest
  36. steps:
  37. - uses: actions/checkout@v3
  38. - run: sudo apt-get -qq install xmlsec1
  39. - name: Install Rust
  40. uses: dtolnay/rust-toolchain@stable
  41. - uses: Swatinem/rust-cache@v2
  42. - uses: matrix-org/setup-python-poetry@v1
  43. with:
  44. python-version: "3.x"
  45. extras: "all test"
  46. - run: |
  47. poetry remove twisted
  48. poetry add --extras tls git+https://github.com/twisted/twisted.git#trunk
  49. poetry install --no-interaction --extras "all test"
  50. - run: poetry run trial --jobs 2 tests
  51. - name: Dump logs
  52. # Logs are most useful when the command fails, always include them.
  53. if: ${{ always() }}
  54. # Note: Dumps to workflow logs instead of using actions/upload-artifact
  55. # This keeps logs colocated with failing jobs
  56. # It also ignores find's exit code; this is a best effort affair
  57. run: >-
  58. find _trial_temp -name '*.log'
  59. -exec echo "::group::{}" \;
  60. -exec cat {} \;
  61. -exec echo "::endgroup::" \;
  62. || true
  63. sytest:
  64. runs-on: ubuntu-latest
  65. container:
  66. image: matrixdotorg/sytest-synapse:buster
  67. volumes:
  68. - ${{ github.workspace }}:/src
  69. steps:
  70. - uses: actions/checkout@v3
  71. - name: Install Rust
  72. uses: dtolnay/rust-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. - uses: actions/setup-go@v4
  122. - name: Prepare Complement's Prerequisites
  123. run: synapse/.ci/scripts/setup_complement_prerequisites.sh
  124. # This step is specific to the 'Twisted trunk' test run:
  125. - name: Patch dependencies
  126. run: |
  127. set -x
  128. DEBIAN_FRONTEND=noninteractive sudo apt-get install -yqq python3 pipx
  129. pipx install poetry==1.3.2
  130. poetry remove -n twisted
  131. poetry add -n --extras tls git+https://github.com/twisted/twisted.git#trunk
  132. poetry lock --no-update
  133. working-directory: synapse
  134. - run: |
  135. set -o pipefail
  136. 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
  137. shell: bash
  138. name: Run Complement Tests
  139. # open an issue if the build fails, so we know about it.
  140. open-issue:
  141. if: failure()
  142. needs:
  143. - mypy
  144. - trial
  145. - sytest
  146. - complement
  147. runs-on: ubuntu-latest
  148. steps:
  149. - uses: actions/checkout@v3
  150. - uses: JasonEtco/create-an-issue@e27dddc79c92bc6e4562f268fffa5ed752639abd # v2.9.1
  151. env:
  152. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  153. with:
  154. update_existing: true
  155. filename: .ci/twisted_trunk_build_failed_issue_template.md