1
0

twisted_trunk.yml 5.0 KB

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