From bb7df22d85aca3f56f115bd45fc6690d8443de5a Mon Sep 17 00:00:00 2001 From: Christopher Lindsay Date: Wed, 27 Dec 2023 23:51:33 -0500 Subject: [PATCH] chore: more debugging --- .github/actions/test_matrix/action.yaml | 8 +++-- .github/workflows/test_matrix.yml | 40 ++++++++++++++++++------- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/.github/actions/test_matrix/action.yaml b/.github/actions/test_matrix/action.yaml index 875cca0371..5ba7e093e6 100644 --- a/.github/actions/test_matrix/action.yaml +++ b/.github/actions/test_matrix/action.yaml @@ -86,10 +86,12 @@ runs: echo "DEBUG: Working Directories: ${working_dirs[@]}" echo "DEBUG: Image Names: ${image_names[@]}" + # # Set matrix outputs as JSON + # matrix_json="{\"components\":\"${components[@]}\",\"paths\":\"${paths[@]}\",\"docker_files\":\"${docker_files[@]}\",\"working_dirs\":\"${working_dirs[@]}\",\"image_names\":\"${image_names[@]}\"}" + # echo "DEBUG: Raw matrix output: $matrix_json" + # echo "::set-output name=matrix::$(echo "$matrix_json" | jq -c)" # Set matrix outputs as JSON - matrix_json="{\"components\":\"${components[@]}\",\"paths\":\"${paths[@]}\",\"docker_files\":\"${docker_files[@]}\",\"working_dirs\":\"${working_dirs[@]}\",\"image_names\":\"${image_names[@]}\"}" - echo "DEBUG: Raw matrix output: $matrix_json" - echo "::set-output name=matrix::$(echo "$matrix_json" | jq -c)" + echo "matrix=${components[@]}::${paths[@]}::${docker_files[@]}::${working_dirs[@]}::${image_names[@]}" >> $GITHUB_ENV shell: bash diff --git a/.github/workflows/test_matrix.yml b/.github/workflows/test_matrix.yml index 5ab75d362e..3d54140490 100644 --- a/.github/workflows/test_matrix.yml +++ b/.github/workflows/test_matrix.yml @@ -26,23 +26,43 @@ jobs: with: event: ${{ matrix.event }} + # use-matrix: + # needs: set-matrix + # runs-on: ubuntu-latest + # strategy: + # matrix: ${{fromJson(needs.set-matrix.outputs.matrix)}} + # steps: + # - name: Use matrix + # run: | + # matrix="${{ matrix }}" + # paths="${{ matrix.paths }}" + # docker_files="${{ matrix.docker_files }}" + # working_dirs="${{ matrix.working_dirs }}" + # image_names="${{ matrix.image_names }}" + + # echo "Component: $matrix" + # echo "Paths: $paths" + # echo "Dockerfile: $docker_files" + # echo "Working Directory: $working_dirs" + # echo "Image Name: $image_names" + use-matrix: needs: set-matrix runs-on: ubuntu-latest - strategy: - matrix: ${{fromJson(needs.set-matrix.outputs.matrix)}} steps: - name: Use matrix run: | - matrix="${{ matrix }}" - paths="${{ matrix.paths }}" - docker_files="${{ matrix.docker_files }}" - working_dirs="${{ matrix.working_dirs }}" - image_names="${{ matrix.image_names }}" + matrix="${{ needs.set-matrix.outputs.matrix }}" + IFS='::' read -ra matrix_values <<< "$matrix" + + components="${matrix_values[0]}" + paths="${matrix_values[1]}" + docker_files="${matrix_values[2]}" + working_dirs="${matrix_values[3]}" + image_names="${matrix_values[4]}" - echo "Component: $matrix" + echo "Component: $components" echo "Paths: $paths" echo "Dockerfile: $docker_files" echo "Working Directory: $working_dirs" - echo "Image Name: $image_names" - \ No newline at end of file + echo "Image Name: $image_names" \ No newline at end of file