Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/actions/run-e2e-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ inputs:
default: '4'
test-case:
description: 'Name of test to run.'
required: true
required: false
randomized:
description: 'Whether to use randomized test params.'
required: false
Expand Down Expand Up @@ -57,15 +57,18 @@ runs:
run: docker logs Node0 --follow &

- name: Download artifact with the test suite image
if: "${{ github.event.inputs.test-case != '' }}"
uses: actions/download-artifact@v2
with:
name: aleph-e2e-client

- name: Load test suite docker image
if: "${{ github.event.inputs.test-case != '' }}"
shell: bash
run: docker load -i aleph-e2e-client.tar

- name: Run single e2e test
if: "${{ github.event.inputs.test-case != '' }}"
shell: bash
run: |
ARGS=(
Expand Down
27 changes: 23 additions & 4 deletions .github/workflows/e2e-tests-main-devnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: '3.6.1'
version: '3.6.1'

- name: Restore cache
uses: ./.github/actions/restore-cache
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: '3.6.1'
version: '3.6.1'

- name: Install WASM target
run: rustup target add wasm32-unknown-unknown
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: '3.6.1'
version: '3.6.1'

- name: Restore cache
uses: ./.github/actions/restore-cache
Expand Down Expand Up @@ -182,6 +182,25 @@ jobs:
if-no-files-found: error
retention-days: 7

run-aleph-client-subxt-codegen-check:
Comment thread
deuszx marked this conversation as resolved.
needs: [build-test-docker]
name: Checks if runtime file in aleph-client is up-to-date
runs-on: ubuntu-20.04
steps:
- name: Checkout source code
uses: actions/checkout@v2

- name: Run one node in the background
uses: ./.github/actions/run-e2e-test
with:
node-count: 1
min-validator-count: 1

- name: check if runtime metadata matches
run: |
cd aleph-client/
docker build --tag subxt:latest -f docker/Dockerfile .
Comment thread
deuszx marked this conversation as resolved.
Outdated
docker run --rm --network host subxt:latest

run-e2e-finalization-test:
needs: [build-test-docker, build-test-client]
Expand Down Expand Up @@ -839,7 +858,7 @@ jobs:
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: '3.6.1'
version: '3.6.1'

- name: Install WASM target
run: rustup target add wasm32-unknown-unknown
Expand Down
4 changes: 4 additions & 0 deletions aleph-client/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**
!src/aleph_zero.rs
!docker/docker_entrypoint.sh
!rustfmt.toml
15 changes: 15 additions & 0 deletions aleph-client/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM rustlang/rust:nightly-slim

WORKDIR subxt

RUN cargo install subxt-cli
RUN rustup component add rustfmt --toolchain nightly

COPY docker/docker_entrypoint.sh /subxt/docker_entrypoint.sh
COPY src/aleph_zero.rs /subxt/aleph_zero_current.rs
COPY rustfmt.toml /subxt/rustfmt.toml

RUN chmod +x /subxt/docker_entrypoint.sh
RUN rustc --version

ENTRYPOINT ["./docker_entrypoint.sh"]
Comment thread
deuszx marked this conversation as resolved.
Outdated
13 changes: 13 additions & 0 deletions aleph-client/docker/docker_entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -euo pipefail

subxt codegen --derive Clone --derive Debug --derive Eq --derive PartialEq | rustfmt --edition=2021 > aleph_zero.rs
diff -y --suppress-common-lines aleph_zero.rs aleph_zero_current.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."
7 changes: 7 additions & 0 deletions aleph-client/rustfmt.toml
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
Comment thread
deuszx marked this conversation as resolved.