ci.yml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. name: CI
  2. on:
  3. workflow_call:
  4. workflow_dispatch:
  5. push:
  6. branches:
  7. - "**"
  8. tags:
  9. - "v*.*.*"
  10. paths-ignore:
  11. - "**/*.md"
  12. - "**/*.yaml"
  13. pull_request:
  14. branches:
  15. - "**"
  16. paths-ignore:
  17. - "**/*.md"
  18. - "**/*.yaml"
  19. jobs:
  20. golangci-lint-aiproxy:
  21. name: Lint AI Proxy
  22. runs-on: ubuntu-24.04
  23. steps:
  24. - name: Checkout
  25. uses: actions/checkout@v4
  26. - name: Setup Go
  27. uses: actions/setup-go@v5
  28. with:
  29. go-version-file: "core/go.mod"
  30. - name: Go test
  31. working-directory: core
  32. run: |
  33. go test -v -timeout 30s -count=1 ./...
  34. - name: Run Linter
  35. uses: golangci/golangci-lint-action@v8
  36. with:
  37. version: latest
  38. working-directory: core
  39. args: --color always
  40. - name: Run Fix Linter
  41. uses: golangci/golangci-lint-action@v8
  42. if: ${{ failure() }}
  43. with:
  44. install-mode: none
  45. working-directory: core
  46. args: --fix --color always
  47. - name: Auto Fix Diff Content
  48. if: ${{ failure() }}
  49. run: |
  50. git diff --color=always
  51. exit 1
  52. golangci-lint-mcpservers:
  53. name: Lint MCP Servers
  54. runs-on: ubuntu-24.04
  55. steps:
  56. - name: Checkout
  57. uses: actions/checkout@v4
  58. - name: Setup Go
  59. uses: actions/setup-go@v5
  60. with:
  61. go-version-file: "mcp-servers/go.mod"
  62. - name: Go test
  63. working-directory: mcp-servers
  64. run: |
  65. go test -v -timeout 30s -count=1 ./...
  66. - name: Run Linter
  67. uses: golangci/golangci-lint-action@v8
  68. with:
  69. version: latest
  70. working-directory: mcp-servers
  71. args: --color always
  72. - name: Run Fix Linter
  73. uses: golangci/golangci-lint-action@v8
  74. if: ${{ failure() }}
  75. with:
  76. install-mode: none
  77. working-directory: mcp-servers
  78. args: --fix --color always
  79. - name: Auto Fix Diff Content
  80. if: ${{ failure() }}
  81. run: |
  82. git diff --color=always
  83. exit 1
  84. golangci-lint-openapimcp:
  85. name: Lint OpneAPI MCP
  86. runs-on: ubuntu-24.04
  87. steps:
  88. - name: Checkout
  89. uses: actions/checkout@v4
  90. - name: Setup Go
  91. uses: actions/setup-go@v5
  92. with:
  93. go-version-file: "openapi-mcp/go.mod"
  94. - name: Run Linter
  95. uses: golangci/golangci-lint-action@v8
  96. with:
  97. version: latest
  98. working-directory: openapi-mcp
  99. args: --color always
  100. - name: Run Fix Linter
  101. uses: golangci/golangci-lint-action@v8
  102. if: ${{ failure() }}
  103. with:
  104. install-mode: none
  105. working-directory: openapi-mcp
  106. args: --fix --color always
  107. - name: Auto Fix Diff Content
  108. if: ${{ failure() }}
  109. run: |
  110. git diff --color=always
  111. exit 1