1
1
name : Nightly backward compatibility
2
2
3
3
on :
4
+ # Important note about scheduled workflows:
5
+ # Notifications for scheduled workflows are sent to the user who last modified the cron syntax in the workflow file.
4
6
schedule :
5
- - cron : " 0 2 * * *"
6
- - cron : " 0 14 * * *"
7
+ - cron : " 30 2 * * *"
7
8
workflow_dispatch :
8
9
inputs :
9
10
total-releases :
15
16
description : " Cardano node version used in e2e"
16
17
required : true
17
18
type : string
18
- default : " 10.1.1 "
19
+ default : " 10.1.2 "
19
20
20
21
jobs :
22
+ prepare-env-variables :
23
+ runs-on : ubuntu-22.04
24
+ outputs :
25
+ total_releases : ${{ steps.set-env.outputs.total_releases }}
26
+ cardano_node_version : ${{ steps.set-env.outputs.cardano_node_version }}
27
+ steps :
28
+ - name : Prepare env variables
29
+ id : set-env
30
+ shell : bash
31
+ run : |
32
+ if [[ "${{ github.event_name }}" == "schedule" ]]; then
33
+ echo "total_releases=3" >> $GITHUB_OUTPUT
34
+ echo 'cardano_node_version=["10.1.2"]' >> $GITHUB_OUTPUT
35
+ else
36
+ echo "total_releases=${{ inputs.total-releases }}" >> $GITHUB_OUTPUT
37
+ echo "cardano_node_version=[\"${{ inputs.cardano-node-version }}\"]" >> $GITHUB_OUTPUT
38
+ fi
39
+
21
40
prepare-binaries :
22
41
runs-on : ubuntu-22.04
42
+ needs : [prepare-env-variables]
23
43
outputs :
24
44
tags : ${{ steps.tags-test-lab.outputs.tags }}
25
45
steps :
26
46
- name : Checkout
27
47
uses : actions/checkout@v4
28
48
29
49
- name : Download releases artifacts binaries
50
+ env :
51
+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
52
+ shell : bash
30
53
run : |
31
- ./.github/workflows/scripts/download-distribution-binaries.sh ${{ inputs.total-releases }
54
+ ./.github/workflows/scripts/download-distribution-binaries.sh ${{ needs.prepare-env-variables.outputs.total_releases }}
55
+
56
+ - name : Install stable toolchain
57
+ uses : dtolnay/rust-toolchain@master
58
+ with :
59
+ toolchain : stable
32
60
33
61
- name : Build e2e
62
+ shell : bash
34
63
run : |
35
64
cargo build --release --bin mithril-end-to-end
36
65
cp ./target/release/mithril-end-to-end ./mithril-binaries/unstable
@@ -43,21 +72,21 @@ jobs:
43
72
44
73
- name : Prepare test lab tags
45
74
id : tags-test-lab
75
+ shell : bash
46
76
run : |
47
- TAGS=$(cat ./mithril-binaries/tags.json)
77
+ TAGS=$(jq -c '.' ./mithril-binaries/tags.json)
48
78
echo "Test Lab Tags: $TAGS"
49
79
echo "tags=$TAGS" >> $GITHUB_OUTPUT
50
80
51
81
e2e :
52
82
runs-on : ubuntu-22.04
53
- needs : [prepare-binaries]
83
+ needs : [prepare-env-variables, prepare- binaries]
54
84
strategy :
55
85
fail-fast : false
56
86
matrix :
57
87
tag : ${{ fromJSON(needs.prepare-binaries.outputs.tags) }}
58
- node :
59
- [mithril-aggregator, mithril-client, mithril-signer, mithril-relay]
60
- cardano_node_version : ${{ inputs.cardano-node-version }}
88
+ node : [mithril-aggregator, mithril-client, mithril-signer]
89
+ cardano_node_version : ${{ fromJSON(needs.prepare-env-variables.outputs.cardano_node_version) }}
61
90
run_id : ["#1"]
62
91
63
92
steps :
71
100
path : ./mithril-binaries
72
101
73
102
- name : Prepare binaries
103
+ shell : bash
74
104
run : |
75
105
mkdir -p mithril-binaries/e2e
76
106
cp ./mithril-binaries/unstable/* ./mithril-binaries/e2e
@@ -84,9 +114,118 @@ jobs:
84
114
mkdir artifacts
85
115
86
116
- name : Run E2E tests
117
+ shell : bash
87
118
run : |
88
- ./mithril-binaries/e2e/mithril-end-to-end -vvv \\
89
- --bin-directory ./mithril-binaries/e2e \\
90
- --work-directory=./artifacts \\
91
- --devnet-scripts-directory=./mithril-test-lab/mithril-devnet \\
92
- --cardano-node-version ${{ matrix.cardano_node_version }}
119
+ ./mithril-binaries/e2e/mithril-end-to-end -vvv \
120
+ --bin-directory ./mithril-binaries/e2e \
121
+ --work-directory=./artifacts \
122
+ --devnet-scripts-directory=./mithril-test-lab/mithril-devnet \
123
+ --cardano-node-version ${{ matrix.cardano_node_version }} \
124
+ --cardano-slot-length 0.25 \
125
+ --cardano-epoch-length 45.0 \
126
+ && echo "SUCCESS=true" >> $GITHUB_ENV \
127
+ || (echo "SUCCESS=false" >> $GITHUB_ENV && exit 1)
128
+
129
+ - name : Define the JSON file name for the test result
130
+ shell : bash
131
+ if : success() || failure()
132
+ run : echo "RESULT_FILE_NAME=e2e-test-result-run_${{ github.run_number }}-attempt_${{ github.run_attempt }}-tag_${{ matrix.tag }}-node-${{ matrix.node }}-cardano-${{ matrix.cardano_node_version }}-run_id_${{ matrix.run_id }}" >> $GITHUB_ENV
133
+
134
+ - name : Write test result JSON
135
+ if : success() || failure()
136
+ shell : bash
137
+ run : |
138
+ AGGREGATOR_TAG="unstable"
139
+ SIGNER_TAG="unstable"
140
+ CLIENT_TAG="unstable"
141
+
142
+ case "$NODE" in
143
+ mithril-aggregator)
144
+ AGGREGATOR_TAG="${{ matrix.tag }}"
145
+ ;;
146
+ mithril-signer)
147
+ SIGNER_TAG="${{ matrix.tag }}"
148
+ ;;
149
+ mithril-client)
150
+ CLIENT_TAG="${{ matrix.tag }}"
151
+ ;;
152
+ esac
153
+
154
+ jq -n --arg TAG "${{ matrix.tag }}" \
155
+ --arg NODE "${{ matrix.node }}" \
156
+ --arg CARDANO_NODE "${{ matrix.cardano_node_version }}" \
157
+ --arg AGGREGATOR "$AGGREGATOR_TAG" \
158
+ --arg SIGNER "$SIGNER_TAG" \
159
+ --arg CLIENT "$CLIENT_TAG" \
160
+ --argjson SUCCESS "${{ env.SUCCESS }}" \
161
+ '{tag: $TAG, node: $NODE, mithril_signer: $SIGNER, mithril_aggregator: $AGGREGATOR, mithril_client: $CLIENT, cardano_node_version: $CARDANO_NODE, success: $SUCCESS}' \
162
+ > ./${{ env.RESULT_FILE_NAME }}.json
163
+
164
+ - name : Upload test result JSON
165
+ if : success() || failure()
166
+ uses : actions/upload-artifact@v4
167
+ with :
168
+ name : ${{ env.RESULT_FILE_NAME }}
169
+ path : ./${{ env.RESULT_FILE_NAME }}.json
170
+
171
+ - name : Upload E2E Tests Artifacts
172
+ if : ${{ failure() }}
173
+ uses : actions/upload-artifact@v4
174
+ with :
175
+ name : mithril-e2e-tests-artifacts-run_${{ github.run_number }}-attempt_${{ github.run_attempt }}-tag_${{ matrix.tag }}-node-${{ matrix.node }}-cardano-${{ matrix.cardano_node_version }}-run_id_${{ matrix.run_id }}
176
+ path : |
177
+ ./artifacts/*
178
+ # including node.sock makes the upload fails so exclude them:
179
+ !./artifacts/**/node.sock
180
+ # exclude cardano tools, saving ~50mb of data:
181
+ !./artifacts/devnet/cardano-cli
182
+ !./artifacts/devnet/cardano-node
183
+ if-no-files-found : error
184
+
185
+ summarize-test-results :
186
+ runs-on : ubuntu-22.04
187
+ needs : [e2e]
188
+ if : success() || failure()
189
+
190
+ steps :
191
+ - name : Download all test result artifacts
192
+ uses : actions/download-artifact@v4
193
+ with :
194
+ path : ./test-results
195
+ pattern : e2e-test-result*
196
+ merge-multiple : true
197
+
198
+ - name : Concatenate JSON result files into summary.json
199
+ shell : bash
200
+ run : |
201
+ jq -s '.' ./test-results/e2e-test-result-*.json > ./test-results/summary.json
202
+
203
+ - name : Add distributions backward compatibility summary
204
+ shell : bash
205
+ run : |
206
+ CHECK_MARK=":heavy_check_mark:"
207
+ CROSS_MARK=":no_entry:"
208
+
209
+ echo "## Distributions backward compatibility" >> $GITHUB_STEP_SUMMARY
210
+ echo "" >> $GITHUB_STEP_SUMMARY
211
+
212
+ echo "This is the compatibility report of previous distributions nodes with the current unstable nodes." >> $GITHUB_STEP_SUMMARY
213
+ echo "" >> $GITHUB_STEP_SUMMARY
214
+
215
+ echo "| Compatibility | mithril-signer | mithril-aggregator | mithril-client |" >> $GITHUB_STEP_SUMMARY
216
+ echo "| --- | :---: | :---: | :---: |" >> $GITHUB_STEP_SUMMARY
217
+
218
+ # Transform summary.json into Markdown table rows
219
+ jq -r --arg CHECK_MARK "$CHECK_MARK" --arg CROSS_MARK "$CROSS_MARK" \
220
+ 'group_by(.tag) |
221
+ sort_by(.[0].tag | tonumber) | reverse |
222
+ .[] |
223
+ {
224
+ tag: .[0].tag,
225
+ signer: (map(select(.node == "mithril-signer") | if .success then $CHECK_MARK else $CROSS_MARK end) | join("")),
226
+ aggregator: (map(select(.node == "mithril-aggregator") | if .success then $CHECK_MARK else $CROSS_MARK end) | join("")),
227
+ client: (map(select(.node == "mithril-client") | if .success then $CHECK_MARK else $CROSS_MARK end) | join(""))
228
+ } |
229
+ "| `\(.tag)` | \(.signer) | \(.aggregator) | \(.client) |"' "./test-results/summary.json" >> $GITHUB_STEP_SUMMARY
230
+
231
+ cat "$GITHUB_STEP_SUMMARY"
0 commit comments