/
action.yml
96 lines (91 loc) · 2.89 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
name: setup-run-tests-environment
description: Common test env setup
inputs:
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
go_mod_path:
required: false
description: The go.mod file path
default: "go.mod"
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
runs:
using: composite
steps:
# Go setup and caching
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version-file: ${{ inputs.go_mod_path }}
check-latest: true
- name: Cache Vendor Packages
uses: actions/cache@v3
id: cache-packages
with:
path: |
~/.cache/go-build
~/go/pkg/mod
~/go/bin
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Download Go Vendor Packages
if: steps.cache-packages.outputs.cache-hit != 'true'
shell: bash
run: ${{ inputs.test_download_vendor_packages_command }}
- name: Install Ginkgo CLI
shell: bash
run: |
if [[ -z "${{ inputs.test_download_ginkgo_command }}" ]]; then
# short-circuit when we don't want to install ginkgo
exit 0
fi
CHECK=$(which ginkgo || true)
if [[ -z "${CHECK}" ]]; then
${{ inputs.test_download_ginkgo_command }}
fi
# Setup AWS cred and K8s context
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@495fc37803e35461021a6229a7c1a9cda25e54fe
with:
aws-region: ${{ inputs.QA_AWS_REGION }}
role-to-assume: ${{ inputs.QA_AWS_ROLE_TO_ASSUME }}
role-duration-seconds: 3600
- name: Set Kubernetes Context
uses: azure/k8s-set-context@v3
with:
method: kubeconfig
kubeconfig: ${{ inputs.QA_KUBECONFIG }}
# Helm Setup
- uses: smartcontractkit/tool-versions-to-env-action@v1.0.8
id: tool-versions
- uses: azure/setup-helm@v3
with:
version: v${{ steps.tool-versions.outputs.helm_version }}
- name: Add required helm charts including chainlink-qa
shell: bash
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add chainlink-qa https://raw.githubusercontent.com/smartcontractkit/qa-charts/gh-pages/
# Display tool versions
- name: Tool Versions
shell: bash
run: |
go version
[[ ! -z "${{ inputs.test_download_ginkgo_command }}" ]] && ginkgo version
aws --version
kubectl version
helm version
helm repo list