2024-01-08 23:12:39 +01:00
|
|
|
name: PR build check
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
2024-01-31 18:22:08 +01:00
|
|
|
paths:
|
|
|
|
- '**'
|
|
|
|
- '!**.md'
|
|
|
|
- '!.github/**'
|
|
|
|
- '.github/workflows/build_pull_request.yml'
|
2024-01-08 23:12:39 +01:00
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
env:
|
|
|
|
CI_CHUNK_SIZE: 65
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
prepare:
|
|
|
|
name: Prepare job
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
individualMatrix: ${{ steps.generate-matrices.outputs.individualMatrix }}
|
|
|
|
steps:
|
|
|
|
- name: Clone repo
|
2024-05-19 12:34:22 +02:00
|
|
|
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
2024-01-08 23:12:39 +01:00
|
|
|
|
|
|
|
- name: Validate Gradle Wrapper
|
2024-04-28 05:18:03 +02:00
|
|
|
uses: gradle/actions/wrapper-validation@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2
|
2024-01-08 23:12:39 +01:00
|
|
|
|
|
|
|
- name: Get number of modules
|
|
|
|
run: |
|
|
|
|
set -x
|
2024-02-13 22:43:41 +01:00
|
|
|
projects=(src/*/*)
|
2024-01-08 23:12:39 +01:00
|
|
|
|
2024-02-13 22:43:41 +01:00
|
|
|
echo "NUM_INDIVIDUAL_MODULES=${#projects[@]}" >> $GITHUB_ENV
|
2024-01-08 23:12:39 +01:00
|
|
|
|
|
|
|
- id: generate-matrices
|
|
|
|
name: Create output matrices
|
2024-03-02 03:24:40 +01:00
|
|
|
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
2024-01-08 23:12:39 +01:00
|
|
|
with:
|
|
|
|
script: |
|
|
|
|
const numIndividualModules = process.env.NUM_INDIVIDUAL_MODULES;
|
|
|
|
const chunkSize = process.env.CI_CHUNK_SIZE;
|
|
|
|
|
|
|
|
const numIndividualChunks = Math.ceil(numIndividualModules / chunkSize);
|
|
|
|
|
|
|
|
console.log(`Individual modules: ${numIndividualModules} (${numIndividualChunks} chunks of ${chunkSize})`);
|
|
|
|
|
|
|
|
core.setOutput('individualMatrix', { 'chunk': [...Array(numIndividualChunks).keys()] });
|
|
|
|
|
|
|
|
build_individual:
|
|
|
|
name: Build individual modules
|
|
|
|
needs: prepare
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix: ${{ fromJSON(needs.prepare.outputs.individualMatrix) }}
|
|
|
|
steps:
|
|
|
|
- name: Checkout PR
|
2024-05-19 12:34:22 +02:00
|
|
|
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
2024-01-08 23:12:39 +01:00
|
|
|
|
|
|
|
- name: Set up JDK
|
2024-03-17 01:49:41 +01:00
|
|
|
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
|
2024-01-08 23:12:39 +01:00
|
|
|
with:
|
2024-01-14 21:04:00 +01:00
|
|
|
java-version: 17
|
2024-01-15 09:24:21 +01:00
|
|
|
distribution: temurin
|
2024-01-08 23:12:39 +01:00
|
|
|
|
2024-01-31 13:57:01 +01:00
|
|
|
- name: Set up Gradle
|
2024-04-28 05:18:03 +02:00
|
|
|
uses: gradle/actions/setup-gradle@db19848a5fa7950289d3668fb053140cf3028d43 # v3.3.2
|
2024-01-31 13:57:01 +01:00
|
|
|
with:
|
|
|
|
cache-read-only: true
|
|
|
|
|
2024-01-08 23:12:39 +01:00
|
|
|
- name: Build extensions (chunk ${{ matrix.chunk }})
|
|
|
|
env:
|
|
|
|
CI_CHUNK_NUM: ${{ matrix.chunk }}
|
2024-02-13 23:59:46 +01:00
|
|
|
run: ./gradlew -p src assembleDebug
|