diff --git a/.circleci/config.yml b/.circleci/config.yml index ec56913acc..7af39c543e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -116,16 +116,20 @@ jobs: - save_cache: paths: - /usr/local/cargo/registry + # Schema artifacts - framework/target/debug/.fingerprint - framework/target/debug/build - framework/target/debug/deps - modules/target/debug/.fingerprint - modules/target/debug/build - modules/target/debug/deps - - framework/target/release/build - - framework/target/release/deps - - modules/target/release/build - - modules/target/release/deps + # wasm builds + - framework/target/wasm32-unknown-unknown/release/.fingerprint + - framework/target/wasm32-unknown-unknown/release/build + - framework/target/wasm32-unknown-unknown/release/deps + - modules/target/wasm32-unknown-unknown/release/.fingerprint + - modules/target/wasm32-unknown-unknown/release/build + - modules/target/wasm32-unknown-unknown/release/deps key: cargocache-v2-build-rust:1.72.0-{{ checksum "framework/Cargo.lock" }}-{{ checksum "modules/Cargo.lock" }} - discord/status: fail_only: true diff --git a/scripts/wasm-all-ci.sh b/scripts/wasm-all-ci.sh index d6ecdfae72..b41e9529fb 100755 --- a/scripts/wasm-all-ci.sh +++ b/scripts/wasm-all-ci.sh @@ -4,13 +4,13 @@ set -e # Detect the architecture # if [[ $(arch) == "arm64" ]]; then -image="cosmwasm/rust-optimizer-arm64" -workspace_image="cosmwasm/workspace-optimizer-arm64" -abstract_image="abstractmoney/workspace-optimizer-arm64" + image="cosmwasm/rust-optimizer-arm64" + workspace_image="cosmwasm/workspace-optimizer-arm64" + abstract_image="abstractmoney/workspace-optimizer-arm64" else -image="cosmwasm/rust-optimizer" -workspace_image="cosmwasm/workspace-optimizer" -abstract_image="abstractmoney/workspace-optimizer" + image="cosmwasm/rust-optimizer" + workspace_image="cosmwasm/workspace-optimizer" + abstract_image="abstractmoney/workspace-optimizer" fi starting_dir=$(pwd) @@ -29,14 +29,14 @@ rm packages/abstract-interface/artifacts || true # Create lock file if it does not exist if [ ! -f Cargo.lock ]; then - cargo generate-lockfile + cargo generate-lockfile fi docker rm -v with_code || true docker rm -v build_with_code || true # create a dummy container which will hold a volume with config -docker create -v /code --name with_code alpine /bin/true +docker create -v /code -v /target/wasm32-unknown-unknown/release --name with_code alpine /bin/true # copy a config file into this volume docker cp Cargo.toml with_code:/code docker cp Cargo.lock with_code:/code @@ -44,18 +44,19 @@ docker cp Cargo.lock with_code:/code docker cp ./contracts with_code:/code docker cp ./packages with_code:/code # Copy cache if any -docker cp ./target/release/build with_code:/target/release/build || true -docker cp ./target/release/deps with_code:/target/release/deps || true +docker cp ./target/wasm32-unknown-unknown/release/.fingerprint with_code:/target/wasm32-unknown-unknown/release/ || true +docker cp ./target/wasm32-unknown-unknown/release/build with_code:/target/wasm32-unknown-unknown/release/ || true +docker cp ./target/wasm32-unknown-unknown/release/deps with_code:/target/wasm32-unknown-unknown/release/ || true docker cp /usr/local/cargo/registry with_code:/usr/local/cargo/registry || true # Run the build docker run --name build_with_code --volumes-from with_code ${abstract_image}:0.15.0 # Copy the artifacts back out docker cp with_code:/code/artifacts/ . # Copy cache back out -mkdir -p ./target/release/build -mkdir -p ./target/release/deps -docker cp build_with_code:/target/release/build ./target/release/build -docker cp build_with_code:/target/release/deps ./target/release/deps +mkdir -p ./target/wasm32-unknown-unknown/release +docker cp build_with_code:/target/wasm32-unknown-unknown/release/.fingerprint ./target/wasm32-unknown-unknown/release +docker cp build_with_code:/target/wasm32-unknown-unknown/release/build ./target/wasm32-unknown-unknown/release +docker cp build_with_code:/target/wasm32-unknown-unknown/release/deps ./target/wasm32-unknown-unknown/release ls artifacts cd $starting_dir @@ -66,7 +67,7 @@ docker rm -v modules_with_code || true docker rm -v build_modules_with_code || true # create a dummy container which will hold a volume with config -docker create -v /code -v /integrations -v /framework --name modules_with_code alpine /bin/true +docker create -v /code -v /integrations -v /framework -v /target/wasm32-unknown-unknown/release --name modules_with_code alpine /bin/true # copy directories to container. docker cp ./integrations modules_with_code:/ @@ -77,7 +78,7 @@ cd ./modules # Create lock file if it does not exist if [ ! -f Cargo.lock ]; then - cargo generate-lockfile + cargo generate-lockfile fi # Delete the current artifacts folder. @@ -86,20 +87,21 @@ fi docker cp Cargo.toml modules_with_code:/code docker cp Cargo.lock modules_with_code:/code # Copy cache if any -docker cp ./target/release/build modules_with_code:/target/release/build || true -docker cp ./target/release/build modules_with_code:/target/release/deps || true +docker cp ./target/wasm32-unknown-unknown/release/.fingerprint modules_with_code:/target/wasm32-unknown-unknown/release/ || true +docker cp ./target/wasm32-unknown-unknown/release/build modules_with_code:/target/wasm32-unknown-unknown/release/ || true +docker cp ./target/wasm32-unknown-unknown/release/deps modules_with_code:/target/wasm32-unknown-unknown/release/ || true docker cp /usr/local/cargo/registry modules_with_code:/usr/local/cargo/registry || true # copy code into this volume docker cp ./contracts modules_with_code:/code # Run the build -docker run --name build_modules_with_code --volumes-from modules_with_code ${abstract_image}:0.15.0 +docker run --name build_modules_with_code --volumes-from modules_with_code ${abstract_image}:0.15.0 # Copy the artifacts back out docker cp modules_with_code:/code/artifacts/ . # Copy cache back out -mkdir -p ./target/release/build -mkdir -p ./target/release/deps -docker cp build_modules_with_code:/target/release/build ./target/release/build -docker cp build_modules_with_code:/target/release/deps ./target/release/deps +mkdir -p ./target/wasm32-unknown-unknown/release +docker cp build_modules_with_code:/target/wasm32-unknown-unknown/release/.fingerprint ./target/wasm32-unknown-unknown/release +docker cp build_modules_with_code:/target/wasm32-unknown-unknown/release/build ./target/wasm32-unknown-unknown/release +docker cp build_modules_with_code:/target/wasm32-unknown-unknown/release/deps ./target/wasm32-unknown-unknown/release ls artifacts cd $starting_dir \ No newline at end of file