PR.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. name: PR Build
  2. on: [pull_request]
  3. jobs:
  4. build:
  5. name: Build on ${{ matrix.os }}
  6. runs-on: ${{ matrix.os }}
  7. env:
  8. CCACHE_DIR: ${{ github.workspace }}/.ccache
  9. CCACHE_COMPILERCHECK: "%compiler% -dumpmachine; %compiler% -dumpversion"
  10. CCACHE_NOHASHDIR: true
  11. CCACHE_MAXSIZE: 1G
  12. strategy:
  13. fail-fast: false
  14. matrix:
  15. os: [ ubuntu-latest, windows-latest ]
  16. steps:
  17. - name: Check out
  18. uses: actions/checkout@v3
  19. with:
  20. submodules: 'recursive'
  21. fetch-depth: 0
  22. - name: Set up JDK 17
  23. uses: actions/setup-java@v3
  24. with:
  25. distribution: 'temurin'
  26. java-version: '17'
  27. cache: 'gradle'
  28. - name: Set up ccache
  29. uses: hendrikmuhs/[email protected]
  30. with:
  31. key: ${{ runner.os }}-${{ github.sha }}
  32. restore-keys: ${{ runner.os }}
  33. - name: Build with Gradle
  34. run: |
  35. echo 'org.gradle.caching=true' >> gradle.properties
  36. echo 'org.gradle.parallel=true' >> gradle.properties
  37. echo 'org.gradle.vfs.watch=true' >> gradle.properties
  38. echo 'org.gradle.jvmargs=-Xmx2048m' >> gradle.properties
  39. echo 'android.native.buildOutput=verbose' >> gradle.properties
  40. ./gradlew assemble
  41. - name: Stop gradle daemon
  42. run: ./gradlew --stop
  43. - name: Upload build artifact
  44. uses: actions/upload-artifact@v3
  45. with:
  46. name: ${{ matrix.os }}-artifact
  47. path: |
  48. app/build/outputs
  49. app/release