/
action.yml
157 lines (151 loc) · 5.56 KB
/
action.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: chainlink-testing-framework-test-runner
description: Common runner for chainlink-testing-framework based tests
inputs:
artifacts_location:
required: false
description: Location of where error logs are written
default: ./tests/e2e/logs
test_command_to_run:
required: true
description: The command to run the tests
test_download_vendor_packages_command:
required: false
description: The command to download the go modules
default: make download
test_download_ginkgo_command:
required: false
description: The command to download Ginkgo
cl_repo:
required: false
description: The Chainlink ecr repository to use
default: public.ecr.aws/z0b1w9r9/chainlink
cl_image_tag:
required: false
description: The chainlink image to use
default: develop
build_gauntlet_command:
required: false
description: How to build gauntlet if necessary
default: "false"
download_contract_artifacts_path:
required: false
description: Path where the contract artifacts need to be placed
default: "none"
publish_report_paths:
required: false
description: The path of the output report
default: "./tests-smoke-report.xml"
publish_check_name:
required: false
description: The check name for publishing the reports
default: Smoke Test Results
token:
required: false
description: The GITHUB_TOKEN for the workflow
default: ${{ github.token }}
publish_test_results_comment_mode:
required: false
description: comment_mode value for EnricoMi/publish-unit-test-result-action@v1
default: always
publish_test_results_commit:
required: false
description: Commit SHA to which test results are published. Only needed if the value of GITHUB_SHA does not work for you.
triggered_by:
required: true
description: The triggered-by label for the k8s namespace, required for cleanup
default: ci
go_mod_path:
required: false
description: The go.mod file path
dep_chainlink_integration_tests:
required: false
description: chainlink/integration-tests commit or branch
QA_AWS_REGION:
required: true
description: The AWS region to use
QA_AWS_ROLE_TO_ASSUME:
required: true
description: The AWS role to assume
QA_KUBECONFIG:
required: true
description: The kubernetes configuration to use
CGO_ENABLED:
required: false
description: Whether to have cgo enabled, defaults to enabled
default: "1"
should_cleanup:
required: false
description: Whether to run the cleanup at the end, soak tests and such would not want to automatically cleanup
default: "true"
runs:
using: composite
steps:
# Setup Tools and libraries
- name: Setup environment
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/setup-run-tests-environment@v2.0.28
with:
test_download_vendor_packages_command: ${{ inputs.test_download_vendor_packages_command }}
test_download_ginkgo_command: ${{ inputs.test_download_ginkgo_command }}
go_mod_path: ${{ inputs.go_mod_path }}
QA_AWS_REGION: ${{ inputs.QA_AWS_REGION }}
QA_AWS_ROLE_TO_ASSUME: ${{ inputs.QA_AWS_ROLE_TO_ASSUME }}
QA_KUBECONFIG: ${{ inputs.QA_KUBECONFIG }}
- name: Replace chainlink/integration-tests deps
if: ${{ inputs.dep_chainlink_integration_tests }}
shell: bash
run: |
# find test go root by using the go_mod_path and change to that directory
TEST_LIB_PATH="${{ inputs.go_mod_path }}"
if [ "${#TEST_LIB_PATH}" -gt "6" ]; then
TEST_LIB_PATH=${TEST_LIB_PATH%go.mod}
cd "${TEST_LIB_PATH}"
fi
# update the integration-tests lib to the branch or commit
go get github.com/smartcontractkit/chainlink/integration-tests@${{ inputs.dep_chainlink_integration_tests }}
go mod tidy
# Download any external artifacts
- name: Download Artifacts
if: inputs.download_contract_artifacts_path != 'none'
uses: actions/download-artifact@v3
with:
name: artifacts
path: ${{ inputs.download_contract_artifacts_path }}
# Generate any excutables needed to run tests
- name: Generate gauntlet executable
if: inputs.build_gauntlet_command != 'false'
shell: bash
run: ${{ inputs.build_gauntlet_command }}
# Run the tests
- name: Run Tests
shell: bash
env:
CHAINLINK_IMAGE: ${{ inputs.cl_repo }}
CHAINLINK_VERSION: ${{ inputs.cl_image_tag }}
CGO_ENABLED: ${{ inputs.CGO_ENABLED }}
run: |
PATH=$PATH:$(go env GOPATH)/bin
export PATH
export TEST_TRIGGERED_BY=${{ inputs.triggered_by }}-${{ github.event.pull_request.number || github.run_id }}
${{ inputs.test_command_to_run }}
# Reporting and cleanup
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: failure()
with:
junit_files: ${{ inputs.publish_report_paths }}
github_token: ${{ inputs.token }}
check_name: ${{ inputs.publish_check_name }}
comment_mode: ${{ inputs.publish_test_results_comment_mode }}
commit: ${{ inputs.publish_test_results_commit }}
- name: Publish Artifacts
if: failure()
uses: actions/upload-artifact@v3
with:
name: test-logs
path: ${{ inputs.artifacts_location }}
- name: cleanup
if: always()
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/cleanup@v2.0.28
with:
triggered_by: ${{ inputs.triggered_by }}
should_cleanup: ${{ inputs.should_cleanup }}