[skip ci] Skip some build checks in PRs (#12608)

* [skip ci] Skip some build checks in PRs

* Remove unused line

* [skip ci] Move parsing to the prepare job, make names more consistent
This commit is contained in:
scb261 2022-07-17 18:27:26 +03:00 committed by GitHub
parent 1cf9468e67
commit 8b606a1af1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 27 additions and 0 deletions

View File

@ -15,6 +15,8 @@ jobs:
outputs:
individualMatrix: ${{ steps.generate-matrices.outputs.individualMatrix }}
multisrcMatrix: ${{ steps.generate-matrices.outputs.multisrcMatrix }}
isIndividualChanged: ${{ steps.parse-changed-files.outputs.isIndividualChanged }}
isMultisrcChanged: ${{ steps.parse-changed-files.outputs.isMultisrcChanged }}
env:
CI_MODULE_GEN: true
steps:
@ -61,9 +63,33 @@ jobs:
core.setOutput('individualMatrix', { 'chunk': [...Array(numIndividualChunks).keys()] });
core.setOutput('multisrcMatrix', { 'chunk': [...Array(numMultisrcChunks).keys()] });
- id: get-changed-files
name: Get changed files
uses: jitterbit/get-changed-files@v1
- id: parse-changed-files
name: Parse changed files
run: |
isIndividualChanged=0
isMultisrcChanged=0
for changedFile in ${{ steps.get-changed-files.outputs.all }}; do
if [[ ${changedFile} == src/* ]]; then
isIndividualChanged=1
elif [[ ${changedFile} == multisrc/* ]]; then
isMultisrcChanged=1
else
isIndividualChanged=1
isMultisrcChanged=1
break
fi
done
echo "::set-output name=isIndividualChanged::$isIndividualChanged"
echo "::set-output name=isMultisrcChanged::$isMultisrcChanged"
build_multisrc:
name: Build multisrc modules
needs: prepare
if: ${{ needs.prepare.outputs.isMultisrcChanged == '1' }}
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJSON(needs.prepare.outputs.multisrcMatrix) }}
@ -97,6 +123,7 @@ jobs:
build_individual:
name: Build individual modules
needs: prepare
if: ${{ needs.prepare.outputs.isIndividualChanged == '1' }}
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJSON(needs.prepare.outputs.individualMatrix) }}