diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index 3c2752c1f..a0fbc78cc 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -20,7 +20,7 @@ on: workflow_dispatch: inputs: testbeds: - default: '["basic-01","basic-02"]' + default: 'basic-01,basic-02' description: 'Testbed(s) to test' required: false @@ -117,12 +117,11 @@ jobs: - name: generate-matrix id: set-matrix run: | - set -x - TESTBEDS="${{ github.event.inputs.testbeds || '[\"basic-01\",\"basic-02\"]' }}" - echo "$TESTBEDS" - TESTBED_ARRAY=$(echo "$TESTBEDS" | jq -c 'map({"testbed":.})') - echo "$TESTBED_ARRAY" - echo "::set-output name=matrix::{\"include\":${TESTBED_ARRAY}}" + TESTBEDS="${{ github.event.inputs.testbeds || 'basic-01,basic-02' }}" + # convert to JSON array + TESTBEDS=$(echo $TESTBEDS | sed "s/,/\",\"/g" | sed 's/^/[\"/g' | sed 's/$/\"]/g') + TESTBEDS=$(echo "$TESTBEDS" | jq -c 'map({"testbed":.})') + echo "::set-output name=matrix::{\"include\":${TESTBEDS}}" test: runs-on: ubuntu-latest diff --git a/.github/workflows/sanity.yml b/.github/workflows/sanity.yml index 3a0669e72..e8670d976 100644 --- a/.github/workflows/sanity.yml +++ b/.github/workflows/sanity.yml @@ -20,7 +20,7 @@ on: workflow_dispatch: inputs: testbeds: - default: '["basic-01","basic-02"]' + default: 'basic-01,basic-02' description: 'Testbed(s) to test' required: false marker_expression: @@ -123,12 +123,10 @@ jobs: - name: generate-matrix id: set-matrix run: | - set -x - TESTBEDS="${{ github.event.inputs.testbeds || '[\"basic-01\",\"basic-02\"]' }}" - echo "$TESTBEDS" - TESTBED_ARRAY=$(echo "$TESTBEDS" | jq -c 'map({"testbed":.})') - echo "$TESTBED_ARRAY" - echo "::set-output name=matrix::{\"include\":${TESTBED_ARRAY}}" + TESTBEDS="${{ github.event.inputs.testbeds || 'basic-01,basic-02' }}" + TESTBEDS=$(echo $TESTBEDS | sed "s/,/\",\"/g" | sed 's/^/[\"/g' | sed 's/$/\"]/g') + TESTBEDS=$(echo "$TESTBEDS" | jq -c 'map({"testbed":.})') + echo "::set-output name=matrix::{\"include\":${TESTBEDS}}" test: runs-on: ubuntu-latest