-
Notifications
You must be signed in to change notification settings - Fork 28
86 lines (76 loc) · 2.58 KB
/
jenkins-dispatch.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
on:
workflow_dispatch:
inputs:
server_image:
description: "server image: repo/name:tag"
required: true
type: string
client_image:
description: "client image: repo/name:tag"
required: true
type: string
pmm_qa_branch:
description: "Branch for PMM-QA to checkout"
required: false
type: string
sha:
description: "commit sha to report status"
required: false
type: string
jobs:
helm-tests:
runs-on: ubuntu-latest
env:
WORK_DIR: ./pmm-qa/pmm-tests
GH_API_TOKEN: ${{ secrets.GH_API_TOKEN }}
PMM_QA_BRANCH: ${{ inputs.pmm_qa_branch || 'main' }}
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ env.PMM_QA_BRANCH }}
repository: percona/pmm-qa
path: ./pmm-qa
- name: install tools
run: |
npm install -g bats
- name: Start minikube
run: |
minikube start
minikube addons disable storage-provisioner
### Install CSI drivers for snapshots
kubectl delete storageclass standard
minikube addons enable csi-hostpath-driver
minikube addons enable volumesnapshots
kubectl patch storageclass csi-hostpath-sc -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
kubectl wait --for=condition=Ready node --timeout=90s minikube
- name: Run helm tests
run: |
echo $(git submodule status)
cd $WORK_DIR
export IMAGE_REPO=$(echo $SERVER_IMAGE | cut -d ':' -f 1)
export IMAGE_TAG=$(echo $SERVER_IMAGE | cut -d ':' -f 2)
bats --tap pmm-2-0-bats-tests/helm-test.bats
env:
SERVER_IMAGE: ${{ inputs.server_image }}
- name: Create status check
if: ${{ always() }}
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
RUN_ID: ${{ github.run_id }}
SHA: ${{ inputs.sha }}
STATUS: ${{ job.status }}
run: |
if [ "${STATUS}" = "cancelled" ]; then
STATUS="error"
fi
gh api \
--method POST \
-H "Accept: application/vnd.github.v3+json" \
/repos/$REPO/statuses/$SHA \
-f state="$STATUS" \
-f target_url="https://github.com/$REPO/actions/runs/$RUN_ID" \
-f description="Helm Tests status: $STATUS" \
-f context='actions/workflows/helm-tests'