verify.yml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. name: Verify
  2. on:
  3. push:
  4. branches:
  5. - main
  6. - master
  7. paths-ignore:
  8. - '**/modules/web/**'
  9. pull_request:
  10. paths-ignore:
  11. - '**/modules/web/**'
  12. workflow_dispatch:
  13. permissions:
  14. contents: read
  15. concurrency:
  16. group: verify-${{ github.workflow }}-${{ github.ref }}
  17. cancel-in-progress: true
  18. jobs:
  19. verify:
  20. runs-on: ubuntu-latest
  21. steps:
  22. - name: Checkout
  23. uses: actions/checkout@v5
  24. - name: Set up JDK 21
  25. uses: actions/setup-java@v5
  26. with:
  27. distribution: temurin
  28. java-version: 21
  29. - name: Set up Gradle
  30. uses: gradle/actions/setup-gradle@v4
  31. # 与 auto-release.yml 同一处理:settings.gradle 里的 aliyun 镜像面向国内开发机,
  32. # 在 GitHub runner 上会 502,且 Gradle 一旦判定某仓库失败就整个禁用它。
  33. - name: Remove Aliyun mirrors (unreliable in CI)
  34. run: |
  35. sed -i '/maven.aliyun.com/d' settings.gradle
  36. - name: Run tests, lint, architecture check, and debug build
  37. run: |
  38. chmod +x gradlew
  39. ./gradlew \
  40. testAppDebugUnitTest \
  41. lintAppDebug \
  42. verifyConfigArchitecture \
  43. assembleAppDebug \
  44. --continue \
  45. --no-daemon \
  46. --no-configuration-cache
  47. - name: Upload unit test reports
  48. if: ${{ always() }}
  49. uses: actions/upload-artifact@v4
  50. with:
  51. name: verify-unit-test-reports
  52. if-no-files-found: warn
  53. path: |
  54. app/build/test-results/testAppDebugUnitTest/**
  55. app/build/reports/tests/testAppDebugUnitTest/**
  56. - name: Upload lint reports
  57. if: ${{ always() }}
  58. uses: actions/upload-artifact@v4
  59. with:
  60. name: verify-lint-reports
  61. if-no-files-found: warn
  62. path: |
  63. app/build/reports/lint-results-appDebug.html
  64. app/build/reports/lint-results-appDebug.xml
  65. app/build/reports/lint-results-appDebug.txt
  66. app/build/reports/lint-results-appDebug.sarif