-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy pathaction.yml
More file actions
136 lines (117 loc) · 3.94 KB
/
action.yml
File metadata and controls
136 lines (117 loc) · 3.94 KB
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
name: 'Run e2e test'
description: 'Run single e2e test.'
inputs:
node-count:
description: 'Number of nodes to run.'
required: false
default: '5'
min-validator-count:
description: 'Minimum number of nodes below which chain enters emergency state.'
required: false
default: '4'
test-case:
description: 'Name of test to run.'
required: false
randomized:
description: 'Whether to use randomized test params.'
required: false
default: 'false'
reserved-seats:
description: 'Number of reserved seats available to validators.'
required: false
non-reserved-seats:
description: 'Number of non-reserved seats available to validators.'
required: false
follow-up-finalization-check:
description: 'Whether to run a follow-up finalization check.'
required: false
deploy-adder:
description: 'Whether to deploy the adder sample contract to the node.'
required: false
default: 'false'
deploy-button:
description: 'Whether to deploy the button game contracts to the node.'
required: false
default: 'false'
image-path:
description: 'Custom path to docker image for aleph-node'
required: false
default: aleph-test-docker
download-image:
description: 'If true, the image will be downloaded from {{ inputs.image-path }}, otherwise it is assumed to already be available.'
required: false
default: 'true'
node-image:
description: 'Custom name of aleph-node image'
required: false
default: aleph-node:latest
compose-file:
description: 'Custom docker-compose configuration'
required: false
default: ''
runs:
using: 'composite'
steps:
- name: Download artifact with docker image
uses: actions/download-artifact@v2
if: ${{ inputs.download-image }} == 'true'
with:
name: ${{ inputs.image-path }}
- name: Load node docker image
if: ${{ inputs.download-image }} == 'true'
shell: bash
run: docker load -i aleph-node.tar
- name: Run consensus party
shell: bash
run: NODE_IMAGE=${{ inputs.node-image }} DOCKER_COMPOSE=${{ inputs.compose-file }} ./.github/scripts/run_consensus.sh -m ${{ inputs.min-validator-count }} -n ${{ inputs.node-count }}
- name: Sleep
shell: bash
run: sleep 60
- name: Display bootnode logs
shell: bash
run: docker logs Node0 --follow &
- name: Download artifact with the test suite image
if: inputs.test-case != ''
uses: actions/download-artifact@v2
with:
name: aleph-e2e-client
- name: Load test suite docker image
if: inputs.test-case != ''
shell: bash
run: docker load -i aleph-e2e-client.tar
- name: Run single e2e test
if: inputs.test-case != ''
shell: bash
run: |
ARGS=(
-t "${{ inputs.test-case }}"
-r "${{ inputs.randomized }}"
-m "${{ inputs.min-validator-count }}"
)
RESERVED_SEATS="${{ inputs.reserved-seats }}"
NON_RESERVED_SEATS="${{ inputs.non-reserved-seats }}"
if [[ -n "${RANDOMIZED}" ]]; then
ARGS+=(-r "${RANDOMIZED}")
fi
if [[ -n "${RESERVED_SEATS}" && -n "${NON_RESERVED_SEATS}" ]]; then
ARGS+=(
-f "${RESERVED_SEATS}"
-n "${NON_RESERVED_SEATS}"
)
fi
DEPLOY_ADDER="${{ inputs.deploy-adder }}"
if [[ "${DEPLOY_ADDER}" = "true" ]]; then
pushd contracts/adder
export ADDER=$(./deploy.sh)
popd
fi
DEPLOY_BUTTON="${{ inputs.deploy-button }}"
if [[ "${DEPLOY_BUTTON}" = "true" ]]; then
source contracts/env/dev
contracts/scripts/deploy.sh
fi
./.github/scripts/run_e2e_test.sh "${ARGS[@]}"
- name: Run finalization e2e test
if: inputs.follow-up-finalization-check == 'true'
shell: bash
run: ./.github/scripts/run_e2e_test.sh -t finalization::finalization -m "${{ inputs.min-validator-count }}"