forked from Kohi-den/extensions-source
parent
23cb583570
commit
d7d802d165
1 changed files with 20 additions and 7 deletions
27
.github/workflows/build_push.yml
vendored
27
.github/workflows/build_push.yml
vendored
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue