chore: sync with ibc-rs
(#193)
#457
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Integration tests | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
ibc-integration: | |
runs-on: ubuntu-latest | |
env: | |
COMETBFT_VERSION: 0.37.4 | |
GAIA_VERSION: 15.2.0 | |
HERMES_VERSION: 1.8.2 | |
GRPCURL_VERSION: 1.9.1 | |
RUST_VERSION: 1.77.2 | |
IBC_COMMITISH: master | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download CometBFT | |
uses: dsaltares/fetch-gh-release-asset@master | |
with: | |
repo: cometbft/cometbft | |
version: "tags/v${{ env.COMETBFT_VERSION }}" | |
file: "cometbft_${{ env.COMETBFT_VERSION }}_linux_amd64.tar.gz" | |
- name: Download Gaia | |
uses: dsaltares/fetch-gh-release-asset@master | |
with: | |
repo: cosmos/gaia | |
version: "tags/v${{ env.GAIA_VERSION }}" | |
file: "gaiad-v${{ env.GAIA_VERSION }}-linux-amd64" | |
- name: Download Hermes | |
uses: dsaltares/fetch-gh-release-asset@master | |
with: | |
repo: informalsystems/hermes | |
version: "tags/v${{ env.HERMES_VERSION }}" | |
file: "hermes-v${{ env.HERMES_VERSION }}-x86_64-unknown-linux-gnu.tar.gz" | |
- name: Download grpcurl | |
uses: dsaltares/fetch-gh-release-asset@master | |
with: | |
repo: fullstorydev/grpcurl | |
version: "tags/v${{ env.GRPCURL_VERSION }}" | |
file: "grpcurl_${{ env.GRPCURL_VERSION}}_linux_x86_64.tar.gz" | |
- name: Setup scripts and directories | |
working-directory: ci/ | |
run: | | |
echo "${HOME}" | |
mkdir -p ~/local/bin | |
cp entrypoint.sh ~/local/bin | |
mkdir -p ~/.cometbft | |
cp -r cometbft-config/ ~/.cometbft/config | |
mkdir -p ~/.hermes | |
cp hermes-config.toml ~/.hermes/config.toml | |
cp one-chain.sh ~ | |
cp user_seed.json ~ | |
cp Makefile .. | |
cp -r tests/ ~ | |
- name: Download and setup binaries | |
run: | | |
tar -xzf "cometbft_${COMETBFT_VERSION}_linux_amd64.tar.gz" | |
mv "gaiad-v${GAIA_VERSION}-linux-amd64" gaiad | |
tar -xzf "hermes-v${HERMES_VERSION}-x86_64-unknown-linux-gnu.tar.gz" | |
tar -xzf "grpcurl_${GRPCURL_VERSION}_linux_x86_64.tar.gz" | |
chmod +x cometbft gaiad hermes grpcurl | |
mv cometbft gaiad hermes grpcurl ~/local/bin | |
- name: Update environment path | |
run: | | |
echo "${HOME}/local/bin" >> $GITHUB_PATH | |
- name: Validate binaries | |
run: | | |
cometbft version | |
gaiad version | |
hermes version | |
grpcurl -version | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo | |
target | |
~/build | |
key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-rust- | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Set environment variables | |
run: | | |
echo "BASECOIN_SRC=$(pwd)" >> $GITHUB_ENV | |
echo "LOG_DIR=$(pwd)/log" >> $GITHUB_ENV | |
- name: Run integration tests | |
working-directory: ~ | |
run: | | |
mkdir -p "${LOG_DIR}" | |
if ! entrypoint.sh make test -j4; then | |
echo "" | |
echo "Tests failed. Printing logs..." | |
echo "" | |
echo "Gaia logs:" | |
tail -100 "${HOME}/data/ibc-0.log" | |
echo "" | |
echo "Basecoin logs:" | |
tail -100 "${LOG_DIR}/basecoin.log" | |
echo "" | |
echo "CometBFT logs:" | |
tail -100 "${LOG_DIR}/cometbft.log" | |
exit 1 | |
fi |