Skip to content

Commit

Permalink
chore(ci): consistent results jobs (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekRoberts authored Sep 14, 2024
1 parent a5a0015 commit b1bbe43
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 13 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,13 @@ jobs:
if: steps.cache-deps.outputs.cache-hit != 'true'

- run: poetry run pytest

results:
name: Analysis Results
needs: [trivy, java, python]
if: always()
runs-on: ubuntu-22.04
steps:
- if: contains(needs.*.result, 'failure')
run: echo "At least one job has failed." && exit 1
- run: echo "Success!"
22 changes: 10 additions & 12 deletions .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ concurrency:
cancel-in-progress: true

jobs:


# https://github.com/bcgov-nr/action-builder-ghcr
builds:
name: Builds
Expand Down Expand Up @@ -57,13 +55,13 @@ jobs:
build_outputs: ${{ needs.builds.outputs.digest }}
tag: ${{ github.event.number }}
release: ${{ github.event.number }}
validate:
name: Validate
needs: [deploys]
if: always() && (!cancelled()) && (!failure())
uses: bcgov/quickstart-openshift-helpers/.github/workflows/.pr-validate.yml@v0.7.0
with:
markdown_links: |
- [Java](https://${{ github.event.repository.name }}-${{ github.event.number }}-backendJava.apps.silver.devops.gov.bc.ca)
- [Py](https://${{ github.event.repository.name }}-${{ github.event.number }}-backendPy.apps.silver.devops.gov.bc.ca)
- [Go](https://${{ github.event.repository.name }}-${{ github.event.number }}-backendGo.apps.silver.devops.gov.bc.ca)

results:
name: PR Results
needs: [builds, deploys]
if: always()
runs-on: ubuntu-22.04
steps:
- if: contains(needs.*.result, 'failure')
run: echo "At least one job has failed." && exit 1
- run: echo "Success!"
10 changes: 9 additions & 1 deletion .github/workflows/pr-validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: PR Validate

on:
pull_request:
types: [edited]
types: [edited, opened, synchronize, reopened, ready_for_review]

concurrency:
group: ${{ github.workflow }}-edit-${{ github.event.number }}
Expand All @@ -17,3 +17,11 @@ jobs:
- [Java](https://${{ github.event.repository.name }}-${{ github.event.number }}-backendJava.apps.silver.devops.gov.bc.ca)
- [Py](https://${{ github.event.repository.name }}-${{ github.event.number }}-backendPy.apps.silver.devops.gov.bc.ca)
- [Go](https://${{ github.event.repository.name }}-${{ github.event.number }}-backendGo.apps.silver.devops.gov.bc.ca)
results:
name: Validate Results
if: always()
needs: [validate]
runs-on: ubuntu-22.04
steps:
- run: echo "Success!"

0 comments on commit b1bbe43

Please sign in to comment.