Skip to content
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
213 changes: 213 additions & 0 deletions .github/workflows/ict-E2E.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
name: ictest E2E

on:
pull_request:
push:
tags:
- "**"
branches:
- "main"
- "master"

permissions:
contents: read
packages: write

env:
GO_VERSION: 1.24.5
TAR_PATH: /tmp/terp-docker-image.tar
IMAGE_NAME: terp-docker-image

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: interchaintest/go.sum

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and export
uses: docker/build-push-action@v6
with:
context: .
tags: terpnetwork/terp-core:local
outputs: type=docker,dest=${{ env.TAR_PATH }}

- name: Upload artifact
uses: actions/upload-artifact@v5
with:
name: ${{ env.IMAGE_NAME }}
path: ${{ env.TAR_PATH }}

e2e-tests:
needs: build-docker
runs-on: ubuntu-latest
strategy:
matrix:
test:
- "e2e-basic"
- "e2e-pfm"
- "e2e-ibc"
- "e2e-polytone"
# - "e2e-clock"
# - "e2e-upgrade"
# - "e2e-drip"
# - "e2e-cwhooks"
fail-fast: false

steps:
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: interchaintest/go.sum

- name: checkout chain
uses: actions/checkout@v6

- name: Download Tarball Artifact
uses: actions/download-artifact@v6
with:
name: ${{ env.IMAGE_NAME }}
path: /tmp

- name: Load Docker Image
run: |
docker image load -i ${{ env.TAR_PATH }}
docker image ls -a

- name: Run Test
id: run_test
continue-on-error: true
run: make ${{ matrix.test }}

- name: Retry Failed Test
if: steps.run_test.outcome == 'failure'
run: |
for i in 1 2; do
echo "Retry attempt $i"
if make ${{ matrix.test }}; then
echo "Test passed on retry"
exit 0
fi
done
echo "Test failed after retries"
exit 1

build-ict:
runs-on: ubuntu-latest
steps:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache cargo registry and target
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
workspace/ict-rs/target
key: ${{ runner.os }}-cargo-ict-${{ hashFiles('workspace/ict-rs/**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-ict-

- name: Detect dependency profile
id: deps
run: |
BRANCH="${{ github.head_ref || github.ref_name }}"
if echo "$BRANCH" | grep -qi "zk"; then
echo "cosmos_rust_ref=zk" >> $GITHUB_OUTPUT
echo "tendermint_ref=zk" >> $GITHUB_OUTPUT
echo "cw_orch_ref=zk" >> $GITHUB_OUTPUT
else
echo "cosmos_rust_ref=main" >> $GITHUB_OUTPUT
echo "tendermint_ref=main" >> $GITHUB_OUTPUT
echo "cw_orch_ref=cw3" >> $GITHUB_OUTPUT
fi

- name: Clone ict-rs and dependencies
run: |
mkdir -p workspace
git clone --depth 1 https://github.com/permissionlessweb/ict-rs.git workspace/ict-rs
git clone --depth 1 -b ${{ steps.deps.outputs.cosmos_rust_ref }} https://github.com/permissionlessweb/cosmos-rust.git workspace/cosmos-rust
git clone --depth 1 -b ${{ steps.deps.outputs.tendermint_ref }} https://github.com/permissionlessweb/tendermint-rs.git workspace/tendermint-rs
git clone --depth 1 -b ${{ steps.deps.outputs.cw_orch_ref }} https://github.com/permissionlessweb/cw-orchestrator.git workspace/cw-orchestrator

- name: Checkout terp-core for contract wasm
uses: actions/checkout@v6
with:
path: workspace/terp-core

- name: Build all ict-rs examples
run: cd workspace/ict-rs && cargo build --examples --features docker

- name: Package example binaries
run: |
mkdir -p /tmp/ict-binaries
cp workspace/ict-rs/target/debug/examples/state_sync /tmp/ict-binaries/
cp workspace/ict-rs/target/debug/examples/bootstrap_mainnet /tmp/ict-binaries/
cp workspace/ict-rs/target/debug/examples/loyalty_rewards /tmp/ict-binaries/
# Package loyalty-db assets and contract wasm
mkdir -p /tmp/ict-binaries/loyalty-db
cp workspace/ict-rs/examples/loyalty-db/schema.sql /tmp/ict-binaries/loyalty-db/
cp workspace/ict-rs/examples/loyalty-db/seed.js /tmp/ict-binaries/loyalty-db/
cp workspace/ict-rs/examples/loyalty-db/package.json /tmp/ict-binaries/loyalty-db/
cp workspace/terp-core/tests/interchaintest/contracts/loyalty_verifier.wasm /tmp/ict-binaries/
tar -czf /tmp/ict-binaries.tar.gz -C /tmp/ict-binaries .

- name: Upload ict-rs binaries
uses: actions/upload-artifact@v5
with:
name: ict-binaries
path: /tmp/ict-binaries.tar.gz

ict-tests:
needs: [build-docker, build-ict]
runs-on: ubuntu-latest
strategy:
matrix:
test:
- state_sync
- bootstrap_mainnet
- loyalty_rewards
fail-fast: false

steps:
- name: Download Docker Tarball
uses: actions/download-artifact@v6
with:
name: ${{ env.IMAGE_NAME }}
path: /tmp

- name: Load Docker Image
run: |
docker image load -i ${{ env.TAR_PATH }}
docker image ls -a

- name: Download ict-rs binaries
uses: actions/download-artifact@v6
with:
name: ict-binaries
path: /tmp

- name: Extract and run ict-rs test
env:
TERP_IMAGE_REPO: terpnetwork/terp-core
TERP_IMAGE_VERSION: local
run: |
mkdir -p /tmp/ict-binaries
tar -xzf /tmp/ict-binaries.tar.gz -C /tmp/ict-binaries
chmod +x /tmp/ict-binaries/${{ matrix.test }}
/tmp/ict-binaries/${{ matrix.test }}
108 changes: 0 additions & 108 deletions .github/workflows/interchaintest-E2E.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
--build-arg GO_VERSION=${{ steps.go-version.outputs.version }} \
--build-arg GIT_VERSION=${VERSION} \
--build-arg GIT_COMMIT=${COMMIT} \
--build-arg RUNNER_IMAGE=alpine:3.17 \
--build-arg RUNNER_IMAGE=alpine:3.20 \
--platform linux/${{ matrix.arch }} \
-t terp-core:local-${{ matrix.arch }} \
--load \
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dist
heighliner*
tools-stamp
docs/node_modules

target
# Data - ideally these don't exist
baseapp/data/*
client/lcd/keys/*
Expand Down
Loading
Loading