Skip to content

Commit 7dae4db

Browse files
authored
RATIS-2373. Use workflow inputs in run command via environment variable (#1329)
1 parent eb465d5 commit 7dae4db

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.github/workflows/check.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ on:
7979
env:
8080
MAVEN_ARGS: --batch-mode --show-version
8181
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
82+
SCRIPT: ${{ inputs.script }}
8283
WITH_COVERAGE: ${{ github.event_name == 'push' }}
8384

8485
jobs:
@@ -154,15 +155,16 @@ jobs:
154155

155156
- name: Execute tests
156157
run: |
157-
dev-support/checks/${{ inputs.script }}.sh ${{ inputs.script-args }}
158+
$COMMAND
158159
env:
160+
COMMAND: dev-support/checks/${{ inputs.script }}.sh ${{ inputs.script-args }}
159161
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
160162

161163
- name: Summary of failures
162164
if: ${{ failure() }}
163165
run: |
164-
if [[ -s "target/${{ inputs.script }}/summary.txt" ]]; then
165-
cat target/${{ inputs.script }}/summary.txt
166+
if [[ -s "target/$SCRIPT/summary.txt" ]]; then
167+
cat target/$SCRIPT/summary.txt
166168
fi
167169
168170
- name: Archive build results

.github/workflows/repeat-test.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ env:
4747
TEST_METHOD: ${{ github.event.inputs.test-method }}
4848
ITERATIONS: ${{ github.event.inputs.iterations }}
4949
FAIL_FAST: ${{ github.event.inputs.fail-fast }}
50+
SPLITS: ${{ github.event.inputs.splits }}
5051
run-name: ${{ github.event_name == 'workflow_dispatch' && format('{0}#{1}[{2}]-{3}x{4}', inputs.test-class, inputs.test-method, inputs.ref, inputs.splits, inputs.iterations) || '' }}
5152
jobs:
5253
prepare:
@@ -59,7 +60,7 @@ jobs:
5960
name: Generate test matrix
6061
run: |
6162
splits=()
62-
for ((i = 1; i <= ${{ github.event.inputs.splits }}; i++)); do
63+
for ((i = 1; i <= $SPLITS; i++)); do
6364
splits+=("$i")
6465
done
6566
printf -v x "%s," "${splits[@]}"

0 commit comments

Comments
 (0)