ci(fix): skip flow when there are no changes
``` Error when evaluating 'strategy' for job 'run_emqx_app_tests'. emqx/emqx/.github/workflows/run_emqx_app_tests.yaml@689347f60e5e2e5fc612aa0282c74c0eb26e8281 (Line: 65, Col: 9): Matrix must define at least one vector ```
This commit is contained in:
parent
99ea63b25a
commit
cb3be25ff4
|
@ -35,6 +35,7 @@ jobs:
|
||||||
shell: bash
|
shell: bash
|
||||||
outputs:
|
outputs:
|
||||||
matrix: ${{ steps.matrix.outputs.matrix }}
|
matrix: ${{ steps.matrix.outputs.matrix }}
|
||||||
|
skip: ${{ steps.matrix.outputs.skip }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
|
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
|
||||||
with:
|
with:
|
||||||
|
@ -49,12 +50,16 @@ jobs:
|
||||||
changed_files="$(git diff --name-only ${BEFORE_REF} ${AFTER_REF} apps/emqx)"
|
changed_files="$(git diff --name-only ${BEFORE_REF} ${AFTER_REF} apps/emqx)"
|
||||||
if [ "$changed_files" = '' ]; then
|
if [ "$changed_files" = '' ]; then
|
||||||
echo "nothing changed in apps/emqx, ignored."
|
echo "nothing changed in apps/emqx, ignored."
|
||||||
echo "matrix=[]" | tee -a $GITHUB_OUTPUT
|
echo 'matrix=[]' | tee -a $GITHUB_OUTPUT
|
||||||
|
echo 'skip=true' | tee -a $GITHUB_OUTPUT
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
else
|
||||||
|
echo 'skip=false' | tee -a $GITHUB_OUTPUT
|
||||||
echo 'matrix=[{"type": "eunit_proper_and_static"},{"type": "1_3"},{"type": "2_3"},{"type": "3_3"}]' | tee -a $GITHUB_OUTPUT
|
echo 'matrix=[{"type": "eunit_proper_and_static"},{"type": "1_3"},{"type": "2_3"},{"type": "3_3"}]' | tee -a $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
run_emqx_app_tests:
|
run_emqx_app_tests:
|
||||||
|
if: needs.prepare_matrix.outputs.skip != 'true'
|
||||||
needs:
|
needs:
|
||||||
- prepare_matrix
|
- prepare_matrix
|
||||||
runs-on: ${{ endsWith(github.repository, '/emqx') && 'ubuntu-22.04' || fromJSON('["self-hosted","ephemeral","linux","x64"]') }}
|
runs-on: ${{ endsWith(github.repository, '/emqx') && 'ubuntu-22.04' || fromJSON('["self-hosted","ephemeral","linux","x64"]') }}
|
||||||
|
|
Loading…
Reference in New Issue