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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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@v4
  17. with:
  18. go-version: "~1.21"
  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@v4
  31. with:
  32. python-version: "3.11"
  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@v4
  43. with:
  44. python-version: "3.11"
  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@v3
  55. with:
  56. node-version: 20
  57. - run: make deps-frontend
  58. - run: make lint-swagger
  59. lint-go-windows:
  60. if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
  61. needs: files-changed
  62. runs-on: ubuntu-latest
  63. steps:
  64. - uses: actions/checkout@v4
  65. - uses: actions/setup-go@v4
  66. with:
  67. go-version: "~1.21"
  68. check-latest: true
  69. - run: make deps-backend deps-tools
  70. - run: make lint-go-windows lint-go-vet
  71. env:
  72. TAGS: bindata sqlite sqlite_unlock_notify
  73. GOOS: windows
  74. GOARCH: amd64
  75. lint-go-gogit:
  76. if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
  77. needs: files-changed
  78. runs-on: ubuntu-latest
  79. steps:
  80. - uses: actions/checkout@v4
  81. - uses: actions/setup-go@v4
  82. with:
  83. go-version: "~1.21"
  84. check-latest: true
  85. - run: make deps-backend deps-tools
  86. - run: make lint-go
  87. env:
  88. TAGS: bindata gogit sqlite sqlite_unlock_notify
  89. checks-backend:
  90. if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
  91. needs: files-changed
  92. runs-on: ubuntu-latest
  93. steps:
  94. - uses: actions/checkout@v4
  95. - uses: actions/setup-go@v4
  96. with:
  97. go-version: "~1.21"
  98. check-latest: true
  99. - run: make deps-backend deps-tools
  100. - run: make --always-make checks-backend # ensure the "go-licenses" make target runs
  101. frontend:
  102. if: needs.files-changed.outputs.frontend == 'true' || needs.files-changed.outputs.actions == 'true'
  103. needs: files-changed
  104. runs-on: ubuntu-latest
  105. steps:
  106. - uses: actions/checkout@v4
  107. - uses: actions/setup-node@v3
  108. with:
  109. node-version: 20
  110. - run: make deps-frontend
  111. - run: make lint-frontend
  112. - run: make checks-frontend
  113. - run: make test-frontend
  114. - run: make frontend
  115. backend:
  116. if: needs.files-changed.outputs.backend == 'true' || needs.files-changed.outputs.actions == 'true'
  117. needs: files-changed
  118. runs-on: ubuntu-latest
  119. steps:
  120. - uses: actions/checkout@v4
  121. - uses: actions/setup-go@v4
  122. with:
  123. go-version: "~1.21"
  124. check-latest: true
  125. # no frontend build here as backend should be able to build
  126. # even without any frontend files
  127. - run: make deps-backend
  128. - run: go build -o gitea_no_gcc # test if build succeeds without the sqlite tag
  129. - name: build-backend-arm64
  130. run: make backend # test cross compile
  131. env:
  132. GOOS: linux
  133. GOARCH: arm64
  134. TAGS: bindata gogit
  135. - name: build-backend-windows
  136. run: go build -o gitea_windows
  137. env:
  138. GOOS: windows
  139. GOARCH: amd64
  140. TAGS: bindata gogit
  141. - name: build-backend-386
  142. run: go build -o gitea_linux_386 # test if compatible with 32 bit
  143. env:
  144. GOOS: linux
  145. GOARCH: 386
  146. docs:
  147. if: needs.files-changed.outputs.docs == 'true' || needs.files-changed.outputs.actions == 'true'
  148. needs: files-changed
  149. runs-on: ubuntu-latest
  150. steps:
  151. - uses: actions/checkout@v4
  152. - uses: actions/setup-node@v3
  153. with:
  154. node-version: 20
  155. - run: make deps-frontend
  156. - run: make lint-md
  157. - run: make docs
  158. actions:
  159. if: needs.files-changed.outputs.actions == 'true' || needs.files-changed.outputs.actions == 'true'
  160. needs: files-changed
  161. runs-on: ubuntu-latest
  162. steps:
  163. - uses: actions/checkout@v4
  164. - uses: actions/setup-go@v4
  165. - run: make lint-actions