.gitlab-ci.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. variables:
  2. GIT_SUBMODULE_STRATEGY: recursive
  3. stages:
  4. - lint
  5. - build
  6. - test
  7. # encode-check:
  8. # image: "10.143.254.96:5000/xlf/linter:latest"
  9. # tags:
  10. # - docker
  11. # stage: lint
  12. # script:
  13. # - python3 ./.workflow/linter/run-clang-format.py -r -d .
  14. # allow_failure: true
  15. # style-check:
  16. # image: "10.143.254.96:5000/xlf/linter:latest"
  17. # tags:
  18. # - docker
  19. # stage: lint
  20. # script:
  21. # - python3 ./.workflow/linter/run-clang-format.py -r . 1>diff.txt
  22. # artifacts:
  23. # when: on_failure
  24. # name: "diff"
  25. # paths:
  26. # - diff.txt
  27. # allow_failure: true
  28. unit-test:
  29. stage: test
  30. image: "10.143.254.96:5000/xlf/fanbuilder"
  31. tags:
  32. - docker
  33. needs: []
  34. before_script:
  35. - source ~/.xmake/profile
  36. script:
  37. - xmake f -m release
  38. - xmake -w unittest
  39. - xmake run unittest --gtest_output="xml:report.xml"
  40. artifacts:
  41. when: always
  42. reports:
  43. junit: build/linux/x86_64/release/report.xml
  44. allow_failure: true
  45. coverage-test:
  46. stage: test
  47. image: "10.143.254.96:5000/xlf/fanbuilder"
  48. tags:
  49. - docker
  50. needs: []
  51. before_script:
  52. - source ~/.xmake/profile
  53. script:
  54. - xmake f -m coverage
  55. - xmake -w unittest
  56. - xmake run unittest || echo 0 > /dev/null
  57. # - lcov -c -d build/.objs/unittest/linux/x86_64/coverage/app/ -b . -o unittest.info
  58. # - genhtml -o coverage_report unittest.info
  59. - gcovr --xml-pretty --exclude-unreachable-branches --print-summary -o coverage.xml -f "User project/.*" --root ${CI_PROJECT_DIR}
  60. - mkdir coverage_result
  61. - cd coverage_result
  62. - gcovr -r ${CI_PROJECT_DIR} -f "${CI_PROJECT_DIR}/User project/.*" --html --html-details -o index.html
  63. coverage: /^\s*lines:\s*\d+.\d+\%/
  64. artifacts:
  65. name: ${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}
  66. reports:
  67. coverage_report:
  68. coverage_format: cobertura
  69. path: coverage.xml
  70. paths:
  71. - coverage_result/*