-
Notifications
You must be signed in to change notification settings - Fork 66
A0-1619 New GH check for runtime metadata #842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
0c15da4
A0-1619 New GH check for runtime metadata
Marcin-Radecki 92117ec
Merge branch 'main' into A0-1619-automate-build-of-runtime-file
Marcin-Radecki b921c97
A0-1619 Removed interactive mode from the new runtime check. Fixed st…
Marcin-Radecki 15386e7
A0-1619 Attempt to fix workflows.
Marcin-Radecki 7fbd118
A0-1619 use pre-build subxt image
Marcin-Radecki d2673e1
A0-1619 Fixed docker entrypoint. Regenerated runtime metadata as it w…
Marcin-Radecki b9f3968
A0-1619 Attempt 4 to fix workflows
Marcin-Radecki 3d33811
Merge branch 'main' into A0-1619-automate-build-of-runtime-file
Marcin-Radecki 901b7f0
A0-1619 Attempt 5 to fix workflows
Marcin-Radecki 65233b4
A0-1619 Hopefully better attempt to the Dockerfile
Marcin-Radecki 5141181
Merge branch 'main' into A0-1619-automate-build-of-runtime-file
Marcin-Radecki File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| ** | ||
| !docker/subxt-integration-entrypoint.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| This directory contains following files: | ||
| ### `subxt-integration.Dockerfile` | ||
| This is not a main `aleph-client`, rather it is a helper Dockerfile to run on GH, which has `subxt` tool. | ||
|
|
||
| It requires: | ||
| * an `aleph-node` chain to be run in the background (ie `127.0.0.1:9944` port must be opened), | ||
| * access to `rustfmt.toml`, | ||
| * access to current `aleph_zero.rs` file | ||
|
|
||
| The docker checks whether a `subxt`-generated runtime metadata is the same as from the current commit. | ||
|
|
||
| It needs to be run only from `aleph-client` directory and in network host mode: | ||
| ```bash | ||
| docker run --network host --mount type=bind,source="$(pwd)/..",target=/subxt/aleph-node subxt:latest | ||
| ``` | ||
|
|
||
| ### `subxt-integration-entrypoint.sh` | ||
| An entrypoint for above Dockerfile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| subxt codegen --derive Clone --derive Debug --derive Eq --derive PartialEq | rustfmt --edition=2021 --config-path aleph-node/rustfmt.toml > aleph_zero.rs | ||
| diff -y -W 200 --suppress-common-lines aleph_zero.rs aleph-node/aleph-client/src/aleph_zero.rs | ||
| diff_exit_code=$? | ||
| if [[ ! $diff_exit_code -eq 0 ]]; then | ||
| echo "Current runtime metadata is different than versioned in git!" | ||
| echo "Run subxt codegen --derive Clone --derive Debug --derive Eq --derive PartialEq | rustfmt --edition=2021 >" \ | ||
| "src/aleph_zero.rs from aleph-client directory and commit to git." | ||
| exit 1 | ||
| fi | ||
| echo "Current runtime metadata and versioned in git matches." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| FROM rustlang/rust:nightly-slim | ||
|
|
||
| WORKDIR subxt | ||
|
|
||
| RUN cargo install subxt-cli | ||
| RUN rustup component add rustfmt --toolchain nightly | ||
|
|
||
| COPY docker/subxt-integration-entrypoint.sh /subxt/subxt-integration-entrypoint.sh | ||
|
|
||
| RUN chmod +x /subxt/subxt-integration-entrypoint.sh | ||
| RUN rustc --version | ||
|
|
||
| ENTRYPOINT ["./subxt-integration-entrypoint.sh"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| edition = "2021" | ||
| use_field_init_shorthand = true | ||
| reorder_modules = true | ||
|
|
||
| imports_granularity = "Crate" | ||
| group_imports = "StdExternalCrate" | ||
| reorder_imports = true | ||
deuszx marked this conversation as resolved.
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.