build_and_test_ya.yml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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: 56
  30. description: "Test threads count"
  31. link_threads:
  32. type: string
  33. default: 12
  34. description: "link threads count"
  35. test_size:
  36. type: string
  37. default: "small,medium,large"
  38. test_type:
  39. type: string
  40. default: ""
  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. commit_sha:
  52. type: string
  53. default: ""
  54. defaults:
  55. run:
  56. shell: bash
  57. jobs:
  58. main:
  59. name: Build and test ${{ inputs.build_preset }}
  60. runs-on: [ self-hosted, "${{ inputs.runner_label }}", "${{ inputs.runner_additional_label || inputs.runner_label }}"]
  61. steps:
  62. - name: Checkout
  63. uses: actions/checkout@v3
  64. with:
  65. ref: ${{ inputs.commit_sha }}
  66. - name: Setup ydb access
  67. uses: ./.github/actions/setup_ci_ydb_service_account_key_file_credentials
  68. with:
  69. ci_ydb_service_account_key_file_credentials: ${{ secrets.CI_YDB_SERVICE_ACCOUNT_KEY_FILE_CREDENTIALS }}
  70. - name: Build and test
  71. uses: ./.github/actions/build_and_test_ya
  72. with:
  73. build_preset: ${{ inputs.build_preset }}
  74. build_target: ${{ inputs.build_target }}
  75. increment: false
  76. run_tests: ${{ inputs.run_tests }}
  77. test_size: ${{ inputs.test_size }}
  78. test_type: ${{ inputs.test_type }}
  79. test_threads: ${{ inputs.test_threads }}
  80. put_build_results_to_cache: ${{ inputs.put_build_results_to_cache }}
  81. secs: ${{ format('{{"TESTMO_TOKEN":"{0}","AWS_KEY_ID":"{1}","AWS_KEY_VALUE":"{2}","REMOTE_CACHE_USERNAME":"{3}","REMOTE_CACHE_PASSWORD":"{4}"}}',
  82. secrets.TESTMO_TOKEN, secrets.AWS_KEY_ID, secrets.AWS_KEY_VALUE, secrets.REMOTE_CACHE_USERNAME, secrets.REMOTE_CACHE_PASSWORD ) }}
  83. vars: ${{ format('{{"AWS_BUCKET":"{0}","AWS_ENDPOINT":"{1}","REMOTE_CACHE_URL":"{2}","TESTMO_URL":"{3}","TESTMO_PROJECT_ID":"{4}"}}',
  84. vars.AWS_BUCKET, vars.AWS_ENDPOINT, vars.REMOTE_CACHE_URL_YA, vars.TESTMO_URL, vars.TESTMO_PROJECT_ID ) }}