Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): misc updates #745

Merged
merged 6 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ jobs:
trivy:
name: Trivy Security Scan
if: ${{ ! github.event.pull_request.draft }}
needs: [tests]
permissions:
security-events: write
runs-on: ubuntu-24.04
Expand All @@ -60,3 +59,13 @@ jobs:
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: "trivy-results.sarif"

results:
name: Analysis Results
needs: [tests, trivy]
if: always()
runs-on: ubuntu-24.04
steps:
- if: contains(needs.*.result, 'failure')||contains(needs.*.result, 'canceled')
run: echo "At least one job has failed." && exit 1
- run: echo "Success!"
10 changes: 10 additions & 0 deletions .github/workflows/pr-open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,13 @@ jobs:
-p ZONE=${{ github.event.number }} -p TAG=${{ github.event.number }}
${{ matrix.parameters }}
triggers: ('db/' 'libs/' 'api/' 'admin/' 'public/')

results:
name: PR Results
needs: [builds, deploys]
if: always()
runs-on: ubuntu-24.04
steps:
- if: contains(needs.*.result, 'failure')||contains(needs.*.result, 'canceled')
run: echo "At least one job has failed." && exit 1
- run: echo "Success!"
53 changes: 27 additions & 26 deletions .github/workflows/pr-validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,34 @@ concurrency:
permissions: {}

jobs:
pr-description-add:
name: PR Description Add
env:
DOMAIN: apps.silver.devops.gov.bc.ca
PREFIX: ${{ github.event.repository.name }}
init:
name: Initialize
outputs:
mod-tag: ${{ steps.mod-tag.outputs.mod-tag }}
runs-on: ubuntu-24.04
permissions:
pull-requests: write
timeout-minutes: 1
steps:
- name: Get FAM Route
id: fam
run: echo "route=$(( ${{ github.event.number }} % 50 ))" >> $GITHUB_OUTPUT
- name: Get PR Number Mod 50
id: mod-tag
run: echo "mod-tag=$(( ${{ github.event.number }} % 50 ))" >> $GITHUB_OUTPUT

- uses: bcgov-nr/[email protected]
env:
DOMAIN: apps.silver.devops.gov.bc.ca
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
add_markdown: |
---
Thanks for the PR!

Any successful deployments (not always required) will be available below.
- [api](https://fom-${{ steps.fam.outputs.route }}.${{ env.DOMAIN }}/api)
- [admin](https://fom-${{ steps.fam.outputs.route }}.${{ env.DOMAIN }}/admin)
- [public](https://fom-${{ steps.fam.outputs.route }}.${{ env.DOMAIN }}/public)
validate:
name: Validate PR
needs: [init]
permissions:
pull-requests: write
uses: bcgov/quickstart-openshift-helpers/.github/workflows/[email protected]
with:
markdown_links: |
- [api](https://fom-${{ needs.init.outputs.mod-tag }}.apps.silver.devops.gov.bc.ca/api)
- [admin](https://fom-${{ needs.init.outputs.mod-tag }}.apps.silver.devops.gov.bc.ca/admin)
- [public](https://fom-${{ needs.init.outputs.mod-tag }}.apps.silver.devops.gov.bc.ca/public)

Once merged, code will be promoted and handed off to following workflow run.
- [Main Merge Workflow](https://github.com/${{ github.repository }}/actions/workflows/merge-main.yml)
results:
name: Validate Results
if: always()
needs: [validate]
runs-on: ubuntu-24.04
steps:
- if: contains(needs.*.result, 'failure')||contains(needs.*.result, 'canceled')
run: echo "At least one job has failed." && exit 1
- run: echo "Success!"
Loading