From 5abd0fa52e8fa286f6143b83b005cb33cf391def Mon Sep 17 00:00:00 2001 From: Tasio Victoria Date: Mon, 21 Aug 2023 23:44:14 -0400 Subject: [PATCH] Try fix CI --- .cargo/config | 5 ++-- .github/workflows/basic.yml | 29 ++++++++++++------- .github/workflows/e2e.yml | 20 ++++++++----- contracts/infinity-builder/Cargo.toml | 5 ++++ contracts/infinity-factory/Cargo.toml | 5 ++++ contracts/infinity-global/Cargo.toml | 5 ++++ contracts/infinity-index/Cargo.toml | 5 ++++ contracts/infinity-pair/Cargo.toml | 5 ++++ contracts/infinity-router/Cargo.toml | 5 ++++ .../packages/infinity-types/package.json | 2 +- 10 files changed, 64 insertions(+), 22 deletions(-) diff --git a/.cargo/config b/.cargo/config index cb0fd7b..961393c 100644 --- a/.cargo/config +++ b/.cargo/config @@ -1,6 +1,5 @@ [alias] -wasm = "build --release --target wasm32-unknown-unknown" +wasm = "build --release --lib --target wasm32-unknown-unknown" wasm-debug = "build --target wasm32-unknown-unknown" unit-test = "test --lib -- --nocapture" -schema = "run --example schema" -integration-test = "test --package e2e-tests -- --nocapture --ignored --test-threads 1 -Z unstable-options --report-time" \ No newline at end of file +schema = "run --example schema" \ No newline at end of file diff --git a/.github/workflows/basic.yml b/.github/workflows/basic.yml index 97c6190..d51dd93 100644 --- a/.github/workflows/basic.yml +++ b/.github/workflows/basic.yml @@ -19,30 +19,31 @@ jobs: target: wasm32-unknown-unknown override: true + - name: Cache Cargo dependencies + uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Compile WASM contract uses: actions-rs/cargo@v1 with: command: wasm - args: --locked - name: Unit Tests - run: cargo unit-test --locked + run: cargo unit-test - name: Install check_contract run: cargo install --debug --version 1.0.0 --features iterator --example check_contract -- cosmwasm-vm - - name: Check wasm contracts - run: | - for W in ./target/wasm32-unknown-unknown/release/*.wasm - do - echo -n "Checking `$W`... " - check_contract --supported-features iterator,staking,stargate,stargaze $W - done - lint: name: Lint runs-on: ubuntu-latest steps: + - uses: extractions/setup-just@v1 + - name: Checkout sources uses: actions/checkout@v2 @@ -54,7 +55,13 @@ jobs: override: true components: rustfmt, clippy - - uses: extractions/setup-just@v1 + - name: Cache Cargo dependencies + uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + target + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Run cargo doc uses: actions-rs/cargo@v1 diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index fd0c5c4..8959e4c 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -8,6 +8,8 @@ jobs: name: E2E tests runs-on: ubuntu-latest steps: + - uses: extractions/setup-just@v1 + - name: Checkout sources uses: actions/checkout@v3 @@ -17,6 +19,9 @@ jobs: toolchain: nightly targets: wasm32-unknown-unknown + - name: Download artifacts + run: just download-artifacts + - name: Rust Dependencies Cache uses: actions/cache@v3 with: @@ -24,18 +29,19 @@ jobs: ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ - target/ - artifacts/ + artifacts key: ${{ runner.os }}-cargo-with-artifacts-${{ hashFiles('**/Cargo.lock') }} - - uses: extractions/setup-just@v1 - - - name: Download artifacts - run: just download-artifacts - - name: Optimize contracts run: just optimize + - name: Optimized Contracts Cache + uses: actions/cache@v3 + with: + path: | + target/ + key: ${{ runner.os }}-cargo-with-artifacts-${{ hashFiles('contracts/**') }} + - name: Run local stargaze chain run: just deploy-local diff --git a/contracts/infinity-builder/Cargo.toml b/contracts/infinity-builder/Cargo.toml index af1540f..b3bf365 100644 --- a/contracts/infinity-builder/Cargo.toml +++ b/contracts/infinity-builder/Cargo.toml @@ -14,6 +14,11 @@ exclude = [ [lib] crate-type = ["cdylib", "rlib"] +[[bin]] +name = "schema" +path = "src/bin/schema.rs" +doc = false + [features] # for more explicit tests, cargo test --features=backtraces backtraces = ["cosmwasm-std/backtraces"] diff --git a/contracts/infinity-factory/Cargo.toml b/contracts/infinity-factory/Cargo.toml index e61cc20..a4e4a27 100644 --- a/contracts/infinity-factory/Cargo.toml +++ b/contracts/infinity-factory/Cargo.toml @@ -14,6 +14,11 @@ exclude = [ [lib] crate-type = ["cdylib", "rlib"] +[[bin]] +name = "schema" +path = "src/bin/schema.rs" +doc = false + [features] # for more explicit tests, cargo test --features=backtraces backtraces = ["cosmwasm-std/backtraces"] diff --git a/contracts/infinity-global/Cargo.toml b/contracts/infinity-global/Cargo.toml index b452b01..6e3a02b 100644 --- a/contracts/infinity-global/Cargo.toml +++ b/contracts/infinity-global/Cargo.toml @@ -14,6 +14,11 @@ exclude = [ [lib] crate-type = ["cdylib", "rlib"] +[[bin]] +name = "schema" +path = "src/bin/schema.rs" +doc = false + [features] # for more explicit tests, cargo test --features=backtraces backtraces = ["cosmwasm-std/backtraces"] diff --git a/contracts/infinity-index/Cargo.toml b/contracts/infinity-index/Cargo.toml index f5cfc8a..fef0389 100644 --- a/contracts/infinity-index/Cargo.toml +++ b/contracts/infinity-index/Cargo.toml @@ -14,6 +14,11 @@ exclude = [ [lib] crate-type = ["cdylib", "rlib"] +[[bin]] +name = "schema" +path = "src/bin/schema.rs" +doc = false + [features] # for more explicit tests, cargo test --features=backtraces backtraces = ["cosmwasm-std/backtraces"] diff --git a/contracts/infinity-pair/Cargo.toml b/contracts/infinity-pair/Cargo.toml index f2379ed..e011eb3 100644 --- a/contracts/infinity-pair/Cargo.toml +++ b/contracts/infinity-pair/Cargo.toml @@ -14,6 +14,11 @@ exclude = [ [lib] crate-type = ["cdylib", "rlib"] +[[bin]] +name = "schema" +path = "src/bin/schema.rs" +doc = false + [features] # for more explicit tests, cargo test --features=backtraces backtraces = ["cosmwasm-std/backtraces"] diff --git a/contracts/infinity-router/Cargo.toml b/contracts/infinity-router/Cargo.toml index 506d165..059e178 100644 --- a/contracts/infinity-router/Cargo.toml +++ b/contracts/infinity-router/Cargo.toml @@ -14,6 +14,11 @@ exclude = [ [lib] crate-type = ["cdylib", "rlib"] +[[bin]] +name = "schema" +path = "src/bin/schema.rs" +doc = false + [features] # for more explicit tests, cargo test --features=backtraces backtraces = ["cosmwasm-std/backtraces"] diff --git a/typescript/packages/infinity-types/package.json b/typescript/packages/infinity-types/package.json index a9ad075..6c2843e 100644 --- a/typescript/packages/infinity-types/package.json +++ b/typescript/packages/infinity-types/package.json @@ -1,6 +1,6 @@ { "name": "@stargazezone/infinity-types", - "version": "0.1.0", + "version": "0.2.0", "description": "The official types package for the Infinity Swap protocol", "author": "Tasio Victoria", "homepage": "https://stargaze.zone/",