build_and_test_ya.yml 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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_kind:
  12. type: string
  13. required: true
  14. description: "self-hosted or provisioned"
  15. runner_label:
  16. type: string
  17. default: "linux"
  18. description: "runner label"
  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. jobs:
  49. main:
  50. name: Build and test ${{ inputs.build_preset }}
  51. runs-on: [ self-hosted, "${{ inputs.runner_kind }}", "${{ inputs.runner_label }}" ]
  52. steps:
  53. - name: Checkout PR
  54. uses: actions/checkout@v3
  55. if: github.event.pull_request.head.sha != ''
  56. with:
  57. ref: ${{ github.event.pull_request.head.sha }}
  58. - name: Checkout
  59. uses: actions/checkout@v3
  60. if: github.event.pull_request.head.sha == ''
  61. - name: Prepare s3cmd
  62. uses: ./.github/actions/s3cmd
  63. with:
  64. s3_bucket: ${{ vars.AWS_BUCKET }}
  65. s3_endpoint: ${{ vars.AWS_ENDPOINT }}
  66. s3_key_id: ${{ secrets.AWS_KEY_ID }}
  67. s3_key_secret: ${{ secrets.AWS_KEY_VALUE }}
  68. folder_prefix: ya-
  69. build_preset: ${{ inputs.build_preset }}
  70. - name: Build
  71. uses: ./.github/actions/build_ya
  72. if: inputs.run_build
  73. with:
  74. build_target: ${{ inputs.build_target }}
  75. build_preset: ${{ inputs.build_preset }}
  76. bazel_remote_uri: ${{ vars.REMOTE_CACHE_URL_YA || '' }}
  77. bazel_remote_username: ${{ secrets.REMOTE_CACHE_USERNAME }}
  78. bazel_remote_password: ${{ secrets.REMOTE_CACHE_PASSWORD }}
  79. link_threads: ${{ inputs.link_threads }}
  80. - name: Run tests
  81. uses: ./.github/actions/test_ya
  82. if: inputs.run_tests
  83. with:
  84. build_target: ${{ inputs.build_target }}
  85. build_preset: ${{ inputs.build_preset }}
  86. test_size: ${{ inputs.test_size }}
  87. test_type: ${{ inputs.test_type }}
  88. testman_token: ${{ secrets.TESTMO_TOKEN }}
  89. testman_url: ${{ vars.TESTMO_URL }}
  90. testman_project_id: ${{ vars.TESTMO_PROJECT_ID }}
  91. bazel_remote_uri: ${{ vars.REMOTE_CACHE_URL_YA || '' }}
  92. link_threads: ${{ inputs.link_threads }}
  93. test_threads: ${{ inputs.test_threads }}