build_and_test_ya.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. name: Ya-Build-and-Test
  2. on:
  3. workflow_call:
  4. inputs:
  5. build_target:
  6. type: string
  7. default: "ydb/"
  8. description: "limit build and test to specific target"
  9. build_preset:
  10. type: string
  11. runner_label:
  12. type: string
  13. default: "linux"
  14. description: "runner label"
  15. runner_additional_label:
  16. type: string
  17. default: "linux"
  18. description: "additional runner label, can be empty"
  19. run_build:
  20. type: boolean
  21. default: true
  22. description: "run build"
  23. run_tests:
  24. type: boolean
  25. default: true
  26. description: "run tests"
  27. test_threads:
  28. type: string
  29. default: 28
  30. description: "Test threads count"
  31. link_threads:
  32. type: string
  33. default: 8
  34. description: "link threads count"
  35. test_size:
  36. type: string
  37. default: "small,medium,large"
  38. test_type:
  39. type: string
  40. default: "unittest,py3test,py2test,pytest"
  41. folder_prefix:
  42. type: string
  43. default: "ya-"
  44. cache_tests:
  45. type: boolean
  46. default: false
  47. description: "Use cache for tests"
  48. put_build_results_to_cache:
  49. type: boolean
  50. default: true
  51. jobs:
  52. main:
  53. name: Build and test ${{ inputs.build_preset }}
  54. runs-on: [ self-hosted, "${{ inputs.runner_label }}", "${{ inputs.runner_additional_label || inputs.runner_label }}"]
  55. steps:
  56. - name: Checkout PR
  57. uses: actions/checkout@v3
  58. if: github.event.pull_request.head.sha != ''
  59. with:
  60. ref: ${{ github.event.pull_request.head.sha }}
  61. - name: Checkout
  62. uses: actions/checkout@v3
  63. if: github.event.pull_request.head.sha == ''
  64. - name: Prepare s3cmd
  65. uses: ./.github/actions/s3cmd
  66. with:
  67. s3_bucket: ${{ vars.AWS_BUCKET }}
  68. s3_endpoint: ${{ vars.AWS_ENDPOINT }}
  69. s3_key_id: ${{ secrets.AWS_KEY_ID }}
  70. s3_key_secret: ${{ secrets.AWS_KEY_VALUE }}
  71. folder_prefix: ya-
  72. build_preset: ${{ inputs.build_preset }}
  73. - name: Build
  74. uses: ./.github/actions/build_ya
  75. if: inputs.run_build
  76. with:
  77. build_target: ${{ inputs.build_target }}
  78. build_preset: ${{ inputs.build_preset }}
  79. bazel_remote_uri: ${{ vars.REMOTE_CACHE_URL_YA || '' }}
  80. bazel_remote_username: ${{ inputs.put_build_results_to_cache && secrets.REMOTE_CACHE_USERNAME || '' }}
  81. bazel_remote_password: ${{ inputs.put_build_results_to_cache && secrets.REMOTE_CACHE_PASSWORD || '' }}
  82. link_threads: ${{ inputs.link_threads }}
  83. - name: Run tests
  84. uses: ./.github/actions/test_ya
  85. if: inputs.run_tests
  86. with:
  87. build_target: ${{ inputs.build_target }}
  88. build_preset: ${{ inputs.build_preset }}
  89. test_size: ${{ inputs.test_size }}
  90. test_type: ${{ inputs.test_type }}
  91. testman_token: ${{ secrets.TESTMO_TOKEN }}
  92. testman_url: ${{ vars.TESTMO_URL }}
  93. testman_project_id: ${{ vars.TESTMO_PROJECT_ID }}
  94. bazel_remote_uri: ${{ vars.REMOTE_CACHE_URL_YA || '' }}
  95. link_threads: ${{ inputs.link_threads }}
  96. test_threads: ${{ inputs.test_threads }}