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.7KB

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