summaryrefslogtreecommitdiffstats
path: root/pkg/runner/testdata/.github/workflows
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/runner/testdata/.github/workflows')
-rw-r--r--pkg/runner/testdata/.github/workflows/local-reusable-workflow-no-inputs-array.yml10
-rw-r--r--pkg/runner/testdata/.github/workflows/local-reusable-workflow-no-inputs-string.yml9
-rw-r--r--pkg/runner/testdata/.github/workflows/local-reusable-workflow.yml82
3 files changed, 101 insertions, 0 deletions
diff --git a/pkg/runner/testdata/.github/workflows/local-reusable-workflow-no-inputs-array.yml b/pkg/runner/testdata/.github/workflows/local-reusable-workflow-no-inputs-array.yml
new file mode 100644
index 0000000..3df4ae3
--- /dev/null
+++ b/pkg/runner/testdata/.github/workflows/local-reusable-workflow-no-inputs-array.yml
@@ -0,0 +1,10 @@
+name: reusable
+
+on:
+- workflow_call
+
+jobs:
+ reusable_workflow_job:
+ runs-on: ubuntu-latest
+ steps:
+ - run: echo Test \ No newline at end of file
diff --git a/pkg/runner/testdata/.github/workflows/local-reusable-workflow-no-inputs-string.yml b/pkg/runner/testdata/.github/workflows/local-reusable-workflow-no-inputs-string.yml
new file mode 100644
index 0000000..7558c1c
--- /dev/null
+++ b/pkg/runner/testdata/.github/workflows/local-reusable-workflow-no-inputs-string.yml
@@ -0,0 +1,9 @@
+name: reusable
+
+on: workflow_call
+
+jobs:
+ reusable_workflow_job:
+ runs-on: ubuntu-latest
+ steps:
+ - run: echo Test \ No newline at end of file
diff --git a/pkg/runner/testdata/.github/workflows/local-reusable-workflow.yml b/pkg/runner/testdata/.github/workflows/local-reusable-workflow.yml
new file mode 100644
index 0000000..d32dc5b
--- /dev/null
+++ b/pkg/runner/testdata/.github/workflows/local-reusable-workflow.yml
@@ -0,0 +1,82 @@
+name: reusable
+
+on:
+ workflow_call:
+ inputs:
+ string_required:
+ required: true
+ type: string
+ string_optional:
+ required: false
+ type: string
+ default: string
+ bool_required:
+ required: true
+ type: boolean
+ bool_optional:
+ required: false
+ type: boolean
+ default: true
+ number_required:
+ required: true
+ type: number
+ number_optional:
+ required: false
+ type: number
+ default: ${{ 1 }}
+ outputs:
+ output:
+ description: "A workflow output"
+ value: ${{ jobs.reusable_workflow_job.outputs.job-output }}
+
+jobs:
+ reusable_workflow_job:
+ runs-on: ubuntu-latest
+ steps:
+ - name: test required string
+ run: |
+ echo inputs.string_required=${{ inputs.string_required }}
+ [[ "${{ inputs.string_required == 'string' }}" = "true" ]] || exit 1
+
+ - name: test optional string
+ run: |
+ echo inputs.string_optional=${{ inputs.string_optional }}
+ [[ "${{ inputs.string_optional == 'string' }}" = "true" ]] || exit 1
+
+ - name: test required bool
+ run: |
+ echo inputs.bool_required=${{ inputs.bool_required }}
+ [[ "${{ inputs.bool_required }}" = "true" ]] || exit 1
+
+ - name: test optional bool
+ run: |
+ echo inputs.bool_optional=${{ inputs.bool_optional }}
+ [[ "${{ inputs.bool_optional }}" = "true" ]] || exit 1
+
+ - name: test required number
+ run: |
+ echo inputs.number_required=${{ inputs.number_required }}
+ [[ "${{ inputs.number_required == 1 }}" = "true" ]] || exit 1
+
+ - name: test optional number
+ run: |
+ echo inputs.number_optional=${{ inputs.number_optional }}
+ [[ "${{ inputs.number_optional == 1 }}" = "true" ]] || exit 1
+
+ - name: test secret
+ run: |
+ echo secrets.secret=${{ secrets.secret }}
+ [[ "${{ secrets.secret == 'keep_it_private' }}" = "true" ]] || exit 1
+
+ - name: test github.event_name is never workflow_call
+ run: |
+ echo github.event_name=${{ github.event_name }}
+ [[ "${{ github.event_name != 'workflow_call' }}" = "true" ]] || exit 1
+
+ - name: test output
+ id: output_test
+ run: |
+ echo "value=${{ inputs.string_required }}" >> $GITHUB_OUTPUT
+
+ outputs:
+ job-output: ${{ steps.output_test.outputs.value }}