|
| 1 | +name: Reusable Android |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_call: |
| 5 | + inputs: |
| 6 | + arch: |
| 7 | + description: CPU architecture |
| 8 | + required: true |
| 9 | + type: string |
| 10 | + check-name: |
| 11 | + description: A custom name for the Checks API-reported status |
| 12 | + required: false |
| 13 | + type: string |
| 14 | + checkout-ref: |
| 15 | + description: A custom repository committish to fetch from Git |
| 16 | + required: false |
| 17 | + type: string |
| 18 | + checkout-repository: |
| 19 | + description: A custom repository slug to fetch from Git |
| 20 | + required: false |
| 21 | + type: string |
| 22 | + runner-vm-os: |
| 23 | + description: VM OS to use |
| 24 | + required: true |
| 25 | + type: string |
| 26 | + store-built-artifacts: |
| 27 | + default: false |
| 28 | + description: Whether to preserve output as workflow run artifacts |
| 29 | + required: false |
| 30 | + type: boolean |
| 31 | + timeout-minutes: |
| 32 | + description: Deadline for the job to complete |
| 33 | + required: true |
| 34 | + type: number |
| 35 | + outputs: |
| 36 | + steps: |
| 37 | + description: >- |
| 38 | + JSON-formatted collection of all build steps with their outputs |
| 39 | + value: ${{ jobs.build.outputs.steps }} |
| 40 | + |
| 41 | +env: |
| 42 | + FORCE_COLOR: 1 |
| 43 | + ANDROID_CI_SCRIPT_TRIPLET: ${{ inputs.arch }}-linux-android |
| 44 | + |
| 45 | +jobs: |
| 46 | + build: |
| 47 | + name: >- |
| 48 | + ${{ |
| 49 | + inputs.check-name |
| 50 | + && inputs.check-name |
| 51 | + || format( |
| 52 | + '{0}@💻{1}', |
| 53 | + inputs.runner-vm-os, |
| 54 | + inputs.arch |
| 55 | + ) |
| 56 | + }} |
| 57 | +
|
| 58 | + runs-on: ${{ inputs.runner-vm-os }} |
| 59 | + |
| 60 | + timeout-minutes: ${{ inputs.timeout-minutes }} |
| 61 | + |
| 62 | + outputs: |
| 63 | + steps: ${{ toJSON(steps) }} |
| 64 | + |
| 65 | + steps: |
| 66 | + - name: >- |
| 67 | + Fetch CPython source from ${{ |
| 68 | + inputs.checkout-repository |
| 69 | + && inputs.checkout-repository |
| 70 | + || 'Git' |
| 71 | + }}${{ |
| 72 | + inputs.checkout-ref |
| 73 | + && format(' @ {0}', inputs.checkout-ref) |
| 74 | + || '' |
| 75 | + }} |
| 76 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 77 | + with: |
| 78 | + persist-credentials: false |
| 79 | + repository: ${{ inputs.checkout-repository }} |
| 80 | + ref: ${{ inputs.checkout-ref }} |
| 81 | +
|
| 82 | + - name: Build and test |
| 83 | + run: ./Android/android.py ci "${ANDROID_CI_SCRIPT_TRIPLET}" |
| 84 | + |
| 85 | + - name: Upload Built artifacts |
| 86 | + if: inputs.store-built-artifacts |
| 87 | + id: artifacts |
| 88 | + uses: actions/upload-artifact@v4 |
| 89 | + with: |
| 90 | + name: ${{ env.ANDROID_CI_SCRIPT_TRIPLET }} |
| 91 | + path: cross-build/${{ env.ANDROID_CI_SCRIPT_TRIPLET }}/dist/* |
| 92 | + if-no-files-found: error |
0 commit comments