diff --git a/.github/workflows/build_push.yml b/.github/workflows/build_push.yml index bd027f81..e4ff3c68 100644 --- a/.github/workflows/build_push.yml +++ b/.github/workflows/build_push.yml @@ -17,15 +17,13 @@ concurrency: env: CI_CHUNK_SIZE: 288 - TOTAL_CHUNKS: 4 jobs: prepare: name: Prepare job runs-on: docker - strategy: - matrix: - chunk: [0, 1, 2, 3] + outputs: + individualMatrix: ${{ steps.generate-matrices.outputs.individualMatrix }} steps: - name: Clone repo uses: https://github.com/actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 @@ -33,10 +31,11 @@ jobs: ref: main token: ${{ secrets.BOT_PAT }} - - name: Run only for chunk ${{ matrix.chunk }} + - name: Get number of modules run: | - echo "Processing chunk ${{ matrix.chunk }} of $TOTAL_CHUNKS" - ./split_test.sh ${{ matrix.chunk }} $TOTAL_CHUNKS + set -x + projects=(src/*/*) + echo "NUM_INDIVIDUAL_MODULES=${#projects[@]}" >> "$GITHUB_ENV" # Temporary pause because of leak of tj-actions/changed-files # - name: Find lib changes @@ -63,6 +62,20 @@ jobs: # chmod +x ./.github/scripts/bump-versions.py # ./.github/scripts/bump-versions.py ${{ steps.modified-libs.outputs.all_changed_files }} + - id: generate-matrices + name: Create output matrices + uses: https://github.com/actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7 + with: + script: | + const numIndividualModules = process.env.NUM_INDIVIDUAL_MODULES; + const chunkSize = process.env.CI_CHUNK_SIZE; + + const numIndividualChunks = 1; + + console.log(`Individual modules: ${numIndividualModules} (${numIndividualChunks} chunks of ${chunkSize})`); + + core.setOutput('individualMatrix', { 'chunk': [...Array(numIndividualChunks).keys()] }); + build_individual: name: Build individual modules needs: prepare