mirror of
https://github.com/keiyoushi/extensions-source.git
synced 2024-11-22 10:22:47 +01:00
e69cae57b8
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
77 lines
2.3 KiB
YAML
77 lines
2.3 KiB
YAML
name: PR build check
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- '**'
|
|
- '!**.md'
|
|
- '!.github/**'
|
|
- '.github/workflows/build_pull_request.yml'
|
|
|
|
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
|
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
|
|
|
- name: Validate Gradle Wrapper
|
|
uses: gradle/actions/wrapper-validation@d156388eb19639ec20ade50009f3d199ce1e2808 # v4.1.0
|
|
|
|
- name: Get number of modules
|
|
run: |
|
|
set -x
|
|
projects=(src/*/*)
|
|
|
|
echo "NUM_INDIVIDUAL_MODULES=${#projects[@]}" >> $GITHUB_ENV
|
|
|
|
- id: generate-matrices
|
|
name: Create output matrices
|
|
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
|
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
|
|
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
|
|
|
- name: Set up JDK
|
|
uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 # v4.3.0
|
|
with:
|
|
java-version: 17
|
|
distribution: temurin
|
|
|
|
- name: Set up Gradle
|
|
uses: gradle/actions/setup-gradle@d156388eb19639ec20ade50009f3d199ce1e2808 # v4.1.0
|
|
with:
|
|
cache-read-only: true
|
|
|
|
- name: Build extensions (chunk ${{ matrix.chunk }})
|
|
env:
|
|
CI_CHUNK_NUM: ${{ matrix.chunk }}
|
|
run: ./gradlew -p src assembleDebug
|