From 9cf6d8d8a5975116f8992a40a614dbece3309f64 Mon Sep 17 00:00:00 2001 From: kent-3 <100624004+kent-3@users.noreply.github.com> Date: Sat, 3 Aug 2024 00:00:01 -0400 Subject: [PATCH] add integrations test --- .github/workflows/Secret_gateway_tests.yml | 116 +++++++-------------- 1 file changed, 40 insertions(+), 76 deletions(-) diff --git a/.github/workflows/Secret_gateway_tests.yml b/.github/workflows/Secret_gateway_tests.yml index 7845deb..db5a31c 100644 --- a/.github/workflows/Secret_gateway_tests.yml +++ b/.github/workflows/Secret_gateway_tests.yml @@ -61,84 +61,48 @@ jobs: target/ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} restore-keys: ${{ runner.os }}-cargo- - - uses: mozilla-actions/sccache-action@v0.0.4 + - uses: mozilla-actions/sccache-action@v0.0.5 - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.rust }} - run: cargo test --release - # secret_gateway_tests: - # runs-on: ubuntu-latest - # strategy: - # fail-fast: false - # env: - # RUST_BACKTRACE: full - # RUSTC_WRAPPER: sccache - # RUSTV: stable - # SCCACHE_CACHE_SIZE: 2G - # SCCACHE_DIR: /home/runner/.cache/sccache - # # SCCACHE_RECACHE: 1 # Uncomment this to clear cache, then comment it back out - # services: - # secret: - # image: ghcr.io/scrtlabs/localsecret:v1.13.3 - # ports: - # - 1317:1317 - # - 5000:5000 - # - 9091:9091 - # - 26657:26657 - # steps: - # - uses: actions/checkout@v2 - # - name: Install sccache - # env: - # LINK: https://github.com/mozilla/sccache/releases/download - # SCCACHE_VERSION: v0.2.15 - # run: | - # SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl - # mkdir -p $HOME/.local/bin - # curl -L "$LINK/$SCCACHE_VERSION/$SCCACHE_FILE.tar.gz" | tar xz - # mv -f $SCCACHE_FILE/sccache $HOME/.local/bin/sccache - # chmod +x $HOME/.local/bin/sccache - # echo "$HOME/.local/bin" >> $GITHUB_PATH - # - name: Install dependencies - # run: npm --prefix TNLS-Gateways/secret/tests/ install - # - name: Install Rust - # uses: ./.github/actions/install-rust - # with: - # toolchain: stable - # - name: Add wasm toolchain - # run: | - # rustup target add wasm32-unknown-unknown - # - name: Install wasm-opt - # run: sudo apt update && sudo apt install -y binaryen clang - # - name: Cache cargo registry - # uses: actions/cache@v2 - # continue-on-error: false - # with: - # path: | - # ~/.cargo/registry - # ~/.cargo/git - # key: ubuntu-latest-cargo-${{ hashFiles('**/Cargo.lock') }} - # restore-keys: | - # ubuntu-latest-cargo- - # - name: Save sccache - # uses: actions/cache@v2 - # continue-on-error: false - # with: - # path: /home/runner/.cache/sccache - # key: ubuntu-latest-sccache-${{ hashFiles('**/Cargo.lock') }} - # restore-keys: | - # ubuntu-latest-sccache- - # - name: Start sccache server - # run: sccache --start-server - # - name: Run cargo clippy - # run: cd TNLS-Gateways/secret/ && make clippy - # - name: Run unit tests - # run: cd TNLS-Gateways/secret/ && make unit-test - # - name: Build wasm contract - # run: cd TNLS-Gateways/secret/ && make build-mainnet - # - name: Run integration tests - # run: cd TNLS-Gateways/secret/ && make integration-test - # - name: Print sccache stats - # run: sccache --show-stats - # - name: Stop sccache server - # run: sccache --stop-server || true + integration_tests: + runs-on: ubuntu-latest + strategy: + matrix: + rust: + - stable + services: + secret: + image: ghcr.io/scrtlabs/localsecret:v1.13.3 + ports: + - 1317:1317 + - 5000:5000 + - 9091:9091 + - 26657:26657 + steps: + - uses: actions/checkout@v4 + - uses: actions/cache@v4 + with: + path: | + ~/.cargo + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo- + - uses: mozilla-actions/sccache-action@v0.0.5 + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust }} + - name: Install dependencies + run: npm --prefix tests/ install + - name: Install wasm-opt + run: sudo apt update && sudo apt install -y binaryen clang + - name: Run cargo clippy + run: make clippy + - name: Run unit tests + run: make unit-test + - name: Build wasm contract + run: make build-mainnet + - name: Run integration tests + run: make integration-test