This repository has been archived by the owner on Apr 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yml
100 lines (100 loc) · 3.83 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
name: 'Test ActiveMQ Artemis Operator'
description: 'Test ActiveMQ Artemis Operator'
inputs:
module:
description: 'The test suite module name'
required: true
default: 'github.com/artemiscloud/activemq-artemis-operator-test-suite'
repository:
description: 'The test suite repository'
required: true
default: 'https://github.com/artemiscloud/activemq-artemis-operator-test-suite.git'
ref:
description: 'The test suite reference'
required: true
default: 'main'
test-packages:
description: 'The tests path'
required: true
default: 'test/...'
docker-images:
description: 'The docker images to load'
required: true
default: ''
broker-name:
description: 'The ActiveMQ Artemis Broker name'
required: true
default: 'activemq-artemis'
broker-image:
description: 'The ActiveMQ Artemis Broker image'
required: true
default: 'quay.io/artemiscloud/activemq-artemis-broker-kubernetes:dev.latest'
broker-update-image:
description: 'The ActiveMQ Artemis Broker update image'
required: true
default: 'quay.io/artemiscloud/activemq-artemis-broker-kubernetes:dev.latest'
operator-image:
description: 'The ActiveMQ Artemis Operator image'
required: true
default: 'quay.io/artemiscloud/activemq-artemis-operator:dev.latest'
operator-deploy-path:
description: 'The ActiveMQ Artemis Operator deploy path'
required: true
default: ''
runs:
using: "composite"
steps:
- name: Checkout the activemq-artemis-operator-test-suite
run: |
git clone ${{ inputs.repository }} ${{ github.action_path }}/go/src/${{ inputs.module }}
git -C ${{ github.action_path }}/go/src/${{ inputs.module }} checkout ${{ inputs.ref }}
shell: bash
- name: Set up deploy directory
run: |
if [ -n "${{ inputs.operator-deploy-path }}" ]
then
cp -r ${{ inputs.operator-deploy-path }} ${{ github.action_path }}/deploy
else
git clone https://github.com/artemiscloud/activemq-artemis-operator.git ${{ github.action_path }}/activemq-artemis-operator
cp -r ${{ github.action_path }}/activemq-artemis-operator/deploy ${{ github.action_path }}/deploy
fi
sed -i 's/imagePullPolicy:.*/imagePullPolicy: IfNotPresent/g' ${{ github.action_path }}/deploy/operator.yaml
shell: bash
- name: Install Ginkgo
run: go install github.com/onsi/ginkgo/ginkgo@v1.16.5
shell: bash
- name: Install kind
run: go install sigs.k8s.io/kind@v0.11.1
shell: bash
- name: Set up Kubernetes cluster
run: $(go env GOPATH)/bin/kind create cluster
shell: bash
- name: Load docker images
run: |
if [ -n "${{ inputs.docker-images }}" ]
then
for DOCKER_IMAGE in $(echo ${{ inputs.docker-images }} | sed "s/,/ /g")
do
$(go env GOPATH)/bin/kind load docker-image $DOCKER_IMAGE
done
fi
shell: bash
- name: Execute tests
run: |
export ACK_GINKGO_RC=true
export GOBIN=$(go env GOPATH)/bin
export GOPATH=${{ github.action_path }}/go
export KUBECONFIG=$HOME/.kube/config
$GOBIN/ginkgo -r -keepGoing ${{ inputs.test-packages }} -- \
-broker-name ${{ inputs.broker-name }} \
-broker-image ${{ inputs.broker-image }} \
-broker-image-second ${{ inputs.broker-update-image }} \
-operator-image ${{ inputs.operator-image }} \
-repository ${{ github.action_path }}/deploy \
-v2 -debug-run || export GINKGO_EXIT_CODE=$?
if [[ "$GINKGO_EXIT_CODE" != "0" ]]; then
echo "For instructions on using the test-suite visit https://github.com/artemiscloud/activemq-artemis-operator-test-suite"
exit $GINKGO_EXIT_CODE
fi
shell: bash
working-directory: ${{ github.action_path }}/go/src/${{ inputs.module }}