Skip to content

Commit 28f2427

Browse files
dlachaumejpraynaud
andcommitted
ci: create script to download distribution binaries and new workflow to run the nightly backward compatibility testing with e2e tests.
Co-authored-by: Jean-Philippe Raynaud <[email protected]>
1 parent ff9b5a3 commit 28f2427

File tree

2 files changed

+119
-0
lines changed

2 files changed

+119
-0
lines changed
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Nightly backward compatibility
2+
3+
on:
4+
schedule:
5+
- cron: "0 2 * * *"
6+
- cron: "0 14 * * *"
7+
workflow_dispatch:
8+
inputs:
9+
total-releases:
10+
description: "Total number of releases to test"
11+
required: true
12+
type: number
13+
default: 3
14+
cardano-node-version:
15+
description: "Cardano node version used in e2e"
16+
required: true
17+
type: string
18+
default: "9.2.1"
19+
20+
jobs:
21+
prepare-binaries:
22+
runs-on: ubuntu-22.04
23+
outputs:
24+
tags: ${{ steps.tags-test-lab.outputs.tags }}
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Download releases artifacts binaries
30+
run: |
31+
./.github/workflows/scripts/download-distribution-binaries.sh ${{ inputs.total-releases }
32+
33+
- name: Build e2e
34+
run: |
35+
cargo build --release --bin mithril-end-to-end
36+
cp ./target/release/mithril-end-to-end ./mithril-binaries/unstable
37+
38+
- name: Upload Mithril binaries
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: mithril-binaries
42+
path: ./mithril-binaries
43+
44+
- name: Prepare test lab tags
45+
id: tags-test-lab
46+
run: |
47+
TAGS=$(cat ./mithril-binaries/tags.json)
48+
echo "Test Lab Tags: $TAGS"
49+
echo "tags=$TAGS" >> $GITHUB_OUTPUT
50+
51+
e2e:
52+
runs-on: ubuntu-22.04
53+
strategy:
54+
fail-fast: false
55+
matrix:
56+
tag: ${{ fromJSON(needs.prepare-binaries.outputs.tags) }}
57+
node:
58+
[
59+
mithril-aggregator,
60+
mithril-client-cli,
61+
mithril-signer,
62+
mithril-relay,
63+
]
64+
cardano_node_version: ${{ inputs.cardano-node-version }}
65+
run_id: ["#1"]
66+
67+
steps:
68+
- name: Checkout
69+
uses: actions/checkout@v4
70+
71+
- name: Download binaries
72+
uses: actions/download-artifact@v4
73+
with:
74+
name: mithril-binaries
75+
path: ./mithril-binaries
76+
77+
- name: Prepare binaries
78+
run: |
79+
mkdir -p mithril-binaries/e2e
80+
cp ./mithril-binaries/unstable ./mithril-binaries/e2e
81+
rm ./mithril-binaries/e2e/${{ matrix.node }}
82+
cp ./mithril-binaries/${{ matrix.tag }}/${{ matrix.node }} ./mithril-binaries/e2e/${{ matrix.node }}
83+
84+
chmod +x ./mithril-binaries/e2e/mithril-aggregator
85+
chmod +x ./mithril-binaries/e2e/mithril-client
86+
chmod +x ./mithril-binaries/e2e/mithril-signer
87+
chmod +x ./mithril-binaries/e2e/mithril-relay
88+
chmod +x ./mithril-binaries/e2e/mithril-end-to-end
89+
mkdir artifacts
90+
91+
- name: Run E2E tests
92+
run: |
93+
./mithril-binaries/e2e/mithril-end-to-end -vvv \\
94+
--bin-directory ./mithril-binaries/e2e \\
95+
--work-directory=./artifacts \\
96+
--devnet-scripts-directory=./mithril-test-lab/mithril-devnet \\
97+
--cardano-node-version ${{ matrix.cardano_node_version }}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#! /bin/bash
2+
3+
set -e
4+
5+
TOTAL_RELEASES=$1
6+
ASSETS_DIRECTORY="./mithril-binaries"
7+
TAG_FILE=$ASSETS_DIRECTORY/tags.json
8+
9+
echo ">> Retrieving artifacts for last ${TOTAL_RELEASES} releases and unstable"
10+
mkdir -p $ASSETS_DIRECTORY
11+
gh api /repos/input-output-hk/mithril/releases | jq -r --argjson TOTAL $TOTAL_RELEASES '[.[] | select(.prerelease == false)] | [.[:$TOTAL][].tag_name]' >> $TAG_FILE
12+
13+
TAG_NAMES=$(cat $TAG_FILE | jq -r '.[]' | tr '\n' ' ')
14+
for TAG_NAME in unstable $TAG_NAMES
15+
do
16+
echo ">>>> Retrieving artifacts for release ${TAG_NAME}"
17+
ARCHIVE_DIRECTORY="./mithril-binaries/$TAG_NAME"
18+
mkdir -p $ARCHIVE_DIRECTORY
19+
gh release download --repo input-output-hk/mithril $TAG_NAME -O mithril-archive --pattern "mithril-$TAG_NAME*-linux-x64.tar.gz"
20+
tar xzf mithril-archive -C $ARCHIVE_DIRECTORY mithril-aggregator mithril-signer mithril-client mithril-relay
21+
rm mithril-archive
22+
done

0 commit comments

Comments
 (0)