From e99eea501d1c77895f07b24a554651fab2275d59 Mon Sep 17 00:00:00 2001 From: Joshua Gilman Date: Thu, 29 Aug 2024 18:52:26 -0400 Subject: [PATCH] wip: adds blueprint dumping --- .github/workflows/test.yml | 7 ++++++- blueprint.cue | 1 + forge/actions/blueprint/action.yml | 19 +++++++++++++++++++ forge/actions/forge/action.yml | 19 +++++++++++++++++++ 4 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 blueprint.cue create mode 100644 forge/actions/blueprint/action.yml create mode 100644 forge/actions/forge/action.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 59ce40d..6cd73e7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,5 +9,10 @@ jobs: - uses: actions/checkout@v4 - name: Install Forge CLI uses: ./forge/actions/install + - name: Dump blueprint + id: blueprint + uses: ./forge/actions/blueprint with: - local: "true" \ No newline at end of file + path: . + - name: Print result + run: echo '${{ steps.blueprint.outputs.json }}' \ No newline at end of file diff --git a/blueprint.cue b/blueprint.cue new file mode 100644 index 0000000..d847aec --- /dev/null +++ b/blueprint.cue @@ -0,0 +1 @@ +version: "1.0" diff --git a/forge/actions/blueprint/action.yml b/forge/actions/blueprint/action.yml new file mode 100644 index 0000000..6331f44 --- /dev/null +++ b/forge/actions/blueprint/action.yml @@ -0,0 +1,19 @@ +name: Dump Blueprint +description: Dumps blueprint files to JSON +inputs: + path: + description: Path to the root folder + default: "." +outputs: + json: + description: The blueprint in JSON form + value: ${{ steps.run.outputs.json }} +runs: + using: composite + steps: + - name: Run + id: run + shell: bash + run: | + OUTPUT=$(forge blueprint dump ${{ inputs.path }} 2> >(tee /dev/stderr)) + echo "json=$(echo $OUTPUT | jq -c)" >> GITHUB_OUTPUT diff --git a/forge/actions/forge/action.yml b/forge/actions/forge/action.yml new file mode 100644 index 0000000..92d47ef --- /dev/null +++ b/forge/actions/forge/action.yml @@ -0,0 +1,19 @@ +name: Run Forge CLI +description: Run the Forge CLI +inputs: + command: + description: The command to run + required: true + args: + description: The arguments to pass to the command +outputs: + result: + description: The result of the command + value: "" +runs: + using: composite + steps: + - name: Run + shell: bash + run: | + OUTPUT=$(forge ${{inputs.command}} ${{inputs.args}} | tee )