Skip to content
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

Fix: enable astar metadata feature flag #203

Merged
merged 2 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
80 changes: 75 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
branches:
- master
- staging
- release-v*
pull_request:

name: rosetta-wallet
Expand All @@ -12,7 +13,7 @@ jobs:
runs-on: self-hosted
steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install rust toolchain
uses: actions-rs/toolchain@v1
Expand Down Expand Up @@ -42,7 +43,7 @@ jobs:
runs-on: self-hosted
steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install rust toolchain
uses: actions-rs/toolchain@v1
Expand All @@ -57,16 +58,62 @@ jobs:
runs-on: self-hosted
steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: cargo-deny check
uses: EmbarkStudios/cargo-deny-action@v1

# Test each client individually, once testing the whole workspace can hide some compilation errors
# ex: testing using --workspace enable the same feature flags for all crates
test-client:
needs: [rustfmt, clippy]
strategy:
matrix:
crate: [rosetta-server-astar, rosetta-server-bitcoin, rosetta-server-ethereum, rosetta-server-polkadot, rosetta-client]
name: test ${{ matrix.crate }}
runs-on: self-hosted
steps:
- name: Checkout sources
uses: actions/checkout@v4

- run: sudo add-apt-repository ppa:ethereum/ethereum
- run: sudo apt-get update -y
- name: Install deps
run: sudo apt-get install -y musl-dev musl-tools solc

- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
target: x86_64-unknown-linux-musl

- name: cargo clippy (${{ matrix.crate }})
run: |
cargo clippy --locked -p ${{ matrix.crate }} --examples --tests -- \
-Dwarnings \
-Dclippy::unwrap_used \
-Dclippy::expect_used \
-Dclippy::nursery \
-Dclippy::pedantic \
-Aclippy::module_name_repetitions

- name: Cleanup Docker
run: ./scripts/reset_docker.sh

- name: Pull nodes
run: ./scripts/pull_nodes.sh

- name: test (${{ matrix.crate }})
run: cargo test --locked -p ${{ matrix.crate }}

# Test all crates, excluding the clients
test:
needs: [rustfmt, clippy]
runs-on: self-hosted
steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v4

- run: sudo add-apt-repository ppa:ethereum/ethereum
- run: sudo apt-get update -y
Expand All @@ -77,7 +124,24 @@ jobs:
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
target: x86_64-unknown-linux-musl

- name: clippy
run: |
cargo clippy --locked --workspace --examples --tests --all-features \
--exclude rosetta-server-astar \
--exclude rosetta-server-bitcoin \
--exclude rosetta-server-ethereum \
--exclude rosetta-server-polkadot \
--exclude rosetta-client \
-- \
-Dwarnings \
-Dclippy::unwrap_used \
-Dclippy::expect_used \
-Dclippy::nursery \
-Dclippy::pedantic \
-Aclippy::module_name_repetitions

- name: Cleanup Docker
run: ./scripts/reset_docker.sh
Expand All @@ -86,4 +150,10 @@ jobs:
run: ./scripts/pull_nodes.sh

- name: cargo test
run: cargo test --locked --all-features --workspace
run: |
cargo test --locked --workspace --all-features \
--exclude rosetta-server-astar \
--exclude rosetta-server-bitcoin \
--exclude rosetta-server-ethereum \
--exclude rosetta-server-polkadot \
--exclude rosetta-client
2 changes: 1 addition & 1 deletion chains/astar/server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ futures = { version = "0.3", default-features = false, features = ["std"] }
hex = "0.4"
log = "0.4"
parity-scale-codec = { workspace = true, features = ["derive"] }
rosetta-config-astar.workspace = true
rosetta-config-astar = { workspace = true, features = ["astar-metadata"] }
Copy link
Collaborator Author

@Lohann Lohann Oct 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI didn't catch this error because when testing using --workspace makes all crates in workspace.dependencies use the same feature flags, I've updated the workflow to detect this kind of error in the future.

rosetta-config-ethereum.workspace = true
rosetta-core.workspace = true
rosetta-server = { workspace = true, features = ["ws", "webpki-tls"] }
Expand Down
Loading