This is an automated email from the ASF dual-hosted git repository.
zhaojinchao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 0de0912b04b Refactor reusable workflow (#27540)
0de0912b04b is described below
commit 0de0912b04b44dcb7f38596797e4e2adad93e998
Author: 孙念君 Nianjun Sun <[email protected]>
AuthorDate: Fri Jul 28 18:38:16 2023 +0800
Refactor reusable workflow (#27540)
* Refactor : change the cache prefix
* Refactor : refactor the cache value
* Refactor : output the cache log
* Refactor : output the cache log
* Refactor : output the cache log
* Refactor : output the cache log
* Refactor : output the cache log
* Refactor : output the cache log
* Refactor : output the cache log
* Refactor : refactor all workflow for JDK setup
* Refactor : refactor the runnable detect script to make label control
workflow possible
* Refactor : refactor the runnable condition check
* Refactor : refactor the runnable condition check
* Refactor : refactor the runnable condition check
* Refactor : refactor the runnable condition check
* Refactor : refactor the runnable condition check
* Refactor : refactor the runnable condition check
* Refactor : refactor the runnable condition check
* Refactor : refactor the runnable condition check
* Refactor : refactor the runnable condition check
* Refactor : refactor the runnable condition check
* Fix : fix the incorrect shell
* Refactor : refactor the shell log
---
.github/workflows/e2e-operation.yml | 2 +-
.github/workflows/required-reusable.yml | 15 ++++++++++++++-
.../resources/variables/env-variables.properties | 1 +
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/e2e-operation.yml
b/.github/workflows/e2e-operation.yml
index e1860577491..6df23ac0a02 100644
--- a/.github/workflows/e2e-operation.yml
+++ b/.github/workflows/e2e-operation.yml
@@ -74,7 +74,7 @@ jobs:
run: |
echo "skip_current_step=false" >> $GITHUB_ENV
if [[ ${changed_operations} == '["ignore"]' ]]; then
- echo "${current_operation} is ignore by ignore filter"
+ echo "${current_operation} is ignored by ignore filter"
echo "skip_current_step=true" >> $GITHUB_ENV
fi
diff --git a/.github/workflows/required-reusable.yml
b/.github/workflows/required-reusable.yml
index 3f1a09a3ab7..159952a1b9d 100644
--- a/.github/workflows/required-reusable.yml
+++ b/.github/workflows/required-reusable.yml
@@ -42,14 +42,27 @@ jobs:
do
echo ${line} >> $GITHUB_OUTPUT
done
+ echo "GLOBAL_REPOSITORY=${{ env.GLOBAL_REPOSITORY }}"
+ GLOBAL_CACHE_PREFIX=$(echo '${{ env.GLOBAL_REPOSITORY }}' | sed
's/\//_/g')
+ echo "GLOBAL_CACHE_PREFIX=${GLOBAL_CACHE_PREFIX}" >> $GITHUB_OUTPUT
- name: Check If Job is Executable
id: check-job-executable
+ env:
+ JSON_LABELS: ${{ toJSON(github.event.pull_request.labels.*.name) }}
+ shell: sh
run: |
GLOBAL_CACHE_PREFIX=$(echo '${{
steps.import-variables.outputs.GLOBAL_REPOSITORY }}' | sed 's/\//-/g')
echo "GLOBAL_CACHE_PREFIX=${GLOBAL_CACHE_PREFIX}" >> $GITHUB_OUTPUT
if [ ${{ toJSON(github.repository) }} = ${{
steps.import-variables.outputs.GLOBAL_REPOSITORY }} ]; then
- echo "GLOBAL_JOB_ENABLED=true" >> $GITHUB_OUTPUT
echo "GLOBAL_IS_NIGHTLY_JOB_EXECUTABLE=true" >> $GITHUB_OUTPUT
+ echo "GLOBAL_JOB_ENABLED=false" >> $GITHUB_OUTPUT
+ echo '${{ env.JSON_LABELS }}' | while read line
+ do
+ if [ ${line}="type: ${{
steps.import-variables.outputs.RUNNABLE_CI_LABEL }}" ] || [ -z "${{
steps.import-variables.outputs.RUNNABLE_CI_LABEL }}" ]; then
+ echo "GLOBAL_JOB_ENABLED=true" >> $GITHUB_OUTPUT
+ break
+ fi
+ done
fi
outputs:
GLOBAL_RUNS_ON: ${{ steps.import-variables.outputs.GLOBAL_RUNS_ON }}
diff --git a/.github/workflows/resources/variables/env-variables.properties
b/.github/workflows/resources/variables/env-variables.properties
index aa3916cc7b0..6fa4ba00757 100644
--- a/.github/workflows/resources/variables/env-variables.properties
+++ b/.github/workflows/resources/variables/env-variables.properties
@@ -1,2 +1,3 @@
GLOBAL_REPOSITORY=apache/shardingsphere
GLOBAL_RUNS_ON=ubuntu-latest
+RUNNABLE_CI_LABEL=