AstarNetwork / Astar

The dApp hub for blockchains of the future
https://astar.network/
GNU General Public License v3.0
732 stars 236 forks source link

[CI] - Run tests and/or compilation separately for each workspace crate #1213

Open Dinonard opened 3 months ago

Dinonard commented 3 months ago

It's possible that even though our cargo check or cargo test work just fine, compiling or testing them separately will fail because they don't define correctly dependency features. This is easily hidden when testing everything since it's likely that all necessary features will be enabled.

To avoid this, introduce a new job which will check test each crate individually.

for package in $(cargo metadata --format-version=1 --no-deps | jq -r '.packages[].name'); do
    cargo test -p $package
done