build_and_test_ya.yml 3.0 KB

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