Skip to content

Commit

Permalink
change workflow call uses so they are independent workflows and not s…
Browse files Browse the repository at this point in the history
…teps
  • Loading branch information
linostar committed Feb 8, 2024
1 parent 5780fd1 commit bfc2f90
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 20 deletions.
25 changes: 19 additions & 6 deletions .github/workflows/Image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -469,13 +469,26 @@ jobs:
path: ${{ needs.prepare-build.outputs.oci-img-path }}/image.yaml
key: ${{ github.run_id }}-image-trigger

- name: Dispatch Releases workflow
uses: canonical/oci-factory/.github/workflows/Release.yaml@main
id: run-releases
with:
oci-image-name: "${{ needs.prepare-build.outputs.oci-img-name }}"
image-trigger-cache-key: "${{ github.run_id }}-image-trigger"
dispatch-releases-workflow:
name: Dispatch Releases workflow
needs: [dispatch-releases]
uses: canonical/oci-factory/.github/workflows/Release.yaml@main
with:
oci-image-name: "${{ needs.prepare-build.outputs.oci-img-name }}"
image-trigger-cache-key: "${{ github.run_id }}-image-trigger"
secrets: inherit

write-dispatch-releases-summary:
name: Write dispatch releases summary
needs: [dispatch-releases-workflow]
runs-on: ubuntu-22.04
if: ${{ needs.prepare-build.outputs.release-to != '' }}
concurrency:
group: ${{ needs.prepare-build.outputs.oci-img-path }}
cancel-in-progress: true
env:
REVISION_DATA_DIR: revision-data
steps:
- name: Write step summary
run: |
url='${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ steps.run-releases.outputs.run-id }}'
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/Release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,19 @@ jobs:


dispatch-documentation:
runs-on: ubuntu-22.04
name: Dispatch documentation
needs: [do-releases]
steps:
- name: Run documentation
uses: canonical/oci-factory/.github/workflows/Documentation.yaml@main
id: run-documentation
with:
oci-image-name: "${{ inputs.oci-image-name }}"
uses: canonical/oci-factory/.github/workflows/Documentation.yaml@main
with:
oci-image-name: "${{ inputs.oci-image-name }}"
secrets: inherit


write-documentation-dispatch-summary:
runs-on: ubuntu-22.04
name: Write documentation dispatch summary
needs: [dispatch-documentation]
steps:
- name: Write step summary
run: |
url='${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ steps.run-documentation.outputs.run-id }}'
Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/_Test-OCI-Factory.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,24 @@ on:

jobs:
test-workflows:
name: Trigger image workflows for ${{ matrix.oci-image }}
strategy:
matrix:
oci-image: [mock-rock]
uses: canonical/oci-factory/.github/workflows/Image.yaml@main
with:
oci-image-name: "${{ matrix.oci-image }}"
upload: true
secrets: inherit

enforce-conclusion:
name: Test OCI Factory workflows
needs: [test-workflows]
runs-on: ubuntu-22.04
strategy:
matrix:
oci-image: [mock-rock]
steps:
- name: Trigger image workflows for ${{ matrix.oci-image }}
uses: canonical/oci-factory/.github/workflows/Image.yaml@main
id: run-image
with:
oci-image-name: "${{ matrix.oci-image }}"
upload: true

- name: Enforce conclusion
if: ${{ steps.run-image.outputs.run-conclusion != 'success' }}
# The previous step doesn't always raise an error
Expand Down

0 comments on commit bfc2f90

Please sign in to comment.