Skip to content

Add upgrade handler to add default navs for markers #5279

Add upgrade handler to add default navs for markers

Add upgrade handler to add default navs for markers #5279

Workflow file for this run

name: Sims
# Sims workflow runs multiple types of simulations (nondeterminism, import-export, after-import, multi-seed-short)
on:
pull_request:
push:
branches:
- main
env:
LD_LIBRARY_PATH: /usr/local/lib:/usr/local/lib/x86_64-linux-gnu
# Set concurrency for this workflow to cancel in-progress jobs if retriggered.
# The github.ref is only available when triggered by a PR so fall back to github.run_id for other cases.
# The github.run_id is unique for each run, giving each such invocation it's own unique concurrency group.
# Basically, if you push to a PR branch, jobs that are still running for that PR will be cancelled.
# But jobs started because of a merge to main or a release tag push are not cancelled.
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
jobs:
setup:
if: "!contains(github.event.head_commit.message, 'skip-sims')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: technote-space/[email protected]
with:
PATTERNS: |
**/**.go
go.mod
go.sum
.github/workflows/sims.yml
sims.mk
SET_ENV_NAME_INSERTIONS: 1
SET_ENV_NAME_LINES: 1
- name: Define Variables
id: def-vars
run: |
file_prefix="sim-test-${GITHUB_SHA:0:7}-${GITHUB_RUN_ATTEMPT}"
echo "Setting output: file-prefix=$file_prefix"
echo "file-prefix=$file_prefix" >> "$GITHUB_OUTPUT"
db_cache_key_hash="${{ hashFiles('scripts/cleveldb_build_and_install.sh') }}"
echo "Setting output: db-cache-key-hash=$db_cache_key_hash"
echo "db-cache-key-hash=$db_cache_key_hash" >> "$GITHUB_OUTPUT"
go_cache_key_hash="${{ hashFiles('go.sum') }}"
echo "Setting output: go-cache-key-hash=$go_cache_key_hash"
echo "go-cache-key-hash=$go_cache_key_hash" >> "$GITHUB_OUTPUT"
outputs:
go-version: '1.20'
should-run: ${{ env.GIT_DIFF }}
file-prefix: ${{ steps.def-vars.outputs.file-prefix }}
db-cache-key-suffix: sims-db3-${{ steps.def-vars.outputs.db-cache-key-hash }}
# In Order:
# * The leveldb repo tarball
# * The directory extracted from the leveldb tarball
db-cache-path: |
leveldb*.tar.gz
leveldb-*
go-cache-key-suffix: sims-go3-${{ steps.def-vars.outputs.go-cache-key-hash }}
# In Order:
# * Go binary directory
# * Go module directory
# * Go build cache (Linux)
go-cache-path: |
~/go/bin
~/go/pkg/mod
~/.cache/go-build
build-linux:
needs: setup
if: needs.setup.outputs.should-run
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Output setup
run: |
echo " go-version: [${{ needs.setup.outputs.go-version }}]"
echo " should-run: [${{ needs.setup.outputs.should-run }}]"
echo " file-prefix: [${{ needs.setup.outputs.file-prefix }}]"
echo "db-cache-key-suffix: [${{ needs.setup.outputs.db-cache-key-suffix }}]"
echo " db-cache-path: [${{ needs.setup.outputs.db-cache-path }}]"
echo "go-cache-key-suffix: [${{ needs.setup.outputs.go-cache-key-suffix }}]"
echo " go-cache-path: [${{ needs.setup.outputs.go-cache-path }}]"
- uses: actions/cache@v3
name: Load db cache
id: db-cache-setup
with:
key: ${{ runner.os }}-${{ needs.setup.outputs.db-cache-key-suffix }}
path: ${{ needs.setup.outputs.db-cache-path }}
- uses: actions/cache@v3
name: Load go cache
id: go-cache-setup
with:
key: ${{ runner.os }}-${{ needs.setup.outputs.go-cache-key-suffix }}
path: ${{ needs.setup.outputs.go-cache-path }}
- name: Setup build environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get update
sudo apt-get install -y libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev libzstd-dev wget curl build-essential cmake gcc sqlite3
- name: Build cleveldb
if: steps.db-cache-setup.outputs.cache-hit != 'true'
run: |
export CLEVELDB_DO_BUILD='true'
export CLEVELDB_DO_INSTALL='false'
export CLEVELDB_DO_CLEANUP='false'
make cleveldb
- name: Install cleveldb
run: |
export CLEVELDB_DO_BUILD='false'
export CLEVELDB_DO_INSTALL='true'
export CLEVELDB_SUDO='true'
export CLEVELDB_DO_CLEANUP='false'
make cleveldb
echo 'WITH_CLEVELDB=true' >> "$GITHUB_ENV"
- uses: actions/setup-go@v4
with:
go-version: ${{ needs.setup.outputs.go-version }}
- name: Display go version
run: go version
- name: Install runsim
if: steps.go-cache-setup.outputs.cache-hit != 'true'
run: export GO111MODULE="on" && go get github.com/cosmos/tools/cmd/[email protected]
- name: Update provwasm contract
run: make download-smart-contracts
- name: Build provenanced
run: make build
- name: Provenanced version
run: build/provenanced version --long
runsim:
# These tests are the ones that use the runsim program (see sims.mk).
needs: [setup, build-linux]
if: needs.setup.outputs.should-run
strategy:
fail-fast: false
matrix:
test: ["import-export", "multi-seed-short", "after-import"]
db-backend: ["goleveldb"]
os: ["ubuntu-latest"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
name: Load go cache
with:
key: ${{ runner.os }}-${{ needs.setup.outputs.go-cache-key-suffix }}
path: ${{ needs.setup.outputs.go-cache-path }}
- name: Define test-logs
id: test-logs
run: |
test_logs="${{ needs.setup.outputs.file-prefix }}-${{ matrix.test }}-${{ matrix.db-backend }}-${{ matrix.os }}"
echo "Setting output: test-logs=$test_logs"
echo "test-logs=$test_logs" >> "$GITHUB_OUTPUT"
- uses: actions/setup-go@v4
with:
go-version: ${{ needs.setup.outputs.go-version }}
- name: Display go version
run: go version
- name: Update provwasm contract
run: make download-smart-contracts
- name: Test
run: |
set -x
ec=0
export DB_BACKEND=${{ matrix.db-backend }}
make test-sim-${{ matrix.test }} || ec="$?"
echo "Test exited with code $ec"
if [[ "$ec" -ne '0' ]] && ls -d /tmp/sim-logs-*; then
mkdir "${{ steps.test-logs.outputs.test-logs }}"
for logdir in $( ls -d /tmp/sim-logs-* ); do
cp -rv $logdir/* "${{ steps.test-logs.outputs.test-logs }}/" || :
done
bad_seed="$( grep -Eo 'Seed [[:digit:]]+: FAILED' "${{ steps.test-logs.outputs.test-logs }}"/runsim_log | sed -E 's/[^[:digit:]]+//g' )" || :
if [[ -n "$bad_seed" ]]; then
echo "::group::last 500 lines of seed $bad_seed stdout"
tail -n 500 "${{ steps.test-logs.outputs.test-logs }}"/*-seed-$bad_seed-*.stdout || :
echo "::endgroup::"
fi
fi
exit "$ec"
- uses: actions/upload-artifact@v3
if: failure()
with:
name: ${{ steps.test-logs.outputs.test-logs }}
path: ${{ steps.test-logs.outputs.test-logs }}
go-test-multi-db:
# These are tests that use go test to run (see sims.mk), and that we want to test using different database backends.
needs: [setup, build-linux]
if: needs.setup.outputs.should-run
strategy:
fail-fast: false
matrix:
# The test-sim-simple test is pretty quick and should be able to identify glaring problems.
# The test-sim-benchmark is handy to have for each db type.
test: ["simple", "benchmark"]
db-backend: ["goleveldb", "cleveldb"]
os: ["ubuntu-latest"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
name: Load db cache
with:
key: ${{ runner.os }}-${{ needs.setup.outputs.db-cache-key-suffix }}
path: ${{ needs.setup.outputs.db-cache-path }}
- uses: actions/cache@v3
name: Load go cache
with:
key: ${{ runner.os }}-${{ needs.setup.outputs.go-cache-key-suffix }}
path: ${{ needs.setup.outputs.go-cache-path }}
- name: Define test-logs
id: test-logs
run: |
test_logs="${{ needs.setup.outputs.file-prefix }}-${{ matrix.test }}-${{ matrix.db-backend }}-${{ matrix.os }}"
echo "Setting output: test-logs=$test_logs"
echo "test-logs=$test_logs" >> "$GITHUB_OUTPUT"
- name: Install cleveldb
if: matrix.db-backend == 'cleveldb'
run: |
export CLEVELDB_DO_BUILD='false'
export CLEVELDB_DO_INSTALL='true'
export CLEVELDB_SUDO='true'
export CLEVELDB_DO_CLEANUP='false'
make cleveldb
echo 'WITH_CLEVELDB=true' >> "$GITHUB_ENV"
- uses: actions/setup-go@v4
with:
go-version: ${{ needs.setup.outputs.go-version }}
- name: Display go version
run: go version
- name: Update provwasm contract
run: make download-smart-contracts
- name: Test
run: |
set -x
export DB_BACKEND=${{ matrix.db-backend }}
make test-sim-${{ matrix.test }} | tee "${{ steps.test-logs.outputs.test-logs }}.txt"
exit "${PIPESTATUS[0]}"
- uses: actions/upload-artifact@v3
if: failure()
with:
name: ${{ steps.test-logs.outputs.test-logs }}
path: ${{ steps.test-logs.outputs.test-logs }}.txt
go-test-single-db:
# These are tests that use go test to run (see sims.mk), and that we don't care about testing using different database backends.
needs: [setup, build-linux]
if: needs.setup.outputs.should-run
strategy:
fail-fast: false
matrix:
# The test-sim-nondeterminism test hard-codes the db backend to use memdb.
# The test-sim-benchmark-invariants test can use different db backends, but to save resources, is down here.
test: ["nondeterminism", "benchmark-invariants"]
os: ["ubuntu-latest"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
name: Load go cache
with:
key: ${{ runner.os }}-${{ needs.setup.outputs.go-cache-key-suffix }}
path: ${{ needs.setup.outputs.go-cache-path }}
- name: Define test-logs
id: test-logs
run: |
test_logs="${{ needs.setup.outputs.file-prefix }}-${{ matrix.test }}-${{ matrix.os }}"
echo "Setting output: test-logs=$test_logs"
echo "test-logs=$test_logs" >> "$GITHUB_OUTPUT"
- uses: actions/setup-go@v4
with:
go-version: ${{ needs.setup.outputs.go-version }}
- name: Display go version
run: go version
- name: Update provwasm contract
run: make download-smart-contracts
- name: Test
run: |
set -x
make test-sim-${{ matrix.test }} | tee "${{ steps.test-logs.outputs.test-logs }}.txt"
exit "${PIPESTATUS[0]}"
- uses: actions/upload-artifact@v3
if: failure()
with:
name: ${{ steps.test-logs.outputs.test-logs }}
path: ${{ steps.test-logs.outputs.test-logs }}.txt
# Sim tests that are not run in here:
# test-sim-multi-seed-long: runsim
# The short version does 50 blocks and takes 30-40 minutes. The long one does 500 blocks. Way too long.
# test-sim-custom-genesis-multi-seed: runsim
# This one requires a genesis file to be created, and I don't feel like doing that right now.
# test-sim-custom-genesis-fast:
# Same as test-sim-custom-genesis-multi-seed.
# test-sim-profile:
# This is the exact same thing as test-sim-benchmark except with a couple extra output files.
# Unless I add an upload for them, it's not worth doing it again.