-
Notifications
You must be signed in to change notification settings - Fork 6
120 lines (105 loc) · 3.2 KB
/
sub-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
name: ❖ Local CI
on:
workflow_call:
inputs:
check-infra:
description: "Deploy infrastructure"
type: boolean
default: true
check-app:
description: "Deploy app"
type: boolean
default: true
secrets:
PROJECT_ID:
required: true
permissions:
contents: read
id-token: write
issues: read
pull-requests: write
env:
RUST_BACKTRACE: full
jobs:
ci:
name: /
secrets: inherit
uses: WalletConnect/ci_workflows/.github/workflows/[email protected]
with:
check-infra: ${{ inputs.check-infra }}
check-app: ${{ inputs.check-app }}
integration:
name: Integration Tests
if: ${{ inputs.check-app }}
runs-on: ubuntu-latest
env:
PROJECT_ID: ${{ secrets.PROJECT_ID }}
RELAY_DOT_ENV: ${{ secrets.RELAY_DOT_ENV }}
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
services:
postgres:
image: postgres:16
env:
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
options: >-
--mount type=tmpfs,destination=/var/lib/postgresql/data
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:7-alpine
ports:
- 6378:6379
steps:
# https://github.com/orgs/community/discussions/26688#discussioncomment-3252882
- name: "Set some postgres settings"
run: |
docker exec ${{ job.services.postgres.id }} sh -c 'cat /var/lib/postgresql/data/postgresql.conf'
docker exec ${{ job.services.postgres.id }} sh -c 'echo "max_connections=1000" >> /var/lib/postgresql/data/postgresql.conf'
docker kill --signal=SIGHUP ${{ job.services.postgres.id }}
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.RELEASE_PAT }}
- name: Install Rust ${{ vars.RUST_VERSION }}
uses: WalletConnect/actions-rs/[email protected]
with:
toolchain: ${{ vars.RUST_VERSION }}
profile: 'default'
override: true
- name: Install Protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ vars.AWS_ROLE_MAIN }}
aws-region: ${{ vars.AWS_REGION }}
- name: Login to ECR repository
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Install just
run: |
cargo install just
- name: Start relay
env:
RELAY_REGISTRY_API_AUTH_TOKEN: ${{ secrets.REGISTRY_API_AUTH_TOKEN }}
run: |
just --unstable relay run-all-docker
working-directory: rs-relay
- name: Wait for relay to start
run: |
while ! nc -z 127.0.0.1 9010; do sleep 1; done
- name: Integration Tests
uses: WalletConnect/actions-rs/[email protected]
with:
command: test
args: --test integration