-
Notifications
You must be signed in to change notification settings - Fork 3
156 lines (151 loc) · 4.96 KB
/
ci.yml
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: CI
on:
workflow_call:
inputs:
check-infra:
description: 'Check Infrastructure'
type: boolean
default: true
check-app:
description: 'Check App'
type: boolean
default: true
rust-test-args:
description: 'The arguments to pass to the Rust test command'
type: string
default: '--all-features --lib --bins'
rust-test-suites:
description: 'Extra Rust test suites to run'
type: string
default: ''
rust-toolchain:
description: 'The Rust version to use'
type: string
default: ${{ vars.RUST_VERSION }}
rust-toolchain-formatting:
description: 'The Rust version to use to check formatting'
type: string
default: 'stable'
rust-toolchain-udeps:
description: 'The Rust version to use to run udeps'
type: string
default: 'nightly'
check-udeps:
description: Enable checking for unusued dependencies
type: boolean
default: true
rust-backtrace:
description: 'The Rust backtrace settings'
type: string
default: 'full'
rust-install-protoc:
description: 'Install `protoc` before running rust tests'
type: boolean
default: true
rust-use-sccache:
description: 'Run `sccache-cache` before running rust tests'
type: boolean
default: true
rust-use-postgresql:
description: 'Run postgresql before running rust tests'
type: boolean
default: false
rust-test-env-vars:
description: 'The environment variables to set for the Rust tests'
type: string
default: ''
version:
description: 'The image version to use in the ECS task definition'
type: string
default: 'latest'
infra-stages:
description: 'The environments to plan against'
type: string
default: >
[
{
name: "staging",
url: "https://staging.${{ vars.SUBDOMAIN_NAME }}.walletconnect.com/health"
},
{
name: "prod",
url: "https://${{ vars.SUBDOMAIN_NAME }}.walletconnect.com/health"
}
]
grafana-workspace-name:
description: 'The name of the Grafana workspace for the monitoring deployment'
type: string
default: ${{ vars.GRAFANA_WORKSPACE_NAME }}
tf-directory:
description: 'The directory containing the Terraform files'
type: string
default: ${{ vars.TF_DIRECTORY }}
tf-variables:
description: 'The values of the dynamic Terraform variables'
type: string
default: ''
aws-region:
description: 'The AWS region to deploy to'
type: string
default: ${{ vars.AWS_REGION }}
aws-role-monitoring-arn:
description: 'The ARN of the AWS role to assume for the monitoring deployment'
type: string
default: ${{ vars.AWS_ROLE_MONITORING }}
run-label:
description: 'The run label to use for the actions'
type: string
default: 'ubuntu-latest'
secrets:
TF_API_TOKEN:
required: true
permissions:
contents: read
id-token: write
jobs:
check-app:
name: Check App
uses: ./.github/workflows/ci-check-app.yml
if: ${{ inputs.check-app }}
secrets: inherit
with:
test-args: ${{ inputs.rust-test-args }}
test-suites: ${{ inputs.rust-test-suites }}
rust-toolchain: ${{ inputs.rust-toolchain }}
rust-toolchain-formatting: ${{ inputs.rust-toolchain-formatting }}
rust-toolchain-udeps: ${{ inputs.rust-toolchain-udeps }}
check-udeps: ${{ inputs.check-udeps }}
rust-backtrace: ${{ inputs.rust-backtrace }}
install-protoc: ${{ inputs.rust-install-protoc }}
use-sccache: ${{ inputs.rust-use-sccache }}
use-postgresql: ${{ inputs.rust-use-postgresql }}
test-env-vars: ${{ inputs.rust-test-env-vars }}
run-label: ${{ inputs.run-label }}
check-infra:
name: Check Infra
uses: ./.github/workflows/ci-check-infra.yml
if: ${{ inputs.check-infra }}
secrets: inherit
with:
stage: staging
tf-directory: ${{ inputs.tf-directory }}
run-label: ${{ inputs.run-label }}
plan-infra:
name: Plan Infra ❱❱ ${{ matrix.stage.name }}
needs: [ check-infra ]
secrets: inherit
strategy:
fail-fast: false
matrix:
stage: ${{ fromJson(inputs.infra-stages) }}
uses: ./.github/workflows/ci-plan-infra.yml
with:
version: ${{ inputs.version }}
stage: ${{ matrix.stage.name }}
stage-url: ${{ matrix.stage.url }}
grafana-workspace-name: ${{ inputs.grafana-workspace-name }}
tf-directory: ${{ inputs.tf-directory }}
tf-variables: ${{ inputs.tf-variables }}
aws-region: ${{ inputs.aws-region }}
aws-role-monitoring-arn: ${{ inputs.aws-role-monitoring-arn }}
run-label: ${{ inputs.run-label }}