Skip to content
Closed
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
35 changes: 0 additions & 35 deletions .github/workflows/cosmetic.yml

This file was deleted.

78 changes: 0 additions & 78 deletions .github/workflows/release.yaml

This file was deleted.

28 changes: 26 additions & 2 deletions .github/workflows/reusable-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ on:
type: string
required: true
description: 'The spawn command to create the chain'
spawn-extra-cmd:
type: string
required: false
description: 'Extra command to run after the chain is created'
start-chain-cmd:
type: string
required: true
Expand Down Expand Up @@ -62,13 +66,33 @@ jobs:
uses: actions/download-artifact@master
with:
name: spawn
# in the runner path
path: /home/runner/go/bin

- name: Spawn Permission
run: chmod +x ./spawn && ls -l
run: chmod +x /home/runner/go/bin/spawn

# === Chain Creation & Validation ===
- name: Spawn Gen - '${{inputs.id}}'
run: ${{ inputs.spawn-create-cmd }}
run: |
git config --global --add url."git@github.com:".insteadOf "https://github.com/"
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
${{ inputs.spawn-create-cmd }}
pwd

- uses: actions/checkout@v2
- name: Setup upterm session
uses: lhotari/action-upterm@v1
with:
wait-timeout-minutes: 2
limit-access-to-users: reecepbcups

- name: Spawn Extra Generation
if : ${{ inputs.spawn-extra-cmd }}
run: ${{ inputs.spawn-extra-cmd }}



- name: Build and Run '${{inputs.id}}'
run: |
Expand Down
43 changes: 26 additions & 17 deletions .github/workflows/spawn-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,35 @@ jobs:
name: spawn
path: ./bin/spawn

normal-staking:
needs: build-spawn
uses: ./.github/workflows/reusable-e2e.yaml
with:
id: Proof of Stake
spawn-create-cmd: ./spawn new mychain --consensus=proof-of-stake --bypass-prompt --bech32=prefix --bin=appd --no-git --org=rollchains-org --denom=uroll --debug --log-level=debug
start-chain-cmd: HOME_DIR="~/.simapp" CHAIN_ID="localchain-1" BLOCK_TIME="2000ms" CLEAN=true sh scripts/test_node.sh &
# normal-staking:
# needs: build-spawn
# uses: ./.github/workflows/reusable-e2e.yaml
# with:
# id: Proof of Stake
# spawn-create-cmd: ./spawn new mychain --consensus=proof-of-stake --bypass-prompt --bech32=prefix --bin=appd --no-git --org=rollchains-org --denom=uroll --debug --log-level=debug
# start-chain-cmd: HOME_DIR="~/.simapp" CHAIN_ID="localchain-1" BLOCK_TIME="2000ms" CLEAN=true sh scripts/test_node.sh &

proof-of-authority:
needs: build-spawn
uses: ./.github/workflows/reusable-e2e.yaml
with:
id: Proof of Authority
spawn-create-cmd: ./spawn new mychain --consensus=proof-of-authority --bypass-prompt --bech32=cosmos --bin=appd --no-git --org=rollchains-org --denom=uroll --debug --log-level=debug
start-chain-cmd: HOME_DIR="~/.simapp" CHAIN_ID="localchain-1" BLOCK_TIME="2000ms" CLEAN=true sh scripts/test_node.sh &
# proof-of-authority:
# needs: build-spawn
# uses: ./.github/workflows/reusable-e2e.yaml
# with:
# id: Proof of Authority
# spawn-create-cmd: ./spawn new mychain --consensus=proof-of-authority --bypass-prompt --bech32=cosmos --bin=appd --no-git --org=rollchains-org --denom=uroll --debug --log-level=debug
# start-chain-cmd: HOME_DIR="~/.simapp" CHAIN_ID="localchain-1" BLOCK_TIME="2000ms" CLEAN=true sh scripts/test_node.sh &

# normal-ics:
# needs: build-spawn
# uses: ./.github/workflows/reusable-e2e.yaml
# with:
# id: ICS - Cosmos Hub
# spawn-create-cmd: ./spawn new mychain --consensus=ics --bin=appd --bypass-prompt --bech32=roll --no-git --org=rollchains-org --denom=uroll --debug --log-level=debug
# start-chain-cmd: HOME_DIR="~/.icsnetwork" CHAIN_ID="localchain-2" CLEAN=true BLOCK_TIME="2000ms" sh scripts/test_ics_node.sh &

normal-ics:
ics-with-user-modules:
needs: build-spawn
uses: ./.github/workflows/reusable-e2e.yaml
with:
id: ICS - Cosmos Hub
spawn-create-cmd: ./spawn new mychain --consensus=ics --bin=appd --bypass-prompt --bech32=roll --no-git --org=rollchains-org --denom=uroll --debug --log-level=debug
id: ICS - Module Plugins
spawn-create-cmd: spawn new mychain --consensus=ics --bin=appd --bypass-prompt --bech32=roll --org=rollchains-org --denom=uroll --debug --log-level=debug
spawn-extra-cmd: cd mychain && spawn module new aaaaaa && make proto-gen
start-chain-cmd: HOME_DIR="~/.icsnetwork" CHAIN_ID="localchain-2" CLEAN=true BLOCK_TIME="2000ms" sh scripts/test_ics_node.sh &
37 changes: 0 additions & 37 deletions .github/workflows/unit-test.yaml

This file was deleted.

16 changes: 12 additions & 4 deletions simapp/scripts/protocgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,31 @@ set -e

GO_MOD_PACKAGE="github.com/rollchains/spawn/simapp"

echo "Generating gogo proto code"
cd proto
proto_dirs=$(find . -path -prune -o -name '*.proto' -print0 | xargs -0 -n1 dirname | sort | uniq)
for dir in $proto_dirs; do
for file in $(find "${dir}" -maxdepth 1 -name '*.proto'); do
# this regex checks if a proto file has its go_package set to github.com/strangelove-ventures/poa/...
# this regex checks if a proto file has its go_package set to $GO_MOD_PACKAGE...
# gogo proto files SHOULD ONLY be generated if this is false
# we don't want gogo proto to run for proto files which are natively built for google.golang.org/protobuf
if grep -q "option go_package" "$file" && grep -H -o -c "option go_package.*$GO_MOD_PACKAGE/api" "$file" | grep -q ':0$'; then
buf generate --template buf.gen.gogo.yaml $file

# module/v1 use `import "cosmos/app/v1alpha1/module.proto";`
# if grep -q "option go_package" "$file" && grep -H -o -c "option go_package.*$GO_MOD_PACKAGE/api" "$file" | grep -q ':0$'; then
if grep -q "module.proto" "$file"; then
echo "Skipping module.proto file: $file"
continue
fi

echo "Generated proto code: file: $file"
buf generate --template buf.gen.gogo.yaml $file
done
done

echo "Generating pulsar proto code"
buf generate --template buf.gen.pulsar.yaml
echo "Generated pulsar proto code: status: $?"

# back to the root of the directory
cd ..

cp -r $GO_MOD_PACKAGE/* ./
Expand Down