Skip to content

Commit

Permalink
Added workflow call to allowed inputs to be passed down to reuseable …
Browse files Browse the repository at this point in the history
…workflow.
  • Loading branch information
Ronster2018 committed Nov 5, 2024
1 parent 4882bf4 commit 124fd84
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
22 changes: 8 additions & 14 deletions .github/workflows/cicd-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@ on:
jobs:
test-code:
#TODO: Use Coveralls?
runs-on: ubuntu-latest
steps:
- name: Run test for branch
uses: ./.github/workflows/test-code.yml
with:
ref: ${{inputs.ref}}
name: Run test for branch
uses: ./.github/workflows/test-code.yml
with:
ref: ${{inputs.ref}}
build-image:
runs-on: ubuntu-latest
needs: test-code
Expand All @@ -66,14 +64,10 @@ jobs:
rebuild: ${{ inputs.rebuild }}

test-image:
runs-on: ubuntu-latest
needs: build-image
steps:
- name: Run test for branch
uses: ./.github/workflows/test-image.yml
with:
ref: ${{inputs.ref}}
ghc_img: ${{ needs.build-image.outputs.ghc_img }}
uses: ./.github/workflows/test-image.yml
with:
ref: ${{inputs.ref}}
ghc_img: ${{ needs.build-image.outputs.ghc_img }}
deploy:
needs: [build-image, test-image]
runs-on: ubuntu-latest
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/test-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ on:
ref:
description: Revision or Branch to build
default: main
workflow_call:
inputs:
ref:
description: Revision or Branch to build
default: main
required: true
type: string

jobs:
Test-Code:
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/test-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ on:
ghc_img:
description: The GHCR.io Image to test
required: true
workflow_call:
inputs:
ref:
description: Revision or Branch to build
default: main
required: true
type: string
jobs:
Test-Code:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 124fd84

Please sign in to comment.