|
| 1 | +name: 🤖 Android |
| 2 | +on: |
| 3 | + workflow_call: |
| 4 | + inputs: |
| 5 | + fullbuild: |
| 6 | + description: "Weather or not to build all targets" |
| 7 | + required: true |
| 8 | + type: boolean |
| 9 | + default: false |
| 10 | + |
| 11 | +env: |
| 12 | + BASE_BRANCH: main |
| 13 | + SCONSFLAGS: "production=yes extra_suffix=luaAPI" |
| 14 | + SCONS_CACHE_LIMIT: 7168 |
| 15 | + GODOT_VERSION: ${{ vars.GODOT_VERSION }}-stable |
| 16 | + |
| 17 | +jobs: |
| 18 | + android-builds: |
| 19 | + runs-on: "ubuntu-20.04" |
| 20 | + name: ${{ matrix.opts.name }} |
| 21 | + strategy: |
| 22 | + fail-fast: false |
| 23 | + matrix: |
| 24 | + opts: |
| 25 | + - name: Android Template (target=template_debug,arch=arm64) |
| 26 | + cache-name: android-debug-arm64 |
| 27 | + artifact-name: android-templates |
| 28 | + build-options: "target=template_debug arch=arm64" |
| 29 | + should-run: true |
| 30 | + |
| 31 | + - name: Android Template (target=template_debug,arch=arm32) |
| 32 | + cache-name: android-debug-arm32 |
| 33 | + artifact-name: android-templates |
| 34 | + build-options: "target=template_debug arch=arm32" |
| 35 | + should-run: ${{ inputs.fullbuild }} |
| 36 | + |
| 37 | + - name: Android Template (target=template_debug,arch=x86_64) |
| 38 | + cache-name: android-debug-x86_64 |
| 39 | + artifact-name: android-templates |
| 40 | + build-options: "target=template_debug arch=x86_64" |
| 41 | + should-run: ${{ inputs.fullbuild }} |
| 42 | + |
| 43 | + - name: Android Template (target=template_debug,arch=x86_32) |
| 44 | + cache-name: android-debug-x86_32 |
| 45 | + artifact-name: android-templates |
| 46 | + build-options: "target=template_debug arch=x86_32" |
| 47 | + should-run: ${{ inputs.fullbuild }} |
| 48 | + |
| 49 | + - name: Android Template (target=template_release,arch=arm64) |
| 50 | + cache-name: android-debug-arm64 |
| 51 | + artifact-name: android-templates |
| 52 | + build-options: "target=template_release arch=arm64" |
| 53 | + should-run: ${{ inputs.fullbuild }} |
| 54 | + |
| 55 | + - name: Android Template (target=template_release,arch=arm32) |
| 56 | + cache-name: android-debug-arm32 |
| 57 | + artifact-name: android-templates |
| 58 | + build-options: "target=template_release arch=arm32" |
| 59 | + should-run: ${{ inputs.fullbuild }} |
| 60 | + |
| 61 | + - name: Android Template (target=template_release,arch=x86_64) |
| 62 | + cache-name: android-debug-x86_64 |
| 63 | + artifact-name: android-templates |
| 64 | + build-options: "target=template_release arch=x86_64" |
| 65 | + should-run: ${{ inputs.fullbuild }} |
| 66 | + |
| 67 | + - name: Android Template (target=template_release,arch=x86_32) |
| 68 | + cache-name: android-debug-x86_32 |
| 69 | + artifact-name: android-templates |
| 70 | + build-options: "target=template_release arch=x86_32" |
| 71 | + should-run: ${{ inputs.fullbuild }} |
| 72 | + |
| 73 | + exclude: |
| 74 | + - {opts: {should-run: false}} |
| 75 | + |
| 76 | + steps: |
| 77 | + - uses: actions/checkout@v3 |
| 78 | + with: |
| 79 | + submodules: recursive |
| 80 | + |
| 81 | + - name: Set up Java 11 |
| 82 | + uses: actions/setup-java@v3 |
| 83 | + with: |
| 84 | + distribution: temurin |
| 85 | + java-version: 11 |
| 86 | + |
| 87 | + - name: Load .scons_cache directory |
| 88 | + uses: actions/cache@v2 |
| 89 | + with: |
| 90 | + path: ${{github.workspace}}/.scons_cache/ |
| 91 | + key: ${{matrix.opts.cache-name}}-${{env.BASE_BRANCH}}-${{github.ref}}-${{github.sha}} |
| 92 | + restore-keys: | |
| 93 | + ${{matrix.opts.cache-name}}-${{env.BASE_BRANCH}}-${{github.ref}}-${{github.sha}} |
| 94 | + ${{matrix.opts.cache-name}}-${{env.BASE_BRANCH}}-${{github.ref}} |
| 95 | + ${{matrix.opts.cache-name}}-${{env.BASE_BRANCH}} |
| 96 | +
|
| 97 | + - name: Set up Python 3.x |
| 98 | + uses: actions/setup-python@v2 |
| 99 | + with: |
| 100 | + python-version: "3.x" |
| 101 | + architecture: "x64" |
| 102 | + |
| 103 | + - name: Configuring Python packages |
| 104 | + run: | |
| 105 | + python -c "import sys; print(sys.version)" |
| 106 | + python -m pip install scons |
| 107 | + python --version |
| 108 | + scons --version |
| 109 | +
|
| 110 | + - name: Compilation |
| 111 | + working-directory: ./scripts |
| 112 | + env: |
| 113 | + SCONS_CACHE: ${{github.workspace}}/.scons_cache/ |
| 114 | + run: | |
| 115 | + scons platform=android ${{ matrix.opts.build-options }} ${{ env.SCONSFLAGS }} |
| 116 | + |
| 117 | + - uses: actions/upload-artifact@v2 |
| 118 | + with: |
| 119 | + name: ${{matrix.opts.artifact-name}} |
| 120 | + path: scripts/godot/platform/android/java/lib/libs/* |
0 commit comments