Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
alliepiper committed Jun 3, 2024
1 parent 73079e9 commit 9299bc6
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 131 deletions.
63 changes: 58 additions & 5 deletions .github/workflows/ci-workflow-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,75 @@ jobs:
${{ env.pr_worflow }}
${{ env.nightly_workflow }}
run-workflow:
name: Run workflow
dispatch-groups-linux-two-stage:
name: ${{ matrix.name }}
needs: build-workflow
permissions:
id-token: write
contents: read
uses: ./.github/workflows/workflow-dispatch.yml
strategy:
fail-fast: false
matrix:
name: ${{ fromJSON(needs.build-workflow.outputs.workflow)['linux_two_stage']['keys'] }}
uses: ./.github/workflows/workflow-dispatch-two-stage-group-linux.yml
with:
workflow: ${{ needs.build-workflow.outputs.workflow }}
name: ${{ matrix.name }}
pc-array: ${{ toJSON(fromJSON(needs.build-workflow.outputs.workflow)['linux_two_stage']['jobs'][matrix.name]) }}

debug-workflow:
name: "Debug workflow"
needs: build-workflow
runs-on: ubuntu-latest
steps:
- name: Debug
shell: bash --noprofile --norc {0}
run: |
WORKFLOW_RAW="$(echo "${{ needs.build-workflow.outputs.workflow }}" | sed 's/\\"/"/g')"
WORKFLOW=$(echo "${WORKFLOW_RAW}" | jq -c .)
TWO_STAGE=$(echo "${WORKFLOW}" | jq -c .linux_two_stage)
KEYS=$(echo "${TWO_STAGE}" | jq -c .keys)
JOBS=$(echo "${TWO_STAGE}" | jq -c .jobs)
echo "Workflow Raw:"
printf "%s\n" "${WORKFLOW_RAW}"
echo
echo "Workflow Raw -> jq:"
printf "%s\n" "${WORKFLOW_RAW}" | jq .
echo
echo "Workflow Parsed:"
printf "%s\n" "${WORKFLOW}"
echo
echo "Workflow Parsed -> jq:"
printf "%s\n" "${WORKFLOW}" | jq .
echo
echo "Two Stage:"
printf "%s\n" "${TWO_STAGE}"
echo
echo "Keys:"
printf "%s\n" "${KEYS}"
echo
echo "Jobs:"
printf "%s\n" "${JOBS}"
echo
# run-workflow:
# name: Run workflow
# needs: build-workflow
# permissions:
# id-token: write
# contents: read
# uses: ./.github/workflows/workflow-dispatch.yml
# with:
# workflow: ${{ needs.build-workflow.outputs.workflow }}

verify-workflow:
name: Verify and summarize workflow results
if: ${{ always() && !cancelled() }}
needs:
- build-workflow
- run-workflow
- dispatch-groups-linux-two-stage
permissions:
contents: read
pull-requests: write # Posts a comment back to the PR.
Expand Down
51 changes: 0 additions & 51 deletions .github/workflows/workflow-dispatch-job-array-linux.yml

This file was deleted.

49 changes: 0 additions & 49 deletions .github/workflows/workflow-dispatch-job-single-linux.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/workflow-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,3 @@ on:
required: true

jobs:
dispatch-groups-linux-two-stage:
if: ${{ fromJSON(inputs.workflow)['linux_two_stage']['keys'] }}
name: ${{ matrix.name }}
permissions:
id-token: write
contents: read
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(inputs.workflow)['linux_two_stage']['keys'] }}
uses: ./.github/workflows/workflow-dispatch-two-stage-group-linux.yml
with:
name: ${{ matrix.name }}
pc-array: ${{ toJSON(fromJSON(inputs.workflow)['linux_two_stage']['jobs'][matrix.name]) }}

debug-workflow:
name: "Debug workflow-dispatch.yml"
runs-on: ubuntu-latest
steps:
- name: Debug
run: |
echo "Debugging workflow:"
echo "Workflow:\n ${{inputs.workflow }}\n\n"
# echo "Linux Two Stage:\n${{ fromJSON(inputs.workflow)['linux_two_stage'] }}\n\n"
# echo "Keys:\n${{ fromJSON(inputs.workflow)['linux_two_stage']['keys'] }}\n\n"
# echo "Jobs:\n${{ fromJSON(inputs.workflow)['linux_two_stage']['jobs'] }}\n\n"

0 comments on commit 9299bc6

Please sign in to comment.