-
Notifications
You must be signed in to change notification settings - Fork 3
136 lines (131 loc) · 5.72 KB
/
ccip-integration-test.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
name: "Run CCIP OCR3 Integration Test"
on:
pull_request:
push:
branches:
- 'main'
jobs:
integration-test-matrix:
env:
# We explicitly have this env var not be "CL_DATABASE_URL" to avoid having it be used by core related tests
# when they should not be using it, while still allowing us to DRY up the setup
DB_URL: postgresql://postgres:postgres@localhost:5432/chainlink_test?sslmode=disable
strategy:
fail-fast: false
matrix:
type:
- cmd: cd integration-tests/smoke/ccip && go test ccip_fees_test.go -timeout 12m -test.parallel=2 -count=1 -json
name: "Fees Test"
- cmd: cd integration-tests/smoke/ccip && go test ccip_token_transfer_test.go -timeout 12m -test.parallel=1 -count=1 -json
name: "Token Transfer Test"
- cmd: cd integration-tests/smoke/ccip && go test ccip_usdc_test.go -timeout 12m -test.parallel=1 -count=1 -json
name: "USDC Test"
- cmd: cd integration-tests/smoke/ccip && go test ccip_ooo_execution_test.go -timeout 12m -test.parallel=1 -count=1 -json
name: "OOO Execution Test"
- cmd: cd integration-tests/smoke/ccip && go test ccip_messaging_test.go -timeout 12m -test.parallel=2 -count=1 -json
name: "Messaging Test"
- cmd: cd integration-tests/smoke/ccip && go test ccip_fee_boosting_test.go -timeout 12m -test.parallel=2 -count=1 -json
name: "Fee Boosting Test"
- cmd: cd integration-tests/smoke/ccip && go test ccip_batching_test.go -timeout 12m -test.parallel=2 -count=1 -json
name: "Batching Test"
- cmd: cd integration-tests/contracts && go test ccipreader_test.go -timeout 5m -test.parallel=1 -count=1 -json
name: "CCIPReader Test"
name: Integration Tests (${{ matrix.type.name }})
runs-on: ubuntu-latest
steps:
- name: Checkout the chainlink-ccip repo
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Determine Go version
id: go_version
run: echo "GO_VERSION=$(cat go.mod |grep "^go"|cut -d' ' -f 2)" >> $GITHUB_ENV
- name: Setup Go ${{ env.GO_VERSION }}
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: ${{ env.GO_VERSION }}
- name: Display Go version
run: go version
- name: Fetch latest pull request data
id: fetch_pr_data
uses: actions/github-script@v6
# only run this step if the event is a pull request
if: github.event_name == 'pull_request'
with:
script: |
const pr = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
});
return pr.data.body;
- name: Get the chainlink commit sha from PR description, if applicable
id: get_chainlink_sha
run: |
default="develop"
if [ "${{ github.event_name }}" == "pull_request" ]; then
comment=$(cat <<'GREAT_PR_DESCRIPTION_HERE'
${{ steps.fetch_pr_data.outputs.result }}
GREAT_PR_DESCRIPTION_HERE
)
echo "$comment"
core_ref=$(echo "$comment" | grep -oE 'core ref: [a-f0-9]{40}' | cut -d' ' -f3 || true)
if [ -n "$core_ref" ]; then
echo "Overriding chainlink repository commit hash with: $core_ref"
echo "::set-output name=ref::$core_ref"
else
echo "Using default chainlink repository branch: $default"
echo "::set-output name=ref::$default"
fi
else
echo "::set-output name=ref::$default"
fi
- name: Clone Chainlink repo
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
repository: smartcontractkit/chainlink
ref: ${{ steps.get_chainlink_sha.outputs.ref }}
path: chainlink
- name: Get the correct chainlink-ccip commit SHA via GitHub API
id: get_sha
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
COMMIT_SHA=${{ github.event.pull_request.head.sha }}
else
COMMIT_SHA=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/commits/${{ github.ref }}" | jq -r .sha)
fi
echo "::set-output name=sha::$COMMIT_SHA"
- name: Update chainlink-ccip dependency in chainlink
run: |
cd $GITHUB_WORKSPACE/chainlink
go get github.com/smartcontractkit/chainlink-ccip@${{ steps.get_sha.outputs.sha }}
make gomodtidy
- name: Setup Postgres
uses: ./.github/actions/setup-postgres
- name: Download Go vendor packages
run: |
cd $GITHUB_WORKSPACE/chainlink
go mod download
cd $GITHUB_WORKSPACE/chainlink/integration-tests
go mod download
- name: Build binary
run: |
cd $GITHUB_WORKSPACE/chainlink
go build -o ccip.test .
- name: Setup DB
run: |
cd $GITHUB_WORKSPACE/chainlink
./ccip.test local db preparetest
env:
CL_DATABASE_URL: ${{ env.DB_URL }}
- name: Run ${{ matrix.type.name }}
run: cd $GITHUB_WORKSPACE/chainlink/ && ${{ matrix.type.cmd }}
env:
CL_DATABASE_URL: ${{ env.DB_URL }}
integration-test-ccip-ocr3:
if: always()
runs-on: ubuntu-latest
needs: [integration-test-matrix]
steps:
- name: Fail the job if ccip tests in PR not successful
if: always() && needs.integration-test-matrix.result == 'failure'
run: exit 1