Skip to content

Shared sdk integration Branch (do not close) #3537

Shared sdk integration Branch (do not close)

Shared sdk integration Branch (do not close) #3537

Workflow file for this run

name: Build and Test
on:
push:
branches:
- main
- "!eth-bridge-integration"
# Run in PRs with conflicts (https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request)
pull_request_target:
branches:
- main
- "!eth-bridge-integration"
types: [opened, synchronize, reopened]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
permissions:
id-token: write
contents: read
packages: read
env:
GIT_LFS_SKIP_SMUDGE: 1
jobs:
build-wasm:
timeout-minutes: 30
runs-on: ${{ matrix.os }}
container:
image: ghcr.io/anoma/namada:wasm-0.11.0
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
wasm_cache_version: ["v2"]
mold_version: [1.7.0]
steps:
- name: Checkout repo
uses: actions/checkout@v3
if: ${{ github.event_name != 'pull_request_target' }}
- name: Checkout PR
uses: actions/checkout@v3
if: ${{ github.event_name == 'pull_request_target' }}
# From https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target:
# "This event runs in the context of the base of the pull request,
# rather than in the context of the merge commit, as the pull_request
# event does."
# We set the ref to the head commit of the PR instead.
# For this, we have to make sure that we're not running CI on untrusted
# code (more info in the link above), so the repo MUST be configured
# to disallow that.
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Build WASM
run: |
make build-wasm-scripts
- name: Upload wasm artifacts
uses: actions/upload-artifact@v3
with:
name: wasm-${{ github.event.pull_request.head.sha || github.sha }}
path: |
wasm/tx_*.wasm
wasm/vp_*.wasm
wasm/checksums.json
test-wasm:
timeout-minutes: 30
runs-on: ${{ matrix.os }}
needs: [build-wasm]
container:
image: ghcr.io/anoma/namada:wasm-0.8.0
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
wasm_cache_version: ["v2"]
mold_version: [1.7.0]
steps:
- name: Checkout repo
uses: actions/checkout@v3
if: ${{ github.event_name != 'pull_request_target' }}
- name: Checkout PR
uses: actions/checkout@v3
if: ${{ github.event_name == 'pull_request_target' }}
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Duplicate checksums file
run: cp wasm/checksums.json wasm/original-checksums.json
- name: Install mold linker
run: |
wget -q -O- https://github.com/rui314/mold/releases/download/v${{ matrix.mold_version }}/mold-${{ matrix.mold_version }}-x86_64-linux.tar.gz | tar -xz
mv mold-${{ matrix.mold_version }}-x86_64-linux/bin/mold /usr/local/bin
- name: Download wasm artifacts
uses: actions/download-artifact@v3
with:
name: wasm-${{ github.event.pull_request.head.sha|| github.sha }}
path: ./wasm
env:
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=/usr/local/bin/mold"
- name: Test Wasm
run: make test-wasm
- name: Check wasm up-to-date
run: cmp -- wasm/checksums.json wasm/original-checksums.json
- name: Print diff
if: failure()
run: diff -y -W 150 wasm/checksums.json wasm/original-checksums.json --suppress-common-lines
update-wasm:
runs-on: ${{ matrix.os }}
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && needs.build-wasm.result == 'success' }}
timeout-minutes: 30
needs: [build-wasm]
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::375643557360:role/anoma-github-action-ci-master
aws-region: eu-west-1
- name: Download wasm artifacts
uses: actions/download-artifact@v3
with:
name: wasm-${{ github.event.pull_request.head.sha || github.sha }}
path: ./wasm
- name: Update WASM
run: aws s3 sync wasm s3://$BUCKET_NAME --acl public-read --exclude "*" --include "*.wasm" --exclude "*/*" --region $AWS_REGION
env:
BUCKET_NAME: namada-wasm-master
AWS_REGION: eu-west-1
namada:
runs-on: ${{ matrix.os }}
timeout-minutes: 80
needs: [build-wasm]
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
nightly_version: [nightly-2022-11-03]
mold_version: [1.7.0]
make:
- name: ABCI
suffix: ''
cache_key: namada
cache_version: v2
tendermint_artifact: tendermint-unreleased-ad825dcadbd4b98c3f91ce5a711e4fb36a69c377
env:
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: full
RUSTC_WRAPPER: sccache
SCCACHE_CACHE_SIZE: 100G
SCCACHE_BUCKET: namada-sccache-master
steps:
- name: Checkout repo
uses: actions/checkout@v3
if: ${{ github.event_name != 'pull_request_target' }}
- name: Checkout PR
uses: actions/checkout@v3
if: ${{ github.event_name == 'pull_request_target' }}
# See comment in build-and-test.yml
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::375643557360:role/anoma-github-action-ci-master
aws-region: eu-west-1
- name: Install sccache (ubuntu-20.04)
if: matrix.os == 'ubuntu-20.04'
env:
LINK: https://github.com/mozilla/sccache/releases/download
SCCACHE_VERSION: v0.3.0
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 sccache (macos-latest)
if: matrix.os == 'macos-latest'
run: |
brew update
brew install sccache
- name: Setup rust toolchain
uses: oxidecomputer/actions-rs_toolchain@ad3f86084a8a5acf2c09cb691421b31cf8af7a36
with:
profile: default
override: true
- name: Setup rust nightly
uses: oxidecomputer/actions-rs_toolchain@ad3f86084a8a5acf2c09cb691421b31cf8af7a36
with:
toolchain: ${{ matrix.nightly_version }}
profile: default
- name: Cache cargo registry
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-${{ matrix.make.cache_key }}-${{ matrix.make.cache_version }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.make.cache_key }}-${{ matrix.make.cache_version }}-cargo-
- name: Start sccache server
run: sccache --start-server
- name: Install mold linker
run: |
wget -q -O- https://github.com/rui314/mold/releases/download/v${{ matrix.mold_version }}/mold-${{ matrix.mold_version }}-x86_64-linux.tar.gz | tar -xz
mv mold-${{ matrix.mold_version }}-x86_64-linux/bin/mold /usr/local/bin
- name: Download wasm artifacts
uses: actions/download-artifact@v3
with:
name: wasm-${{ github.event.pull_request.head.sha|| github.sha }}
path: ./wasm
- uses: taiki-e/install-action@cargo-llvm-cov
- name: Run unit test
run: make test-unit-coverage${{ matrix.make.suffix }}
env:
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=/usr/local/bin/mold"
- name: Upload coverage
uses: actions/upload-artifact@v3
with:
name: coverage${{ matrix.make.suffix }}-${{ github.event.pull_request.head.sha || github.sha }}
path: target/html
retention-days: 3
- name: Print sccache stats
if: always()
run: sccache --show-stats
- name: Stop sccache server
if: always()
run: sccache --stop-server || true
namada-release:
runs-on: ${{ matrix.os }}
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
mold_version: [1.7.0]
make:
- name: ABCI Release build
suffix: ''
cache_key: namada-e2e-release
cache_version: "v2"
env:
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: full
RUSTC_WRAPPER: sccache
SCCACHE_CACHE_SIZE: 100G
SCCACHE_BUCKET: namada-sccache-master
steps:
- name: Checkout repo
uses: actions/checkout@v3
if: ${{ github.event_name != 'pull_request_target' }}
- name: Checkout PR
uses: actions/checkout@v3
if: ${{ github.event_name == 'pull_request_target' }}
# See comment in build-and-test.yml
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::375643557360:role/anoma-github-action-ci-master
aws-region: eu-west-1
- name: Install sccache (ubuntu-20.04)
if: matrix.os == 'ubuntu-20.04'
env:
LINK: https://github.com/mozilla/sccache/releases/download
SCCACHE_VERSION: v0.3.0
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 sccache (macos-latest)
if: matrix.os == 'macos-latest'
run: |
brew update
brew install sccache
- name: Setup rust toolchain
uses: oxidecomputer/actions-rs_toolchain@ad3f86084a8a5acf2c09cb691421b31cf8af7a36
with:
profile: default
override: true
- name: Cache cargo registry
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-${{ matrix.make.cache_key }}-${{ matrix.make.cache_version }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.make.cache_key }}-${{ matrix.make.cache_version }}-cargo-
- name: Install mold linker
run: |
wget -q -O- https://github.com/rui314/mold/releases/download/v${{ matrix.mold_version }}/mold-${{ matrix.mold_version }}-x86_64-linux.tar.gz | tar -xz
mv mold-${{ matrix.mold_version }}-x86_64-linux/bin/mold /usr/local/bin
- name: Start sccache server
run: sccache --start-server
- name: Build
run: make build-release${{ matrix.make.suffix }}
env:
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=/usr/local/bin/mold"
- name: Upload target binaries
uses: actions/upload-artifact@v3
with:
name: binaries${{ matrix.make.suffix }}-${{ github.event.pull_request.head.sha || github.sha }}
path: |
target/release/namada
target/release/namadac
target/release/namadaw
target/release/namadan
- name: Upload build timing report
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: build-timings-${{ github.event.pull_request.head.sha || github.sha }}
path: |
target/cargo-timings/cargo-timing.html
retention-days: 5
- name: Print sccache stats
if: always()
run: sccache --show-stats
- name: Stop sccache server
if: always()
run: sccache --stop-server || true
namada-e2e:
runs-on: ${{ matrix.os }}
timeout-minutes: 80
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
nightly_version: [nightly-2022-05-20]
mold_version: [1.7.0]
make:
- name: e2e
suffix: ''
index: 0
cache_key: namada
cache_version: v2
tendermint_artifact: tendermint-unreleased-ad825dcadbd4b98c3f91ce5a711e4fb36a69c377
wait_for: namada-release (ubuntu-20.04, 1.7.0, ABCI Release build, namada-e2e-release, v2)
- name: e2e
suffix: ''
index: 1
cache_key: namada
cache_version: v2
tendermint_artifact: tendermint-unreleased-ad825dcadbd4b98c3f91ce5a711e4fb36a69c377
wait_for: namada-release (ubuntu-20.04, 1.7.0, ABCI Release build, namada-e2e-release, v2)
env:
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: full
RUSTC_WRAPPER: sccache
SCCACHE_CACHE_SIZE: 100G
SCCACHE_BUCKET: namada-sccache-master
steps:
- name: Checkout repo
uses: actions/checkout@v3
if: ${{ github.event_name != 'pull_request_target' }}
- name: Checkout PR
uses: actions/checkout@v3
if: ${{ github.event_name == 'pull_request_target' }}
# See comment in build-and-test.yml
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::375643557360:role/anoma-github-action-ci-master
aws-region: eu-west-1
- name: Install sccache (ubuntu-20.04)
if: matrix.os == 'ubuntu-20.04'
env:
LINK: https://github.com/mozilla/sccache/releases/download
SCCACHE_VERSION: v0.3.0
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 sccache (macos-latest)
if: matrix.os == 'macos-latest'
run: |
brew update
brew install sccache
- name: Setup rust toolchain
uses: oxidecomputer/actions-rs_toolchain@ad3f86084a8a5acf2c09cb691421b31cf8af7a36
with:
profile: default
override: true
- name: Setup rust nightly
uses: oxidecomputer/actions-rs_toolchain@ad3f86084a8a5acf2c09cb691421b31cf8af7a36
with:
toolchain: ${{ matrix.nightly_version }}
profile: default
- name: Cache cargo registry
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-${{ matrix.make.cache_key }}-${{ matrix.make.cache_version }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.make.cache_key }}-${{ matrix.make.cache_version }}-cargo-
- name: Start sccache server
run: sccache --start-server
- name: Install mold linker
run: |
wget -q -O- https://github.com/rui314/mold/releases/download/v${{ matrix.mold_version }}/mold-${{ matrix.mold_version }}-x86_64-linux.tar.gz | tar -xz
mv mold-${{ matrix.mold_version }}-x86_64-linux/bin/mold /usr/local/bin
- name: Download tendermint binaries
uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: build-tendermint.yml
workflow_conclusion: success
name: ${{ matrix.make.tendermint_artifact }}
path: /usr/local/bin
- name: Download masp parameters
run: |
mkdir /home/runner/work/masp
curl -o /home/runner/work/masp/masp-spend.params -sLO https://github.com/anoma/masp/blob/ef0ef75e81696ff4428db775c654fbec1b39c21f/masp-spend.params?raw=true
curl -o /home/runner/work/masp/masp-output.params -sLO https://github.com/anoma/masp/blob/ef0ef75e81696ff4428db775c654fbec1b39c21f/masp-output.params?raw=true
curl -o /home/runner/work/masp/masp-convert.params -sLO https://github.com/anoma/masp/blob/ef0ef75e81696ff4428db775c654fbec1b39c21f/masp-convert.params?raw=true
- name: Build
run: make build
env:
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=/usr/local/bin/mold"
- name: Build test
run: make build-test
env:
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=/usr/local/bin/mold"
- name: Wait for release binaries
uses: lewagon/wait-on-check-action@v1.2.0
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
check-name: ${{ matrix.make.wait_for }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 30
allowed-conclusions: success
- name: Download wasm artifacts
uses: actions/download-artifact@v3
with:
name: wasm-${{ github.event.pull_request.head.sha|| github.sha }}
path: ./wasm
- name: Download namada binaries
uses: actions/download-artifact@v3
with:
name: binaries${{ matrix.make.suffix }}-${{ github.event.pull_request.head.sha || github.sha }}
path: ./target/release/
- name: Change permissions
run: |
chmod +x target/release/namada
chmod +x target/release/namadaw
chmod +x target/release/namadan
chmod +x target/release/namadac
chmod +x /usr/local/bin/tendermint
- name: Run e2e test
run: python3 .github/workflows/scripts/schedule-e2e.py
env:
NAMADA_TENDERMINT_WEBSOCKET_TIMEOUT: 20
NAMADA_E2E_USE_PREBUILT_BINARIES: "true"
NAMADA_E2E_KEEP_TEMP: "true"
NAMADA_TM_STDOUT: "false"
NAMADA_LOG_COLOR: "false"
NAMADA_MASP_PARAMS_DIR: "/home/runner/work/masp"
NAMADA_LOG: "info"
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=/usr/local/bin/mold"
INDEX: ${{ matrix.make.index }}
- name: Upload e2e logs
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: logs-e2e-${{ matrix.make.index }}-${{ github.event.pull_request.head.sha || github.sha }}
path: |
/tmp/.*/logs/
/tmp/.*/e2e-test.*/setup/validator-*/.namada/logs/*.log
retention-days: 5
- name: Print sccache stats
if: always()
run: sccache --show-stats
- name: Stop sccache server
if: always()
run: sccache --stop-server || true