-
Notifications
You must be signed in to change notification settings - Fork 2
104 lines (94 loc) · 3.1 KB
/
Copy pathpr-open.yml
File metadata and controls
104 lines (94 loc) · 3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Pull Request Open
on:
pull_request:
concurrency:
# PR open and close use the same group, allowing only one at a time
group: pr-${{ github.event.number }}
cancel-in-progress: true
permissions: {}
jobs:
vars:
name: Variables
runs-on: ubuntu-24.04
outputs:
url: ${{ steps.calculate.outputs.url }}
steps:
# steps.calculate.outputs.url => needs.vars.outputs.url
- name: Calculate the deployment number
id: calculate
run: |
echo "url=${{ github.event.repository.name }}-$((${{ github.event.number }} % 50))-frontend.apps.silver.devops.gov.bc.ca" >> $GITHUB_OUTPUT
echo "url=${{ github.event.repository.name }}-$((${{ github.event.number }} % 50))-frontend.apps.silver.devops.gov.bc.ca"
builds:
name: Builds
runs-on: ubuntu-24.04
permissions:
packages: write
id-token: write
attestations: write
strategy:
matrix:
package: [backend, database, frontend, legacy, processor]
steps:
- name: Build
uses: bcgov/action-builder-ghcr@cb2629351c87dd1c2130073e4ebb7233a9653a63 # v4.4.1
with:
package: ${{ matrix.package }}
tag_fallback: latest
triggers: ('${{ matrix.package }}/')
deploy:
name: Deploy (${{ github.event.number }})
needs: [builds]
secrets: inherit
uses: ./.github/workflows/.deploy.yml
with:
oracledb-port: 1521
oracledb-servicename: PR_${{ github.event.number }}
oracledb-username: THE
configmap-backend: |-
features:
staff:
match: true
info:
app:
component: backend
ca:
bc:
gov:
nrs:
idirMaxSubmissions: 65535
otherMaxSubmissions: 65535
configmap-frontend: |-
window.localStorage.setItem(\"VITE_FEATURE_FLAGS\",'{}');
tests:
name: Tests
needs: [deploy, vars]
uses: ./.github/workflows/.automated-tests.yml
permissions:
pull-requests: write
secrets: inherit
with:
url: ${{ needs.vars.outputs.url }}
# ==========================================================================
# 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: [builds, deploy, tests]
if: always()
runs-on: ubuntu-24.04
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!"