Skip to content

feat(schedule2): Schedule 2 print section (Story 20.6) #540

feat(schedule2): Schedule 2 print section (Story 20.6)

feat(schedule2): Schedule 2 print section (Story 20.6) #540

Workflow file for this run

name: PR
on:
pull_request:
concurrency:
group: ${{ github.event.number }}
cancel-in-progress: true
permissions: {}
jobs:
# ZONE for OpenShift objects is the PR number mapped into 0-49, capping how
# many PR environments can exist at once. Images keep the real PR number.
init:
name: Initialize
runs-on: ubuntu-slim
timeout-minutes: 1
outputs:
zone: ${{ steps.zone.outputs.zone }}
steps:
- id: zone
run: echo "zone=$(( ${{ github.event.number }} % 50 ))" >> $GITHUB_OUTPUT
# https://github.com/bcgov/action-builder-ghcr
builds:
name: Builds
permissions:
attestations: write
id-token: write
packages: write
runs-on: ubuntu-24.04
strategy:
matrix:
package: [backend, frontend]
timeout-minutes: 10
steps:
- uses: bcgov/action-builder-ghcr@cb2629351c87dd1c2130073e4ebb7233a9653a63 # v4.4.1
with:
package: ${{ matrix.package }}
# The PR tag is mutable (reused every push) and is what merge.yml
# deploys/promotes; the head SHA tag is immutable and is what PR
# deploys use, so each push changes the pod spec and forces a rollout.
tags: |
${{ github.event.number }}
${{ github.event.pull_request.head.sha }}
tag_fallback: latest
triggers: ('${{ matrix.package }}/', 'common/', '.github/workflows/')
build_args: |
BUILDKIT_INLINE_CACHE=1
deploys:
name: Deploys (${{ github.event.number }})
needs: [builds, init]
uses: ./.github/workflows/reusable-deploy.yml
secrets: inherit
with:
target: ${{ needs.init.outputs.zone }}
tag: ${{ github.event.pull_request.head.sha }}
triggers: ('backend/', 'frontend/', 'common/', '.github/workflows/')
tests:
name: Tests
if: needs.deploys.result == 'success' && needs.deploys.outputs.triggered == 'true'
needs: [deploys, init]
uses: ./.github/workflows/reusable-tests.yml
with:
target: ${{ needs.init.outputs.zone }}
# ==========================================================================
# WARNING: This job acts as the required merge gate for this workflow.
# If you add a new job to this workflow, you MUST add its ID to the 'needs'
# array below, otherwise its failure or cancellation will not block the PR!
# ==========================================================================
results:
name: PR Results
needs: [init, builds, deploys, tests]
if: always()
runs-on: ubuntu-slim
timeout-minutes: 1
steps:
- name: Log Job Results Context
run: |
echo "=== Upstream Job Statuses ==="
echo '${{ toJson(needs) }}'
- name: Evaluate Overall Status
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: |
echo "❌ Critical Check Failure: At least one required job has failed or was cancelled."
exit 1
- name: Success Message
run: echo "✅ All critical checks passed or were intentionally skipped!"