Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
139 changes: 46 additions & 93 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ workflows:
version: 2
test:
jobs:
- contract_sg721_base
- contract_sg721_nt
- contract_cw721_migration
- contract_base_factory
- contract_base_minter
- contract_vending_factory
Expand All @@ -28,10 +27,10 @@ workflows:
ignore: /.*/

jobs:
contract_sg721_base:
contract_cw721_migration:
docker:
- image: rust:1.81.0
working_directory: ~/project/contracts/collections/sg721-base
- image: rust:1.91.1
working_directory: ~/project/contracts/collections/cw721-migration
steps:
- checkout:
path: ~/project
Expand All @@ -40,69 +39,21 @@ jobs:
command: rustc --version; cargo --version; rustup --version
- restore_cache:
keys:
- cargocache-sg721-rust:1.81.0-{{ checksum "~/project/Cargo.lock" }}
- cargocache-cw721-migration-rust:1.91.1-{{ checksum "~/project/Cargo.lock" }}
- run:
name: Unit Tests
environment:
RUST_BACKTRACE: 1
command: cargo unit-test --locked
- run:
name: Build and run schema generator
command: cargo schema --locked
- run:
name: Ensure checked-in schemas are up-to-date
command: |
CHANGES_IN_REPO=$(git status --porcelain)
if [[ -n "$CHANGES_IN_REPO" ]]; then
echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:"
git status && git --no-pager diff
exit 1
fi
- save_cache:
paths:
- /usr/local/cargo/registry
- target
key: cargocache-sg721-rust:1.81.0-{{ checksum "~/project/Cargo.lock" }}

contract_sg721_nt:
docker:
- image: rust:1.81.0
working_directory: ~/project/contracts/collections/sg721-nt
steps:
- checkout:
path: ~/project
- run:
name: Version information
command: rustc --version; cargo --version; rustup --version
- restore_cache:
keys:
- cargocache-sg721-nt-rust:1.81.0-{{ checksum "~/project/Cargo.lock" }}
- run:
name: Unit Tests
environment:
RUST_BACKTRACE: 1
command: cargo unit-test --locked
- run:
name: Build and run schema generator
command: cargo schema --locked
- run:
name: Ensure checked-in schemas are up-to-date
command: |
CHANGES_IN_REPO=$(git status --porcelain)
if [[ -n "$CHANGES_IN_REPO" ]]; then
echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:"
git status && git --no-pager diff
exit 1
fi
- save_cache:
paths:
- /usr/local/cargo/registry
- target
key: cargocache-sg721-nt-rust:1.81.0-{{ checksum "~/project/Cargo.lock" }}
key: cargocache-cw721-migration-rust:1.91.1-{{ checksum "~/project/Cargo.lock" }}

contract_base_factory:
docker:
- image: rust:1.81.0
- image: rust:1.91.1
working_directory: ~/project/contracts/factories/base-factory
steps:
- checkout:
Expand All @@ -112,7 +63,7 @@ jobs:
command: rustc --version; cargo --version; rustup --version
- restore_cache:
keys:
- cargocache-base-factory-rust:1.81.0-{{ checksum "~/project/Cargo.lock" }}
- cargocache-base-factory-rust:1.91.1-{{ checksum "~/project/Cargo.lock" }}
- run:
name: Unit Tests
environment:
Expand All @@ -134,11 +85,11 @@ jobs:
paths:
- /usr/local/cargo/registry
- target
key: cargocache-base-factory-rust:1.81.0-{{ checksum "~/project/Cargo.lock" }}
key: cargocache-base-factory-rust:1.91.1-{{ checksum "~/project/Cargo.lock" }}

contract_base_minter:
docker:
- image: rust:1.81.0
- image: rust:1.91.1
working_directory: ~/project/contracts/minters/base-minter
steps:
- checkout:
Expand All @@ -148,7 +99,7 @@ jobs:
command: rustc --version; cargo --version; rustup --version
- restore_cache:
keys:
- cargocache-base-minter-rust:1.81.0-{{ checksum "~/project/Cargo.lock" }}
- cargocache-base-minter-rust:1.91.1-{{ checksum "~/project/Cargo.lock" }}
- run:
name: Unit Tests
environment:
Expand All @@ -170,11 +121,11 @@ jobs:
paths:
- /usr/local/cargo/registry
- target
key: cargocache-base-minter-rust:1.81.0-{{ checksum "~/project/Cargo.lock" }}
key: cargocache-base-minter-rust:1.91.1-{{ checksum "~/project/Cargo.lock" }}

contract_vending_factory:
docker:
- image: rust:1.81.0
- image: rust:1.91.1
working_directory: ~/project/contracts/factories/vending-factory
steps:
- checkout:
Expand All @@ -184,7 +135,7 @@ jobs:
command: rustc --version; cargo --version; rustup --version
- restore_cache:
keys:
- cargocache-vending-factory-rust:1.81.0-{{ checksum "~/project/Cargo.lock" }}
- cargocache-vending-factory-rust:1.91.1-{{ checksum "~/project/Cargo.lock" }}
- run:
name: Unit Tests
environment:
Expand All @@ -206,11 +157,11 @@ jobs:
paths:
- /usr/local/cargo/registry
- target
key: cargocache-vending-factory-rust:1.81.0-{{ checksum "~/project/Cargo.lock" }}
key: cargocache-vending-factory-rust:1.91.1-{{ checksum "~/project/Cargo.lock" }}

contract_vending_minter:
docker:
- image: rust:1.81.0
- image: rust:1.91.1
working_directory: ~/project/contracts/minters/vending-minter
steps:
- checkout:
Expand All @@ -220,7 +171,7 @@ jobs:
command: rustc --version; cargo --version; rustup --version
- restore_cache:
keys:
- cargocache-vending-minter-rust:1.81.0-{{ checksum "~/project/Cargo.lock" }}
- cargocache-vending-minter-rust:1.91.1-{{ checksum "~/project/Cargo.lock" }}
- run:
name: Unit Tests
environment:
Expand All @@ -242,11 +193,11 @@ jobs:
paths:
- /usr/local/cargo/registry
- target
key: cargocache-vending-minter-rust:1.81.0-{{ checksum "~/project/Cargo.lock" }}
key: cargocache-vending-minter-rust:1.91.1-{{ checksum "~/project/Cargo.lock" }}

contract_open_edition_factory:
docker:
- image: rust:1.81.0
- image: rust:1.91.1
working_directory: ~/project/contracts/factories/open-edition-factory
steps:
- checkout:
Expand All @@ -256,7 +207,7 @@ jobs:
command: rustc --version; cargo --version; rustup --version
- restore_cache:
keys:
- cargocache-open-edition-factory-rust:1.81.0-{{ checksum "~/project/Cargo.lock" }}
- cargocache-open-edition-factory-rust:1.91.1-{{ checksum "~/project/Cargo.lock" }}
- run:
name: Unit Tests
environment:
Expand All @@ -278,11 +229,11 @@ jobs:
paths:
- /usr/local/cargo/registry
- target
key: cargocache-open-edition-factory-rust:1.81.0-{{ checksum "~/project/Cargo.lock" }}
key: cargocache-open-edition-factory-rust:1.91.1-{{ checksum "~/project/Cargo.lock" }}

contract_open_edition_minter:
docker:
- image: rust:1.81.0
- image: rust:1.91.1
working_directory: ~/project/contracts/minters/open-edition-minter
steps:
- checkout:
Expand All @@ -292,7 +243,7 @@ jobs:
command: rustc --version; cargo --version; rustup --version
- restore_cache:
keys:
- cargocache-open-edition-minter-rust:1.81.0-{{ checksum "~/project/Cargo.lock" }}
- cargocache-open-edition-minter-rust:1.91.1-{{ checksum "~/project/Cargo.lock" }}
- run:
name: Unit Tests
environment:
Expand All @@ -314,11 +265,11 @@ jobs:
paths:
- /usr/local/cargo/registry
- target
key: cargocache-open-edition-minter-rust:1.81.0-{{ checksum "~/project/Cargo.lock" }}
key: cargocache-open-edition-minter-rust:1.91.1-{{ checksum "~/project/Cargo.lock" }}

contract_whitelist:
docker:
- image: rust:1.81.0
- image: rust:1.91.1
working_directory: ~/project/contracts/whitelists/whitelist
steps:
- checkout:
Expand All @@ -328,7 +279,7 @@ jobs:
command: rustc --version; cargo --version; rustup --version
- restore_cache:
keys:
- cargocache-whitelist-rust:1.81.0-{{ checksum "~/project/Cargo.lock" }}
- cargocache-whitelist-rust:1.91.1-{{ checksum "~/project/Cargo.lock" }}
- run:
name: Unit Tests
environment:
Expand All @@ -350,10 +301,10 @@ jobs:
paths:
- /usr/local/cargo/registry
- target
key: cargocache-whitelist-rust:1.81.0-{{ checksum "~/project/Cargo.lock" }}
key: cargocache-whitelist-rust:1.91.1-{{ checksum "~/project/Cargo.lock" }}
test-suite:
docker:
- image: rust:1.81.0
- image: rust:1.91.1
working_directory: ~/project/test-suite
steps:
- checkout:
Expand All @@ -363,7 +314,7 @@ jobs:
command: rustc --version; cargo --version; rustup --version
- restore_cache:
keys:
- cargocache-test-suite-rust:1.81.0-{{ checksum "~/project/Cargo.lock" }}
- cargocache-test-suite-rust:1.91.1-{{ checksum "~/project/Cargo.lock" }}
- run:
name: Unit Tests
environment:
Expand All @@ -373,12 +324,12 @@ jobs:
paths:
- /usr/local/cargo/registry
- target
key: cargocache-test-suite-rust:1.81.0-{{ checksum "~/project/Cargo.lock" }}
key: cargocache-test-suite-rust:1.91.1-{{ checksum "~/project/Cargo.lock" }}

package_sg_utils:
docker:
- image: rust:1.81.0
working_directory: ~/project/package/sg-utils
- image: rust:1.91.1
working_directory: ~/project/packages/sg-utils
steps:
- checkout:
path: ~/project
Expand All @@ -387,7 +338,7 @@ jobs:
command: rustc --version; cargo --version; rustup --version
- restore_cache:
keys:
- cargocache-sg-utils-rust:1.81.0-{{ checksum "~/project/Cargo.lock" }}
- cargocache-sg-utils-rust:1.91.1-{{ checksum "~/project/Cargo.lock" }}
- run:
name: Unit Tests
environment:
Expand All @@ -397,11 +348,11 @@ jobs:
paths:
- /usr/local/cargo/registry
- target
key: cargocache-sg-utils-rust:1.81.0-{{ checksum "~/project/Cargo.lock" }}
key: cargocache-sg-utils-rust:1.91.1-{{ checksum "~/project/Cargo.lock" }}

sg-eth-airdrop:
docker:
- image: rust:1.81.0
- image: rust:1.91.1
working_directory: ~/project/contracts/sg-eth-airdrop
steps:
- checkout:
Expand All @@ -411,7 +362,7 @@ jobs:
command: rustc --version; cargo --version; rustup --version
- restore_cache:
keys:
- cargocache-sg-eth-airdrop-rust:1.81.0-{{ checksum "~/project/Cargo.lock" }}
- cargocache-sg-eth-airdrop-rust:1.91.1-{{ checksum "~/project/Cargo.lock" }}
- run:
name: Unit Tests
environment:
Expand All @@ -433,19 +384,19 @@ jobs:
paths:
- /usr/local/cargo/registry
- target
key: cargocache-sg-eth-airdrop-rust:1.81.0-{{ checksum "~/project/Cargo.lock" }}
key: cargocache-sg-eth-airdrop-rust:1.91.1-{{ checksum "~/project/Cargo.lock" }}

lint:
docker:
- image: rust:1.81.0
- image: rust:1.91.1
steps:
- checkout
- run:
name: Version information
command: rustc --version; cargo --version; rustup --version; rustup target list --installed
- restore_cache:
keys:
- cargocache-v2-lint-rust:1.81.0-{{ checksum "Cargo.lock" }}
- cargocache-v2-lint-rust:1.91.1-{{ checksum "Cargo.lock" }}
- run:
name: Add rustfmt component
command: rustup component add rustfmt
Expand All @@ -464,15 +415,17 @@ jobs:
- target/debug/.fingerprint
- target/debug/build
- target/debug/deps
key: cargocache-v2-lint-rust:1.81.0-{{ checksum "Cargo.lock" }}
key: cargocache-v2-lint-rust:1.91.1-{{ checksum "Cargo.lock" }}

# This runs one time on the top level to ensure all contracts compile properly into wasm.
# We don't run the wasm build per contract build, and then reuse a lot of the same dependencies, so this speeds up CI time
# for all the other tests.
# We also sanity-check the resultant wasm files.
wasm-build:
docker:
- image: rust:1.81.0
# Use 1.83.0 for wasm builds - Rust 1.84+ enables reference-types by default
# which isn't supported by cosmwasm-check's wasmer version
- image: rust:1.83.0
steps:
- checkout:
path: ~/project
Expand All @@ -481,7 +434,7 @@ jobs:
command: rustc --version; cargo --version; rustup --version
- restore_cache:
keys:
- cargocache-wasm-rust-no-wasm:1.81.0-{{ checksum "~/project/Cargo.lock" }}
- cargocache-wasm-rust-no-wasm:1.83.0-{{ checksum "~/project/Cargo.lock" }}
- run:
name: Add wasm32 target
command: rustup target add wasm32-unknown-unknown
Expand Down Expand Up @@ -528,14 +481,14 @@ jobs:
- /target/debug
- /target/release
- /target/tarpaulin
key: cargocache-wasm-rust-no-wasm:1.81.0-{{ checksum "~/project/Cargo.lock" }}
key: cargocache-wasm-rust-no-wasm:1.83.0-{{ checksum "~/project/Cargo.lock" }}
- run:
name: Check wasm contracts
command: |
for W in ./target/wasm32-unknown-unknown/release/*.wasm
do
echo -n "Checking `basename $W`... "
cosmwasm-check --available-capabilities iterator,staking,stargate,stargaze,cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3,cosmwasm_1_4 $W
cosmwasm-check --available-capabilities iterator,staking,stargate,stargaze,cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3,cosmwasm_1_4,cosmwasm_2_0,cosmwasm_2_1,cosmwasm_2_2 $W
done

# This job roughly follows the instructions from https://circleci.com/blog/publishing-to-github-releases-via-circleci/
Expand Down
Loading
Loading