Skip to content

Commit fd01c99

Browse files
authored
Merge pull request #761 from input-output-hk/jpraynaud/760-ci-dynamic-matrix-eras
Add dynamic matrix in CI for end to end tests
2 parents feb1e00 + 0e369da commit fd01c99

File tree

6 files changed

+20
-12
lines changed

6 files changed

+20
-12
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ concurrency:
2121
jobs:
2222
build-ubuntu-X64:
2323
runs-on: ubuntu-22.04
24+
outputs:
25+
eras: ${{ steps.eras-test-lab.outputs.eras }}
2426
steps:
2527
- name: Checkout sources
2628
uses: actions/checkout@v3
@@ -59,6 +61,13 @@ jobs:
5961
name: mithril-end-to-end-${{ runner.os }}-${{ runner.arch }}
6062
path: target/release/mithril-end-to-end
6163
if-no-files-found: error
64+
65+
- name: Prepare test lab eras
66+
id: eras-test-lab
67+
run: |
68+
ERAS=$(./target/release/mithril-aggregator era list --json)
69+
echo "Test Lab Eras: $ERAS"
70+
echo "eras=$ERAS" >> $GITHUB_OUTPUT
6271
6372
build:
6473
strategy:
@@ -178,7 +187,7 @@ jobs:
178187
strategy:
179188
fail-fast: false
180189
matrix:
181-
era: [ thales ]
190+
era: ${{ fromJSON(needs.build-ubuntu-X64.outputs.eras) }}
182191
run_id: [1,2,3]
183192
steps:
184193
- name: Checkout sources

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mithril-aggregator/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mithril-aggregator"
3-
version = "0.2.20"
3+
version = "0.2.21"
44
description = "A Mithril Aggregator server"
55
authors = { workspace = true }
66
edition = { workspace = true }

mithril-common/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mithril-common"
3-
version = "0.2.17"
3+
version = "0.2.18"
44
authors = { workspace = true }
55
edition = { workspace = true }
66
documentation = { workspace = true }

mithril-common/src/chain_observer/model.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,12 @@ impl TxDatum {
6969

7070
/// [TxDatumFieldValue] represents a fiel value of TxDatum.
7171
#[derive(Debug, EnumDiscriminants, Serialize, Display)]
72-
#[serde(untagged)]
72+
#[serde(untagged, rename_all = "lowercase")]
7373
#[strum(serialize_all = "lowercase")]
74-
#[strum_discriminants(derive(Serialize, Display))]
74+
#[strum_discriminants(derive(Serialize, Hash, Display))]
7575
#[strum_discriminants(name(TxDatumFieldTypeName))]
7676
#[strum_discriminants(strum(serialize_all = "lowercase"))]
77+
#[strum_discriminants(serde(rename_all = "lowercase"))]
7778
pub enum TxDatumFieldValue {
7879
/// Bytes datum field value.
7980
Bytes(String),
@@ -86,7 +87,7 @@ pub enum TxDatumFieldValue {
8687
#[derive(Debug, Serialize)]
8788
pub struct TxDatumBuilder {
8889
constructor: usize,
89-
fields: Vec<HashMap<String, TxDatumFieldValue>>,
90+
fields: Vec<HashMap<TxDatumFieldTypeName, TxDatumFieldValue>>,
9091
}
9192

9293
impl TxDatumBuilder {
@@ -101,10 +102,7 @@ impl TxDatumBuilder {
101102
/// Add a field to the builder
102103
pub fn add_field(&mut self, field_value: TxDatumFieldValue) -> &mut TxDatumBuilder {
103104
let mut field = HashMap::new();
104-
field.insert(
105-
TxDatumFieldTypeName::from(&field_value).to_string(),
106-
field_value,
107-
);
105+
field.insert(TxDatumFieldTypeName::from(&field_value), field_value);
108106
self.fields.push(field);
109107

110108
self

mithril-common/src/era/supported_era.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pub type UnsupportedEraError = strum::ParseError;
99
#[derive(
1010
Display, EnumString, EnumIter, Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize,
1111
)]
12+
#[serde(rename_all = "lowercase")]
1213
#[strum(serialize_all = "lowercase")]
1314
pub enum SupportedEra {
1415
/// Thales era

0 commit comments

Comments
 (0)