1+ name : Upgrade Compatibility Test
2+
3+ on :
4+ workflow_call :
5+ inputs :
6+ buildcmd :
7+ description : " Build command to run"
8+ required : true
9+ type : string
10+ envcmd :
11+ description : " Environment setup command to run"
12+ required : true
13+ type : string
14+ testcmd :
15+ description : " Test command to run"
16+ required : true
17+ type : string
18+ nodes :
19+ description : " Number of nodes for the test"
20+ required : false
21+ default : " 3"
22+ type : string
23+ versions-back :
24+ description : " Number of versions to go back for compatibility testing"
25+ required : false
26+ default : " 2"
27+ type : string
28+ working-directory :
29+ description : " Working directory for commands"
30+ required : false
31+ default : " devenv"
32+ type : string
33+ logs-directory :
34+ description : " Logs directory"
35+ required : true
36+ type : string
37+ ctf-log-level :
38+ description : " CTF log level"
39+ required : false
40+ default : " info"
41+ type : string
42+
43+ workflow_dispatch :
44+ inputs :
45+ buildcmd :
46+ description : " Build command to run"
47+ required : true
48+ type : string
49+ envcmd :
50+ description : " Environment setup command to run"
51+ required : true
52+ type : string
53+ testcmd :
54+ description : " Test command to run"
55+ required : true
56+ type : string
57+ nodes :
58+ description : " Number of nodes for the test"
59+ required : false
60+ default : " 3"
61+ type : string
62+ versions-back :
63+ description : " Number of versions to go back for compatibility testing"
64+ required : false
65+ default : " 2"
66+ type : string
67+ working-directory :
68+ description : " Working directory for commands"
69+ required : false
70+ default : " devenv"
71+ type : string
72+ logs-directory :
73+ description : " Logs directory"
74+ required : true
75+ type : string
76+ ctf-log-level :
77+ description : " CTF log level"
78+ required : false
79+ default : " info"
80+ type : string
81+
82+
83+ concurrency :
84+ group : ${{ github.workflow }}-${{ github.ref }}-${{ github.sha }}
85+ cancel-in-progress : true
86+
87+ jobs :
88+ compatibility :
89+ permissions :
90+ id-token : write
91+ contents : read
92+ pull-requests : write
93+ runs-on : ubuntu24.04-16cores-64GB # ghv-ignore!
94+ defaults :
95+ run :
96+ working-directory : ${{ github.event_name == 'workflow_call' && inputs.working-directory || github.event.inputs.working-directory }}
97+ env :
98+ BUILD_CMD : ${{ github.event_name == 'workflow_call' && inputs.buildcmd || github.event.inputs.buildcmd }}
99+ ENV_CMD : ${{ github.event_name == 'workflow_call' && inputs.envcmd || github.event.inputs.envcmd }}
100+ TEST_CMD : ${{ github.event_name == 'workflow_call' && inputs.testcmd || github.event.inputs.testcmd }}
101+ NODES : ${{ github.event_name == 'workflow_call' && inputs.nodes || github.event.inputs.nodes }}
102+ VERSIONS_BACK : ${{ github.event_name == 'workflow_call' && inputs.versions-back || github.event.inputs.versions-back }}
103+ WORKING_DIR : ${{ github.event_name == 'workflow_call' && inputs.working-directory || github.event.inputs.working-directory }}
104+ LOGS_DIR : ${{ github.event_name == 'workflow_call' && inputs.logs-directory || github.event.inputs.logs-directory }}
105+ CTF_LOG_LEVEL : ${{ github.event_name == 'workflow_call' && inputs.ctf-log-level || github.event.inputs.ctf-log-level }}
106+
107+ steps :
108+ - name : Checkout code
109+ uses : actions/checkout@v5
110+ with :
111+ fetch-depth : 0
112+ ref : ${{ github.event_name == 'workflow_dispatch' && github.ref || '' }}
113+
114+ - name : Set up Docker Buildx
115+ uses : docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
116+
117+ - name : Install Just
118+ uses : extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
119+ with :
120+ just-version : " 1.40.0"
121+
122+ - name : Configure AWS credentials using OIDC
123+ uses : aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
124+ with :
125+ role-to-assume : ${{ secrets.AWS_OIDC_IAM_ROLE_SDLC_ECR_READONLY_ARN }}
126+ aws-region : us-west-2
127+
128+ - name : Authenticate to ECR
129+ id : login-ecr
130+ uses : aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1
131+
132+ - name : Set up Go
133+ uses : actions/setup-go@v6 # v6
134+ with :
135+ cache : true
136+ go-version-file : ${{ env.WORKING_DIR }}/go.mod
137+ cache-dependency-path : ${{ env.WORKING_DIR }}/go.sum
138+
139+ - name : Download Go dependencies
140+ run : |
141+ go mod download
142+ working-directory : ${{ env.WORKING_DIR }}
143+
144+ - name : Get CTF version from go.mod
145+ shell : bash
146+ working-directory : ${{ env.WORKING_DIR }}
147+ run : |
148+ CTF_VERSION=$(go list -m -json "github.com/smartcontractkit/chainlink-testing-framework/framework" | jq -r .Version)
149+ echo "CTF_TAG=framework/$CTF_VERSION" >> $GITHUB_ENV
150+
151+ - name : Install CTF binary
152+ shell : bash
153+ working-directory : ${{ env.WORKING_DIR }}
154+ env :
155+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
156+ run : |
157+ mkdir -p bin
158+ gh release download "${{ env.CTF_TAG }}" --pattern "framework-v*-linux-amd64.tar.gz" --clobber --repo smartcontractkit/chainlink-testing-framework -O ctf.tar.gz
159+ tar -xzf ctf.tar.gz
160+ mv ctf bin/ctf
161+ chmod +x bin/ctf
162+
163+ - name : Run compat test
164+ working-directory : ${{ env.WORKING_DIR }}
165+ shell : bash
166+ env :
167+ CTF_LOG_LEVEL : ${{ env.CTF_LOG_LEVEL }}
168+ FAKE_SERVER_IMAGE : ${{ secrets.FAKE_SERVER_IMAGE }}
169+ REGISTRY : ${{ secrets.REGISTRY_SDLC }}/chainlink
170+ BUILD_CMD : ${{ env.BUILD_CMD }}
171+ ENV_CMD : ${{ env.ENV_CMD }}
172+ TEST_CMD : ${{ env.TEST_CMD }}
173+ NODES : ${{ env.NODES }}
174+ VERSIONS_BACK : ${{ env.VERSIONS_BACK }}
175+ run : |
176+ ./bin/ctf compat backward \
177+ --registry "${REGISTRY}" \
178+ --buildcmd "${BUILD_CMD}" \
179+ --envcmd "${ENV_CMD}" \
180+ --testcmd "${TEST_CMD}" \
181+ --nodes "${NODES}" \
182+ --versions-back "${VERSIONS_BACK}"
183+
184+ - name : Upload Logs
185+ if : always()
186+ uses : actions/upload-artifact@v4
187+ with :
188+ name : container-logs-smoke
189+ path : ${{ env.LOGS_DIR }}
190+ retention-days : 3
0 commit comments