Skip to content

Commit 0070ee2

Browse files
committed
ci: create a summary for the runs
1 parent 8639862 commit 0070ee2

File tree

1 file changed

+94
-3
lines changed

1 file changed

+94
-3
lines changed

.github/workflows/nightly-backward-compatibility.yml

Lines changed: 94 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ jobs:
6262
fail-fast: false
6363
matrix:
6464
tag: ${{ fromJSON(needs.prepare-binaries.outputs.tags) }}
65-
node:
66-
[mithril-aggregator, mithril-client, mithril-signer, mithril-relay]
65+
node: [mithril-aggregator, mithril-client, mithril-signer]
6766
cardano_node_version: ${{ fromJSON(inputs.cardano-node-version) }}
6867
run_id: ["#1"]
6968

@@ -92,11 +91,57 @@ jobs:
9291
9392
- name: Run E2E tests
9493
run: |
94+
# TODO: adjust the e2e test parameters for slower execution (slower epochs and slot lengths)
95+
# cardano-slot-length 0.25
96+
# cardano-epoch-length 45.0
97+
9598
./mithril-binaries/e2e/mithril-end-to-end -vvv \
9699
--bin-directory ./mithril-binaries/e2e \
97100
--work-directory=./artifacts \
98101
--devnet-scripts-directory=./mithril-test-lab/mithril-devnet \
99-
--cardano-node-version ${{ matrix.cardano_node_version }}
102+
--cardano-node-version ${{ matrix.cardano_node_version }} \
103+
&& echo "SUCCESS=true" >> $GITHUB_ENV \
104+
|| (echo "SUCCESS=false" >> $GITHUB_ENV && exit 1)
105+
106+
- name: Define the JSON file name for the test result
107+
if: always()
108+
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
109+
110+
- name: Write test result JSON
111+
if: always()
112+
run: |
113+
AGGREGATOR_TAG="unstable"
114+
SIGNER_TAG="unstable"
115+
CLIENT_TAG="unstable"
116+
117+
case "$NODE" in
118+
mithril-aggregator)
119+
AGGREGATOR_TAG="${{ matrix.tag }}"
120+
;;
121+
mithril-signer)
122+
SIGNER_TAG="${{ matrix.tag }}"
123+
;;
124+
mithril-client)
125+
CLIENT_TAG="${{ matrix.tag }}"
126+
;;
127+
esac
128+
129+
jq -n --arg TAG "${{ matrix.tag }}" \
130+
--arg NODE "${{ matrix.node }}" \
131+
--arg CARDANO_NODE "${{ matrix.cardano_node_version }}" \
132+
--arg AGGREGATOR "$AGGREGATOR_TAG" \
133+
--arg SIGNER "$SIGNER_TAG" \
134+
--arg CLIENT "$CLIENT_TAG" \
135+
--argjson SUCCESS "${{ env.SUCCESS }}" \
136+
'{tag: $TAG, node: $NODE, mithril_signer: $SIGNER, mithril_aggregator: $AGGREGATOR, mithril_client: $CLIENT, cardano_node_version: $CARDANO_NODE, success: $SUCCESS}' \
137+
> ./${{ env.RESULT_FILE_NAME }}.json
138+
139+
- name: Upload test result JSON
140+
if: always()
141+
uses: actions/upload-artifact@v4
142+
with:
143+
name: ${{ env.RESULT_FILE_NAME }}
144+
path: ./${{ env.RESULT_FILE_NAME }}.json
100145

101146
- name: Upload E2E Tests Artifacts
102147
if: ${{ failure() }}
@@ -111,3 +156,49 @@ jobs:
111156
!./artifacts/devnet/cardano-cli
112157
!./artifacts/devnet/cardano-node
113158
if-no-files-found: error
159+
160+
summarize-test-results:
161+
runs-on: ubuntu-22.04
162+
needs: [e2e]
163+
if: always()
164+
165+
steps:
166+
- name: Download all test result artifacts
167+
uses: actions/download-artifact@v4
168+
with:
169+
path: ./test-results
170+
pattern: e2e-test-result*
171+
merge-multiple: true
172+
173+
- name: Concatenate JSON result files into summary.json
174+
run: |
175+
jq -s '.' ./test-results/e2e-test-result-*.json > ./test-results/summary.json
176+
177+
- name: Add distributions backward compatibility summary
178+
run: |
179+
CHECK_MARK=":heavy_check_mark:"
180+
CROSS_MARK=":no_entry:"
181+
182+
echo "## Distributions backward compatibility" >> $GITHUB_STEP_SUMMARY
183+
echo "" >> $GITHUB_STEP_SUMMARY
184+
185+
echo "This is the compatibility report of previous distributions nodes with the current unstable nodes." >> $GITHUB_STEP_SUMMARY
186+
echo "" >> $GITHUB_STEP_SUMMARY
187+
188+
echo "| Compatibility | mithril-signer | mithril-aggregator | mithril-client |" >> $GITHUB_STEP_SUMMARY
189+
echo "| --- | :---: | :---: | :---: |" >> $GITHUB_STEP_SUMMARY
190+
191+
# Transform summary.json into Markdown table rows
192+
jq -r --arg CHECK_MARK "$CHECK_MARK" --arg CROSS_MARK "$CROSS_MARK" \
193+
'group_by(.tag) |
194+
sort_by(.[0].tag | tonumber) | reverse |
195+
.[] |
196+
{
197+
tag: .[0].tag,
198+
signer: (map(select(.node == "mithril-signer") | if .success then $CHECK_MARK else $CROSS_MARK end) | join("")),
199+
aggregator: (map(select(.node == "mithril-aggregator") | if .success then $CHECK_MARK else $CROSS_MARK end) | join("")),
200+
client: (map(select(.node == "mithril-client") | if .success then $CHECK_MARK else $CROSS_MARK end) | join(""))
201+
} |
202+
"| `\(.tag)` | \(.signer) | \(.aggregator) | \(.client) |"' "./test-results/summary.json" >> $GITHUB_STEP_SUMMARY
203+
204+
cat "$GITHUB_STEP_SUMMARY"

0 commit comments

Comments
 (0)