You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pull-compliance.yml 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. name: compliance
  2. on:
  3. pull_request:
  4. concurrency:
  5. group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
  6. cancel-in-progress: true
  7. jobs:
  8. files-changed:
  9. uses: ./.github/workflows/files-changed.yml
  10. lint-backend:
  11. if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
  12. needs: files-changed
  13. runs-on: ubuntu-latest
  14. steps:
  15. - uses: actions/checkout@v4
  16. - uses: actions/setup-go@v5
  17. with:
  18. go-version-file: go.mod
  19. check-latest: true
  20. - run: make deps-backend deps-tools
  21. - run: make lint-backend
  22. env:
  23. TAGS: bindata sqlite sqlite_unlock_notify
  24. lint-templates:
  25. if: needs.files-changed.outputs.templates == 'true'
  26. needs: files-changed
  27. runs-on: ubuntu-latest
  28. steps:
  29. - uses: actions/checkout@v4
  30. - uses: actions/setup-python@v5
  31. with:
  32. python-version: "3.12"
  33. - uses: actions/setup-node@v4
  34. with:
  35. node-version: 20
  36. - run: pip install poetry
  37. - run: make deps-py
  38. - run: make deps-frontend
  39. - run: make lint-templates
  40. lint-yaml:
  41. if: needs.files-changed.outputs.yaml == 'true'
  42. needs: files-changed
  43. runs-on: ubuntu-latest
  44. steps:
  45. - uses: actions/checkout@v4
  46. - uses: actions/setup-python@v5
  47. with:
  48. python-version: "3.12"
  49. - run: pip install poetry
  50. - run: make deps-py
  51. - run: make lint-yaml
  52. lint-swagger:
  53. if: needs.files-changed.outputs.swagger == 'true'
  54. needs: files-changed
  55. runs-on: ubuntu-latest
  56. steps:
  57. - uses: actions/checkout@v4
  58. - uses: actions/setup-node@v4
  59. with:
  60. node-version: 20
  61. - run: make deps-frontend
  62. - run: make lint-swagger
  63. lint-spell:
  64. if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.frontend == 'true' || needs.files-changed.outputs.actions == 'true' || needs.files-changed.outputs.docs == 'true' || needs.files-changed.outputs.templates == 'true'
  65. needs: files-changed
  66. runs-on: ubuntu-latest
  67. steps:
  68. - uses: actions/checkout@v4
  69. - uses: actions/setup-go@v5
  70. with:
  71. go-version-file: go.mod
  72. check-latest: true
  73. - run: make lint-spell
  74. lint-go-windows:
  75. if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
  76. needs: files-changed
  77. runs-on: ubuntu-latest
  78. steps:
  79. - uses: actions/checkout@v4
  80. - uses: actions/setup-go@v5
  81. with:
  82. go-version-file: go.mod
  83. check-latest: true
  84. - run: make deps-backend deps-tools
  85. - run: make lint-go-windows lint-go-vet
  86. env:
  87. TAGS: bindata sqlite sqlite_unlock_notify
  88. GOOS: windows
  89. GOARCH: amd64
  90. lint-go-gogit:
  91. if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
  92. needs: files-changed
  93. runs-on: ubuntu-latest
  94. steps:
  95. - uses: actions/checkout@v4
  96. - uses: actions/setup-go@v5
  97. with:
  98. go-version-file: go.mod
  99. check-latest: true
  100. - run: make deps-backend deps-tools
  101. - run: make lint-go
  102. env:
  103. TAGS: bindata gogit sqlite sqlite_unlock_notify
  104. checks-backend:
  105. if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
  106. needs: files-changed
  107. runs-on: ubuntu-latest
  108. steps:
  109. - uses: actions/checkout@v4
  110. - uses: actions/setup-go@v5
  111. with:
  112. go-version-file: go.mod
  113. check-latest: true
  114. - run: make deps-backend deps-tools
  115. - run: make --always-make checks-backend # ensure the "go-licenses" make target runs
  116. frontend:
  117. if: needs.files-changed.outputs.frontend == 'true' || needs.files-changed.outputs.actions == 'true'
  118. needs: files-changed
  119. runs-on: ubuntu-latest
  120. steps:
  121. - uses: actions/checkout@v4
  122. - uses: actions/setup-node@v4
  123. with:
  124. node-version: 20
  125. - run: make deps-frontend
  126. - run: make lint-frontend
  127. - run: make checks-frontend
  128. - run: make test-frontend
  129. - run: make frontend
  130. backend:
  131. if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
  132. needs: files-changed
  133. runs-on: ubuntu-latest
  134. steps:
  135. - uses: actions/checkout@v4
  136. - uses: actions/setup-go@v5
  137. with:
  138. go-version-file: go.mod
  139. check-latest: true
  140. # no frontend build here as backend should be able to build
  141. # even without any frontend files
  142. - run: make deps-backend
  143. - run: go build -o gitea_no_gcc # test if build succeeds without the sqlite tag
  144. - name: build-backend-arm64
  145. run: make backend # test cross compile
  146. env:
  147. GOOS: linux
  148. GOARCH: arm64
  149. TAGS: bindata gogit
  150. - name: build-backend-windows
  151. run: go build -o gitea_windows
  152. env:
  153. GOOS: windows
  154. GOARCH: amd64
  155. TAGS: bindata gogit
  156. - name: build-backend-386
  157. run: go build -o gitea_linux_386 # test if compatible with 32 bit
  158. env:
  159. GOOS: linux
  160. GOARCH: 386
  161. docs:
  162. if: needs.files-changed.outputs.docs == 'true' || needs.files-changed.outputs.actions == 'true'
  163. needs: files-changed
  164. runs-on: ubuntu-latest
  165. steps:
  166. - uses: actions/checkout@v4
  167. - uses: actions/setup-node@v4
  168. with:
  169. node-version: 20
  170. - run: make deps-frontend
  171. - run: make lint-md
  172. - run: make docs
  173. actions:
  174. if: needs.files-changed.outputs.actions == 'true' || needs.files-changed.outputs.actions == 'true'
  175. needs: files-changed
  176. runs-on: ubuntu-latest
  177. steps:
  178. - uses: actions/checkout@v4
  179. - uses: actions/setup-go@v5
  180. with:
  181. go-version-file: go.mod
  182. check-latest: true
  183. - run: make lint-actions