From 2172161af2d2ad41e91dbbb0b189f32d1e24a19e Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Wed, 30 Jul 2025 22:24:21 -0500 Subject: [PATCH 1/8] docci integration attempt 1 --- .github/workflows/docci.yml | 62 +++++++++++++++++++ cmd.md | 15 +++++ .../01-setup/01-system-setup.md | 6 +- .../01-setup/02-install-spawn.md | 8 ++- .../01-setup/docci_config.json | 6 ++ .../01-nameservice.md | 2 +- .../02-proto-logic.md | 5 +- .../03-application-logic.md | 16 ++++- .../02-build-your-application/04-cli.md | 4 +- .../02-build-your-application/05-testnet.md | 22 ++++--- .../docci_config.json | 8 +++ 11 files changed, 133 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/docci.yml create mode 100644 cmd.md create mode 100644 docs/versioned_docs/version-v0.50.x/01-setup/docci_config.json create mode 100644 docs/versioned_docs/version-v0.50.x/02-build-your-application/docci_config.json diff --git a/.github/workflows/docci.yml b/.github/workflows/docci.yml new file mode 100644 index 00000000..ec1a783f --- /dev/null +++ b/.github/workflows/docci.yml @@ -0,0 +1,62 @@ +name: Docci E2E (docs) + +on: +# push: +# branches: +# - main + pull_request: + workflow_dispatch: + +# Ensures that only a single workflow per PR will run at a time. Cancels in-progress jobs if new commit is pushed. +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +env: + GO_VERSION: 1.23.0 + +jobs: + run: + runs-on: ubuntu-latest + env: + DEBUGGING: true + RUST_BACKTRACE: 1 + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Ubuntu packages + run: sudo apt-get update && sudo apt-get install bash make jq + + - uses: actions/setup-node@v4 + name: Install Node.js + with: + node-version: 21 + + - name: Setup go + uses: actions/setup-go@v4 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Install Docci Readme Runner + run: | + VERSION=v0.9.2-alpha.1 + wget -O docci.tar.gz "https://github.com/Reecepbcups/docci/releases/download/${VERSION}/docci_Linux_x86_64.tar.gz" + tar -xzf docci.tar.gz + sudo mv docci /usr/local/bin/docci + sudo chmod +x /usr/local/bin/docci + rm docci.tar.gz + + + - name: setup & install spawn + run: docci run docs/versioned_docs/version-v0.50.x/01-setup/docci_config.json + + - name: builds chain + run: docci run docs/versioned_docs/version-v0.50.x/02-build-your-application/01-nameservice.md + + - name: run application + run: | + docci run docs/versioned_docs/version-v0.50.x/02-build-your-application/docci_config.json \ + --hide-background-logs --working-dir rollchain \ + --cleanup-commands="killall rolld" --cleanup-commands="rm -rf rollchain" diff --git a/cmd.md b/cmd.md new file mode 100644 index 00000000..0cf3ff46 --- /dev/null +++ b/cmd.md @@ -0,0 +1,15 @@ + +```bash +# docci run docs/versioned_docs/version-v0.50.x/01-setup/02-install-spawn.md,docs/versioned_docs/version-v0.50.x/02-build-your-application/01-nameservice.md --hide-background-logs + +# TODO: we have to support JSON files to have an array of relative file paths in the area + +# generate chain (outside of the rollchain dir since it is not generated yet) +docci run docs/versioned_docs/version-v0.50.x/02-build-your-application/01-nameservice.md --hide-background-logs + +# interaction (02 - 05) +docci run docs/versioned_docs/version-v0.50.x/02-build-your-application/docci_config.json --hide-background-logs --working-dir rollchain + +# cleanup +rm -rf rollchain +``` diff --git a/docs/versioned_docs/version-v0.50.x/01-setup/01-system-setup.md b/docs/versioned_docs/version-v0.50.x/01-setup/01-system-setup.md index ea3460cc..13b3c19e 100644 --- a/docs/versioned_docs/version-v0.50.x/01-setup/01-system-setup.md +++ b/docs/versioned_docs/version-v0.50.x/01-setup/01-system-setup.md @@ -34,7 +34,7 @@ Install [VSCode](https://code.visualstudio.com/download) if you do not already h - ```bash + ```bash docci-os=macos # Setup Homebrew (https://brew.sh/) /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" sudo echo 'export PATH=$PATH:/opt/homebrew/bin' >> ~/.zshrc @@ -104,7 +104,7 @@ Install [VSCode](https://code.visualstudio.com/download) if you do not already h - ```bash + ```bash docci-os=linux # Base sudo apt install make gcc git jq wget @@ -131,7 +131,7 @@ Install [VSCode](https://code.visualstudio.com/download) if you do not already h Some tutorials require CosmWasm (Rust smart contracts) setup. This section is option, unless a tutorial is CosmWasm focused. CosmWasm requires [Rust](https://www.rust-lang.org/). You must have this installed as the contract will be built locally. - ```bash + ```bash docci-ignore # Install rust - https://www.rust-lang.org/tools/install curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh diff --git a/docs/versioned_docs/version-v0.50.x/01-setup/02-install-spawn.md b/docs/versioned_docs/version-v0.50.x/01-setup/02-install-spawn.md index 45e40e14..e2cd6683 100644 --- a/docs/versioned_docs/version-v0.50.x/01-setup/02-install-spawn.md +++ b/docs/versioned_docs/version-v0.50.x/01-setup/02-install-spawn.md @@ -19,10 +19,10 @@ Install Spawn from source. ```bash # Install from latest source -git clone https://github.com/rollchains/spawn.git --depth 1 --branch v0.50.15 +git clone https://github.com/rollchains/spawn.git --depth 1 --branch v0.50.15 spawn_bin # Change to this directory -cd spawn +cd spawn_bin # Clear Go modules cache for a fresh install go clean -modcache @@ -42,13 +42,15 @@ spawn local-ic heighliner + +rm -rf spawn_bin ``` ## Command not found error If you get "command 'spawn' not found", run: -```bash +```bash docci-ignore # Gets your operating system unameOut="$(uname -s)" case "${unameOut}" in diff --git a/docs/versioned_docs/version-v0.50.x/01-setup/docci_config.json b/docs/versioned_docs/version-v0.50.x/01-setup/docci_config.json new file mode 100644 index 00000000..f806d10f --- /dev/null +++ b/docs/versioned_docs/version-v0.50.x/01-setup/docci_config.json @@ -0,0 +1,6 @@ +{ + "files": [ + "01-system-setup.md", + "02-install-spawn.md" + ] +} diff --git a/docs/versioned_docs/version-v0.50.x/02-build-your-application/01-nameservice.md b/docs/versioned_docs/version-v0.50.x/02-build-your-application/01-nameservice.md index c4a47b4e..6b5248ed 100644 --- a/docs/versioned_docs/version-v0.50.x/02-build-your-application/01-nameservice.md +++ b/docs/versioned_docs/version-v0.50.x/02-build-your-application/01-nameservice.md @@ -44,7 +44,7 @@ Let's create a new chain called 'rollchain'. You are going to set defining chara - Binary executable (bin) ```bash -spawn new rollchain --consensus=pos --disable=cosmwasm --bech32=roll --denom=uroll --bin=rolld +spawn new rollchain --consensus=pos --disable=cosmwasm,explorer --bech32=roll --denom=uroll --bin=rolld ``` 🎉 Your new blockchain 'rollchain' is now generated! diff --git a/docs/versioned_docs/version-v0.50.x/02-build-your-application/02-proto-logic.md b/docs/versioned_docs/version-v0.50.x/02-build-your-application/02-proto-logic.md index 05ad03d0..b3577b76 100644 --- a/docs/versioned_docs/version-v0.50.x/02-build-your-application/02-proto-logic.md +++ b/docs/versioned_docs/version-v0.50.x/02-build-your-application/02-proto-logic.md @@ -13,7 +13,7 @@ Extend the template module and add how to store and interact with data. Specific Open the `proto/nameservice/v1` directory. Edit `tx.proto` to add the transaction setter message. -```protobuf title="proto/nameservice/v1/tx.proto" +```protobuf title="proto/nameservice/v1/tx.proto" docci-file="proto/nameservice/v1/tx.proto" docci-line-replace=19 // SetServiceName allows a user to set their accounts name. rpc SetServiceName(MsgSetServiceName) returns (MsgSetServiceNameResponse); @@ -42,7 +42,8 @@ proto/nameservice/v1/tx.proto file Find `query.proto` and add the following -```protobuf title="proto/nameservice/v1/query.proto" + +```protobuf title="proto/nameservice/v1/query.proto" docci-file="proto/nameservice/v1/query.proto" docci-line-replace=15 // ResolveName allows a user to resolve the name of an account. rpc ResolveName(QueryResolveNameRequest) returns (QueryResolveNameResponse) { diff --git a/docs/versioned_docs/version-v0.50.x/02-build-your-application/03-application-logic.md b/docs/versioned_docs/version-v0.50.x/02-build-your-application/03-application-logic.md index ee393b4c..3858088c 100644 --- a/docs/versioned_docs/version-v0.50.x/02-build-your-application/03-application-logic.md +++ b/docs/versioned_docs/version-v0.50.x/02-build-your-application/03-application-logic.md @@ -35,13 +35,25 @@ func NewKeeper() Keeper { } ``` + + --- ## Application Logic Update the msg_server logic to set the name upon request from a user. -```go title="x/nameservice/keeper/msg_server.go" +```go title="x/nameservice/keeper/msg_server.go" docci-file=x/nameservice/keeper/msg_server.go docci-line-replace=30-38 func (ms msgServer) SetServiceName(ctx context.Context, msg *types.MsgSetServiceName) (*types.MsgSetServiceNameResponse, error) { // highlight-start if err := ms.k.NameMapping.Set(ctx, msg.Sender, msg.Name); err != nil { @@ -55,7 +67,7 @@ func (ms msgServer) SetServiceName(ctx context.Context, msg *types.MsgSetService and also for the query_server to retrieve the name. -```go title="x/nameservice/keeper/query_server.go" +```go title="x/nameservice/keeper/query_server.go" docci-file=x/nameservice/keeper/query_server.go docci-line-replace=33-37 func (k Querier) ResolveName(goCtx context.Context, req *types.QueryResolveNameRequest) (*types.QueryResolveNameResponse, error) { // highlight-start v, err := k.Keeper.NameMapping.Get(goCtx, req.Wallet) diff --git a/docs/versioned_docs/version-v0.50.x/02-build-your-application/04-cli.md b/docs/versioned_docs/version-v0.50.x/02-build-your-application/04-cli.md index 53dd2996..8c61ce42 100644 --- a/docs/versioned_docs/version-v0.50.x/02-build-your-application/04-cli.md +++ b/docs/versioned_docs/version-v0.50.x/02-build-your-application/04-cli.md @@ -13,7 +13,7 @@ Using the AutoCLI, you will easily set up the CLI client for transactions and qu Update the autocli to allow someone to get the name of a wallet account. -```go title="x/nameservice/autocli.go" +```go title="x/nameservice/autocli.go" docci-file="x/nameservice/autocli.go" docci-line-replace=11-20 Query: &autocliv1.ServiceCommandDescriptor{ Service: modulev1.Query_ServiceDesc.ServiceName, RpcCommandOptions: []*autocliv1.RpcCommandOptions{ @@ -48,7 +48,7 @@ Update the autocli to allow someone to get the name of a wallet account. Also add interaction in `x/nameservice/autocli.go` to set the name of a wallet account. -```go title="x/nameservice/autocli.go" +```go title="x/nameservice/autocli.go" docci-file="x/nameservice/autocli.go" docci-line-replace=31-39 Tx: &autocliv1.ServiceCommandDescriptor{ Service: modulev1.Msg_ServiceDesc.ServiceName, RpcCommandOptions: []*autocliv1.RpcCommandOptions{ diff --git a/docs/versioned_docs/version-v0.50.x/02-build-your-application/05-testnet.md b/docs/versioned_docs/version-v0.50.x/02-build-your-application/05-testnet.md index f64331a8..adf62cec 100644 --- a/docs/versioned_docs/version-v0.50.x/02-build-your-application/05-testnet.md +++ b/docs/versioned_docs/version-v0.50.x/02-build-your-application/05-testnet.md @@ -19,7 +19,7 @@ Congrats!! You built your first network already. You are ready to run a local te Use the `sh-testnet` command *(short for shell testnet)* to quickly build your application, generate example wallet accounts, and start the local network on your machine. -```bash +```bash docci-background # Run a quick shell testnet make sh-testnet ``` @@ -32,22 +32,22 @@ Using the newly built binary executable *(rolld from the --bin flag when the cha You can either query or set data in the network using the command executable. If you wish to perform an action you submit a transaction (tx). If you wish to read data you are querying (q). The next sub command specifies which module will receive the action on. In this case, the `nameservice` module since our module is named nameservice. Then the `set` command is called, which was defined in the autocli.go. -```bash -rolld tx nameservice set alice --from=acc1 --yes +```bash docci-wait-for-endpoint=http://localhost:26657/health|300 docci-delay-per-cmd=2 docci-delay-before=5 docci-output-contains="/nameservice.v1.MsgSetServiceName" +# set your name +TX_HASH=`rolld tx nameservice set alice --from=acc1 --yes -o json | jq -r '.txhash'` # You can verify this transaction was successful # By querying it's unique ID. -rolld q tx EC3FBF3248E24B5FEB6A5F7F35BBB4634E9C75587119E3FBCF5C1FED05E5A399 +rolld q tx $TX_HASH ``` ## Interaction Get Name Now you are going to get the name of a wallet. A nested command `$(rolld keys show acc1 -a)` gets the unique address of the acc1 account added when you started the testnet. -```bash -rolld q nameservice resolve roll1efd63aw40lxf3n4mhf7dzhjkr453axur57cawh --output=json - -rolld q nameservice resolve $(rolld keys show acc1 -a) --output=json +```bash docci-output-contains=alice +ADDRESS=$(rolld keys show acc1 -a) +rolld q nameservice resolve ${ADDRESS} --output=json ``` The expected result should be: @@ -62,5 +62,11 @@ The expected result should be: When you are ready to stop the testnet, you can use `ctrl + c` or `killall -9 rolld`. ::: + Your network is now running and you have successfully set and resolved a name! 🎉 diff --git a/docs/versioned_docs/version-v0.50.x/02-build-your-application/docci_config.json b/docs/versioned_docs/version-v0.50.x/02-build-your-application/docci_config.json new file mode 100644 index 00000000..e2778cbc --- /dev/null +++ b/docs/versioned_docs/version-v0.50.x/02-build-your-application/docci_config.json @@ -0,0 +1,8 @@ +{ + "files": [ + "02-proto-logic.md", + "03-application-logic.md", + "04-cli.md", + "05-testnet.md" + ] +} From 2821abc0c10c38e6d65e37111b2c9bc7e1a3d852 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Wed, 30 Jul 2025 22:26:58 -0500 Subject: [PATCH 2/8] nit: rm cmd file, add docci-os=windows --- .github/workflows/docci.yml | 6 ------ cmd.md | 15 --------------- .../version-v0.50.x/01-setup/01-system-setup.md | 2 +- 3 files changed, 1 insertion(+), 22 deletions(-) delete mode 100644 cmd.md diff --git a/.github/workflows/docci.yml b/.github/workflows/docci.yml index ec1a783f..d011631b 100644 --- a/.github/workflows/docci.yml +++ b/.github/workflows/docci.yml @@ -29,11 +29,6 @@ jobs: - name: Install Ubuntu packages run: sudo apt-get update && sudo apt-get install bash make jq - - uses: actions/setup-node@v4 - name: Install Node.js - with: - node-version: 21 - - name: Setup go uses: actions/setup-go@v4 with: @@ -48,7 +43,6 @@ jobs: sudo chmod +x /usr/local/bin/docci rm docci.tar.gz - - name: setup & install spawn run: docci run docs/versioned_docs/version-v0.50.x/01-setup/docci_config.json diff --git a/cmd.md b/cmd.md deleted file mode 100644 index 0cf3ff46..00000000 --- a/cmd.md +++ /dev/null @@ -1,15 +0,0 @@ - -```bash -# docci run docs/versioned_docs/version-v0.50.x/01-setup/02-install-spawn.md,docs/versioned_docs/version-v0.50.x/02-build-your-application/01-nameservice.md --hide-background-logs - -# TODO: we have to support JSON files to have an array of relative file paths in the area - -# generate chain (outside of the rollchain dir since it is not generated yet) -docci run docs/versioned_docs/version-v0.50.x/02-build-your-application/01-nameservice.md --hide-background-logs - -# interaction (02 - 05) -docci run docs/versioned_docs/version-v0.50.x/02-build-your-application/docci_config.json --hide-background-logs --working-dir rollchain - -# cleanup -rm -rf rollchain -``` diff --git a/docs/versioned_docs/version-v0.50.x/01-setup/01-system-setup.md b/docs/versioned_docs/version-v0.50.x/01-setup/01-system-setup.md index 13b3c19e..1416cc10 100644 --- a/docs/versioned_docs/version-v0.50.x/01-setup/01-system-setup.md +++ b/docs/versioned_docs/version-v0.50.x/01-setup/01-system-setup.md @@ -61,7 +61,7 @@ Install [VSCode](https://code.visualstudio.com/download) if you do not already h - ```bash + ```bash docci-os=windows # Install WSL in powershell wsl --install From 61bca2705897c43c2be69b97ae5b3c7dd3c44adf Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Wed, 30 Jul 2025 22:27:45 -0500 Subject: [PATCH 3/8] comment out gh auth login --- .../version-v0.50.x/01-setup/01-system-setup.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/versioned_docs/version-v0.50.x/01-setup/01-system-setup.md b/docs/versioned_docs/version-v0.50.x/01-setup/01-system-setup.md index 1416cc10..facec5c5 100644 --- a/docs/versioned_docs/version-v0.50.x/01-setup/01-system-setup.md +++ b/docs/versioned_docs/version-v0.50.x/01-setup/01-system-setup.md @@ -110,10 +110,10 @@ Install [VSCode](https://code.visualstudio.com/download) if you do not already h # (optional) Github CLI - https://github.com/cli/cli curl -sS https://webi.sh/gh | sh - gh auth login + # gh auth login # Golang - GO_VERSION=1.23.0 + GO_VERSION=1.23.9 wget https://go.dev/dl/go$GO_VERSION.linux-amd64.tar.gz sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go$GO_VERSION.linux-amd64.tar.gz From efc63150316e5fb680716bfb5d47ba1578457ab2 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Wed, 30 Jul 2025 22:32:30 -0500 Subject: [PATCH 4/8] go cache --- .github/workflows/docci.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/docci.yml b/.github/workflows/docci.yml index d011631b..1fc42a88 100644 --- a/.github/workflows/docci.yml +++ b/.github/workflows/docci.yml @@ -18,6 +18,11 @@ env: jobs: run: runs-on: ubuntu-latest + steps: + - id: go-cache-paths + run: | + echo "::set-output name=go-build::$(go env GOCACHE)" + echo "::set-output name=go-mod::$(go env GOMODCACHE)" env: DEBUGGING: true RUST_BACKTRACE: 1 @@ -34,6 +39,21 @@ jobs: with: go-version: ${{ env.GO_VERSION }} + # Cache go mod cache, used to speedup builds + - name: Go Mod Cache + uses: actions/cache@v4 + with: + path: ${{ steps.go-cache-paths.outputs.go-mod }} + key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} + + # Cache go build cache, used to speedup go test + - name: Go Build Cache + uses: actions/cache@v4 + with: + path: ${{ steps.go-cache-paths.outputs.go-build }} + key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} + + - name: Install Docci Readme Runner run: | VERSION=v0.9.2-alpha.1 From be3c0ae5c303c1c37fd203fef3858afd86d7bf1c Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Wed, 30 Jul 2025 22:37:29 -0500 Subject: [PATCH 5/8] install binary standalone --- .../02-build-your-application/05-testnet.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/versioned_docs/version-v0.50.x/02-build-your-application/05-testnet.md b/docs/versioned_docs/version-v0.50.x/02-build-your-application/05-testnet.md index adf62cec..1f91fdfa 100644 --- a/docs/versioned_docs/version-v0.50.x/02-build-your-application/05-testnet.md +++ b/docs/versioned_docs/version-v0.50.x/02-build-your-application/05-testnet.md @@ -19,6 +19,11 @@ Congrats!! You built your first network already. You are ready to run a local te Use the `sh-testnet` command *(short for shell testnet)* to quickly build your application, generate example wallet accounts, and start the local network on your machine. +```bash +# Install the binary +make install +``` + ```bash docci-background # Run a quick shell testnet make sh-testnet @@ -38,7 +43,7 @@ TX_HASH=`rolld tx nameservice set alice --from=acc1 --yes -o json | jq -r '.txha # You can verify this transaction was successful # By querying it's unique ID. -rolld q tx $TX_HASH +rolld q tx $TX_HASH -o json ``` ## Interaction Get Name From c5ae7f75022c0ff9ef4cc4e739cf4cff51bc16a2 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Wed, 30 Jul 2025 22:41:11 -0500 Subject: [PATCH 6/8] comment --- .github/workflows/docci.yml | 1 + .../version-v0.50.x/01-setup/01-system-setup.md | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docci.yml b/.github/workflows/docci.yml index 1fc42a88..cafab209 100644 --- a/.github/workflows/docci.yml +++ b/.github/workflows/docci.yml @@ -66,6 +66,7 @@ jobs: - name: setup & install spawn run: docci run docs/versioned_docs/version-v0.50.x/01-setup/docci_config.json + # since this is not run within the 'rollchain' directory, it runs standalone before (this generates the rollchain dir) - name: builds chain run: docci run docs/versioned_docs/version-v0.50.x/02-build-your-application/01-nameservice.md diff --git a/docs/versioned_docs/version-v0.50.x/01-setup/01-system-setup.md b/docs/versioned_docs/version-v0.50.x/01-setup/01-system-setup.md index facec5c5..82884604 100644 --- a/docs/versioned_docs/version-v0.50.x/01-setup/01-system-setup.md +++ b/docs/versioned_docs/version-v0.50.x/01-setup/01-system-setup.md @@ -34,7 +34,7 @@ Install [VSCode](https://code.visualstudio.com/download) if you do not already h - ```bash docci-os=macos + ```bash docci-os="macos" # Setup Homebrew (https://brew.sh/) /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" sudo echo 'export PATH=$PATH:/opt/homebrew/bin' >> ~/.zshrc @@ -61,7 +61,7 @@ Install [VSCode](https://code.visualstudio.com/download) if you do not already h - ```bash docci-os=windows + ```bash docci-os="windows" # Install WSL in powershell wsl --install @@ -104,7 +104,7 @@ Install [VSCode](https://code.visualstudio.com/download) if you do not already h - ```bash docci-os=linux + ```bash docci-os="linux" # Base sudo apt install make gcc git jq wget From df838d2d47509f56106c66ad94ecb4a3f0f09c3f Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Wed, 30 Jul 2025 22:44:16 -0500 Subject: [PATCH 7/8] stop old e2e solution due to being broken --- .github/workflows/reusable-e2e.yaml | 230 ++++++++++++++-------------- 1 file changed, 116 insertions(+), 114 deletions(-) diff --git a/.github/workflows/reusable-e2e.yaml b/.github/workflows/reusable-e2e.yaml index 1b959ffc..c8899e40 100644 --- a/.github/workflows/reusable-e2e.yaml +++ b/.github/workflows/reusable-e2e.yaml @@ -1,114 +1,116 @@ -name: Run Spawn E2E - -# Chain name MUST be `mychain` using binary name `appd` - -on: - workflow_call: - inputs: - id: - type: string - required: true - description: 'ID / description of the whole thing' - spawn-create-cmd: - type: string - required: true - description: 'The spawn command to create the chain' - start-chain-cmd: - type: string - required: true - description: 'The command which runs the chain via the shell' - spawn-extra-cmd: - type: string - required: false - description: 'Extra command to run after the chain is created' - -env: - GO_VERSION: 1.22.3 - JQ_VERSION: '1.7' - JQ_FORCE: false - - -jobs: - run: - runs-on: ubuntu-latest - steps: - # === BASE SETUP === - - id: go-cache-paths - run: | - echo "::set-output name=go-build::$(go env GOCACHE)" - echo "::set-output name=go-mod::$(go env GOMODCACHE)" - - - name: 'Setup jq' - uses: dcarbone/install-jq-action@v2 - with: - version: '${{ env.JQ_VERSION }}' - force: '${{ env.JQ_FORCE }}' - - - name: Set up Go ${{ env.GO_VERSION }} - uses: actions/setup-go@v4 - with: - go-version: ${{ env.GO_VERSION }} - - - name: Go Build Cache - uses: actions/cache@v4 - with: - path: ${{ steps.go-cache-paths.outputs.go-build }} - key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} - - - name: Go Mod Cache - uses: actions/cache@v4 - with: - path: ${{ steps.go-cache-paths.outputs.go-mod }} - key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} - - # === SETUP SPAWN === - - name: Download Spawn Bin - uses: actions/download-artifact@master - with: - name: spawn - path: /home/runner/go/bin - - - name: Spawn Permission # put into path - run: chmod +x /home/runner/go/bin/spawn && ls -l - - # === Chain Creation & Validation === - - name: Spawn Gen - '${{inputs.id}}' - 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 - - - name: Spawn Extra Generation - if : ${{ inputs.spawn-extra-cmd }} - run: ${{ inputs.spawn-extra-cmd }} - - - name: Build and Run '${{inputs.id}}' - run: | - cd mychain - ${{ inputs.start-chain-cmd }} - - # Runs the unit test after the chain is started in the background - # This way the work is parallelized - - name: Unit Test - '${{inputs.id}}' - run: | - cd mychain - go test ./... - - - name: Validate '${{inputs.id}}' is Running - run: | - for ((i = 1; i <= 10; i++)); do - res=`appd status --output=json | jq -r 'has("sync_info")'` - if [ "$res" == "true" ]; then - echo "Chain is running" - exit 0 - else - echo "Chain is not running" - # exit 1 - sleep 5 - fi - done - - lsof -i tcp:26657 | awk 'NR!=1 {print $2}' | xargs kill || true - exit 1 +# TODO: github broke in the past which causes these to fail now (the app does not stat on localhost for some reason within re-usable workflows or something) + +# name: Run Spawn E2E + +# # Chain name MUST be `mychain` using binary name `appd` + +# on: +# workflow_call: +# inputs: +# id: +# type: string +# required: true +# description: 'ID / description of the whole thing' +# spawn-create-cmd: +# type: string +# required: true +# description: 'The spawn command to create the chain' +# start-chain-cmd: +# type: string +# required: true +# description: 'The command which runs the chain via the shell' +# spawn-extra-cmd: +# type: string +# required: false +# description: 'Extra command to run after the chain is created' + +# env: +# GO_VERSION: 1.22.3 +# JQ_VERSION: '1.7' +# JQ_FORCE: false + + +# jobs: +# run: +# runs-on: ubuntu-latest +# steps: +# # === BASE SETUP === +# - id: go-cache-paths +# run: | +# echo "::set-output name=go-build::$(go env GOCACHE)" +# echo "::set-output name=go-mod::$(go env GOMODCACHE)" + +# - name: 'Setup jq' +# uses: dcarbone/install-jq-action@v2 +# with: +# version: '${{ env.JQ_VERSION }}' +# force: '${{ env.JQ_FORCE }}' + +# - name: Set up Go ${{ env.GO_VERSION }} +# uses: actions/setup-go@v4 +# with: +# go-version: ${{ env.GO_VERSION }} + +# - name: Go Build Cache +# uses: actions/cache@v4 +# with: +# path: ${{ steps.go-cache-paths.outputs.go-build }} +# key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} + +# - name: Go Mod Cache +# uses: actions/cache@v4 +# with: +# path: ${{ steps.go-cache-paths.outputs.go-mod }} +# key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} + +# # === SETUP SPAWN === +# - name: Download Spawn Bin +# uses: actions/download-artifact@master +# with: +# name: spawn +# path: /home/runner/go/bin + +# - name: Spawn Permission # put into path +# run: chmod +x /home/runner/go/bin/spawn && ls -l + +# # === Chain Creation & Validation === +# - name: Spawn Gen - '${{inputs.id}}' +# 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 + +# - name: Spawn Extra Generation +# if : ${{ inputs.spawn-extra-cmd }} +# run: ${{ inputs.spawn-extra-cmd }} + +# - name: Build and Run '${{inputs.id}}' +# run: | +# cd mychain +# ${{ inputs.start-chain-cmd }} + +# # Runs the unit test after the chain is started in the background +# # This way the work is parallelized +# - name: Unit Test - '${{inputs.id}}' +# run: | +# cd mychain +# go test ./... + +# - name: Validate '${{inputs.id}}' is Running +# run: | +# for ((i = 1; i <= 10; i++)); do +# res=`appd status --output=json | jq -r 'has("sync_info")'` +# if [ "$res" == "true" ]; then +# echo "Chain is running" +# exit 0 +# else +# echo "Chain is not running" +# # exit 1 +# sleep 5 +# fi +# done + +# lsof -i tcp:26657 | awk 'NR!=1 {print $2}' | xargs kill || true +# exit 1 From 326c16c01dd30313bfd2b6310333f9e97f0a0e36 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Wed, 30 Jul 2025 22:47:49 -0500 Subject: [PATCH 8/8] fix: steps for docci --- .github/workflows/docci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docci.yml b/.github/workflows/docci.yml index cafab209..78befd54 100644 --- a/.github/workflows/docci.yml +++ b/.github/workflows/docci.yml @@ -18,16 +18,16 @@ env: jobs: run: runs-on: ubuntu-latest - steps: - - id: go-cache-paths - run: | - echo "::set-output name=go-build::$(go env GOCACHE)" - echo "::set-output name=go-mod::$(go env GOMODCACHE)" env: DEBUGGING: true RUST_BACKTRACE: 1 steps: + - id: go-cache-paths + run: | + echo "::set-output name=go-build::$(go env GOCACHE)" + echo "::set-output name=go-mod::$(go env GOMODCACHE)" + - name: Checkout repository uses: actions/checkout@v4