-
Notifications
You must be signed in to change notification settings - Fork 1
169 lines (149 loc) · 5.51 KB
/
pull-request-main.yml
File metadata and controls
169 lines (149 loc) · 5.51 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
name: pull-request-main
on:
merge_group:
pull_request:
branches:
- main
jobs:
ci-lint:
name: Lint
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
actions: read
steps:
- name: Linting Go
uses: smartcontractkit/.github/actions/ci-lint-go@85085f8c650468409773440bc867a7b3642ccc9b # ci-lint-go@4.0.0
with:
golangci-lint-version: v2.6.2
use-go-cache: true
only-new-issues: false
golangci-lint-config: .golangci.yml
ci-lint-e2e:
name: Lint E2E tests
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
actions: read
steps:
- name: Linting Go
uses: smartcontractkit/.github/actions/ci-lint-go@85085f8c650468409773440bc867a7b3642ccc9b # ci-lint-go@4.0.0
with:
golangci-lint-version: v2.6.2
golangci-lint-args: --build-tags="e2e"
use-go-cache: true
only-new-issues: false
golangci-lint-config: .golangci.yml
ci-lint-misc:
name: Lint GH Actions and scripts
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Linting Misc (yaml + sh files)
uses: smartcontractkit/.github/actions/ci-lint-misc@9fc306ac63d8997c9ca0da283e56caaf71589f83 # ci-lint-misc@1.0.0
ci-test:
name: Tests
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
actions: read
steps:
- name: Build and test
uses: smartcontractkit/.github/actions/ci-test-go@2b1d964024bb001ae9fba4f840019ac86ad1d824 # ci-test-go@1.1.0
with:
go-test-cmd: go test -v -cover -coverpkg=./... -coverprofile=coverage.txt ./...
use-go-cache: true
ci-test-e2e:
name: Tests E2E
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
actions: read
steps:
- name: Install Rust
uses: moonrepo/setup-rust@ede6de059f8046a5e236c94046823e2af11ca670 # v1.2.2
- name: Install Solana
uses: metaplex-foundation/actions/install-solana@2389940047edc63a5781911f6a53fbdf784748d8 # v1.0.4
with:
version: 1.18.26
- name: Install Aptos CLI
uses: aptos-labs/actions/install-aptos-cli@ce57287eb852b9819c1d74fecc3be187677559fd # v0.1
with:
CLI_VERSION: 7.10.0
- name: Install Sui CLI
shell: bash
run: |
SUI_VERSION="1.57.2"
curl -L "https://github.com/MystenLabs/sui/releases/download/mainnet-v${SUI_VERSION}/sui-mainnet-v${SUI_VERSION}-ubuntu-x86_64.tgz" -o sui.tgz
tar -xzf sui.tgz
sudo mv sui /usr/local/bin/
sui --version
- name: Checkout code
uses: actions/checkout@v4
- name: Compute Solana programs cache key
id: solana-programs-cache-key
shell: bash
run: |
key="$(go list -m github.com/smartcontractkit/chainlink-ccip/chains/solana)"
echo "key=${key}" >> "$GITHUB_OUTPUT"
- name: Cache Solana programs
uses: actions/cache@v4
id: cache-solana-programs
with:
path: ./e2e/artifacts/solana
key: "${{ runner.os }}-mcms-contracts-${{ steps.solana-programs-cache-key.outputs.key }}"
- name: Build Solana programs
if: steps.cache-solana-programs.outputs.cache-hit != 'true'
shell: bash
run: |
./e2e/tests/solana/compile-mcm-contracts.sh
- name: Run e2e tests
uses: smartcontractkit/.github/actions/ci-test-go@2b1d964024bb001ae9fba4f840019ac86ad1d824 # ci-test-go@1.1.0
with:
checkout-repo: false
use-go-cache: true
go-test-cmd: |
set +e
echo "::group::EVM"
CTF_CONFIGS=../config.evm.toml go test -p=1 -tags=e2e -v ./e2e/tests/... -run=TestEVMSuite || evm_failure=true
echo "::endgroup::"
echo "::group::Solana"
CTF_CONFIGS=../config.solana.toml go test -p=1 -tags=e2e -v ./e2e/tests/... -run=TestSolanaSuite || solana_failure=true
echo "::endgroup::"
echo "::group::Aptos"
CTF_CONFIGS=../config.aptos.toml go test -p=1 -tags=e2e -v ./e2e/tests/... -run=TestAptosSuite || aptos_failure=true
echo "::endgroup::"
echo "::group::Sui"
CTF_CONFIGS=../config.sui.toml go test -p=1 -tags=e2e -v ./e2e/tests/... -run=TestSuiSuite || sui_failure=true
echo "::endgroup::"
[[ -n "${evm_failure}" ]] && echo "🚨 EVM e2e tests failed."
[[ -n "${solana_failure}" ]] && echo "🚨 Solana e2e tests failed."
[[ -n "${aptos_failure}" ]] && echo "🚨 Aptos e2e tests failed."
[[ -n "${sui_failure}" ]] && echo "🚨 Sui e2e tests failed."
[[ -n "${evm_failure}" || -n "${solana_failure}" || -n "${aptos_failure}" || -n "${sui_failure}" ]] && {
exit 1
} || {
echo "Exiting"
exit 0
}
ci-sonarqube:
name: Sonarqube Scan
runs-on: ubuntu-latest
needs: [ci-lint, ci-lint-misc, ci-test]
permissions:
contents: read
actions: read
if: github.actor != 'dependabot[bot]'
steps:
- name: Scanning with Sonarqube
uses: smartcontractkit/.github/actions/ci-sonarqube-go@01d931b0455a754d12e7143cc54a5a3521a8f6f6 # ci-sonarqube-go@0.3.1
with:
# sonarqube inputs
sonar-token: ${{ secrets.SONAR_TOKEN }}
sonar-host-url: ${{ secrets.SONAR_HOST_URL }}
include-lint: true