-
Notifications
You must be signed in to change notification settings - Fork 1
184 lines (152 loc) · 5.53 KB
/
pull-request-develop.yml
File metadata and controls
184 lines (152 loc) · 5.53 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
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
name: pull-request-develop
permissions:
contents: read
pull-requests: write
on:
pull_request:
branches:
- develop
- staging
merge_group:
jobs:
fast-tests:
name: Unit Tests and Bindings Check
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Nix
uses: smartcontractkit/.github/actions/setup-nix@01d931b0455a754d12e7143cc54a5a3521a8f6f6 # setup-nix@0.3.2
- name: Run Unit Tests
run: |
nix develop --command task test:unit
- name: Check Generated Bindings
run: |
nix develop --command task bindings:generate
- name: Check bindings diff
id: diff
run: |
if [[ -n "$(git status --porcelain)" ]]; then
echo "binding_diff=1" >> "$GITHUB_OUTPUT"
else
echo "binding_diff=0" >> "$GITHUB_OUTPUT"
fi
- name: Comment if changes exist
id: comment
if: ${{ steps.diff.outputs.binding_diff != '0' }}
uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 # v2.5.0
with:
message: |
Hello, @${{ github.actor }}! :wave:
This Pull Request requires regenerating the contract bindings
Run:
- `nix develop -c task bindings:generate`
- Commit the updates
- name: Fail if outdated
if: ${{ steps.diff.outputs.binding_diff != '0' }}
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
core.setFailed('Contract bindings are outdated. Please run `nix develop -c task bindings:generate` and commit the changes.')
integration-tests:
name: Integration Tests (Bindings + Operations + Relayer)
runs-on: ubuntu-latest
# Add PostgreSQL service for tests that need database
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: chainlink_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Nix
uses: smartcontractkit/.github/actions/setup-nix@01d931b0455a754d12e7143cc54a5a3521a8f6f6 # setup-nix@0.3.2
- name: Setup Sui Environment
run: |
nix develop --command sui genesis --force --with-faucet
- name: Run Bindings Integration Tests
env:
TEST_DB_URL: postgres://localhost:5432/chainlink_test?sslmode=disable&user=postgres&password=postgres
run: |
nix develop --command go test -v ./bindings/... -tags="integration"
- name: Run Operations Tests
env:
TEST_DB_URL: postgres://localhost:5432/chainlink_test?sslmode=disable&user=postgres&password=postgres
run: |
cd deployment/ops
nix develop --command go test -v ./... -count=1 -p=1 -tags="integration"
- name: Run Relayer Integration Tests
env:
TEST_DB_URL: postgres://localhost:5432/chainlink_test?sslmode=disable&user=postgres&password=postgres
run: |
cd relayer && nix develop --command go test -count=1 -p=1 -tags="integration" ./...
system-integration-tests:
name: System Integration Tests (Full E2E Scenarios)
runs-on: ubuntu-latest
# Add PostgreSQL service for tests that need database
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: chainlink_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Nix
uses: smartcontractkit/.github/actions/setup-nix@01d931b0455a754d12e7143cc54a5a3521a8f6f6 # setup-nix@0.3.2
- name: Setup Sui Environment
run: |
nix develop --command sui genesis --force --with-faucet
- name: Run System Integration Tests
env:
TEST_DB_URL: postgres://localhost:5432/chainlink_test?sslmode=disable&user=postgres&password=postgres
run: |
cd integration-tests
nix develop --command go test -count=1 -p=1 -tags="integration" ./...
testnet-integration-tests:
name: Testnet Integration Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Nix
uses: smartcontractkit/.github/actions/setup-nix@01d931b0455a754d12e7143cc54a5a3521a8f6f6 # setup-nix@0.3.2
- name: Run Integration Tests (Testnet)
run: |
nix develop --command task test:integration-testnet
check-tidy:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Nix
uses: smartcontractkit/.github/actions/setup-nix@01d931b0455a754d12e7143cc54a5a3521a8f6f6 # setup-nix@0.3.2
- name: Ensure modules are tidy
run: |
nix develop -c go tool gomods tidy
git add --all
git diff --minimal --cached --exit-code
- name: Ensure go.md is up to date
run: |
nix develop -c ./scripts/modgraph.sh > go.md
git add --all
git diff --minimal --cached --exit-code