diff --git a/.github/workflows/cosmetic.yml b/.github/workflows/cosmetic.yml deleted file mode 100644 index ef47e5f3..00000000 --- a/.github/workflows/cosmetic.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: chores - -on: - pull_request: - -jobs: - link-check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: gaurav-nelson/github-action-markdown-link-check@1.0.15 - - typos: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Run codespell - continue-on-error: true - run: | - # .codespellrc is used - sudo apt-get install codespell -y - codespell -w --config .codespellrc - exit $? - - pr-title-format: - name: Lint PR Title - permissions: - pull-requests: read - statuses: write - contents: read - runs-on: ubuntu-latest - steps: - - uses: amannn/action-semantic-pull-request@v5.4.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml deleted file mode 100644 index 3abf5120..00000000 --- a/.github/workflows/release.yaml +++ /dev/null @@ -1,78 +0,0 @@ -name: "Release" - -on: - push: - tags: - - '**' - -# Test Locally with: -# goreleaser build --skip-validate --snapshot - -jobs: - goreleaser: - name: "Binary Release" - permissions: write-all - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2.3.4 - with: - fetch-depth: 0 - - - uses: actions/setup-go@v2 - with: - go-version: '1.22.3' - - - name: Clean up dist directory - run: rm -rf dist - - - name: Build - uses: goreleaser/goreleaser-action@v5 - with: - version: latest - args: build --skip-validate - - - name: Release - uses: goreleaser/goreleaser-action@v5 - if: startsWith(github.ref, 'refs/tags/') - with: - version: latest - args: release --skip-validate --clean - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - release-image: - name: "Docker Release" - runs-on: ubuntu-latest - steps: - - name: Check out the repo - uses: actions/checkout@v4 - - # all lowercase ghcr registry - - run: | - DOCKER_REGISTRY=`echo "ghcr.io/${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]'` - echo "DOCKER_REGISTRY=$DOCKER_REGISTRY" >> $GITHUB_ENV - - REPO_NAME=`echo "${{ github.repository }}" | awk -F'/' '{print $2}' | tr '[:upper:]' '[:lower:]'` - echo "REPO_NAME=$REPO_NAME" >> $GITHUB_ENV - - # build and publish package to ghcr (public) with codebase remaining private - - name: Log in to the Container registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - # build and push Docker image - - name: Build and push - id: build_push_image - uses: docker/build-push-action@v5 - with: - file: Dockerfile - context: . - push: true - platforms: linux/amd64 - tags: | - ${{ env.DOCKER_REGISTRY }}/spawn:latest - ${{ env.DOCKER_REGISTRY }}/spawn:${{ github.ref_name }} \ No newline at end of file diff --git a/.github/workflows/reusable-e2e.yaml b/.github/workflows/reusable-e2e.yaml index 2dc1f38f..2271e593 100644 --- a/.github/workflows/reusable-e2e.yaml +++ b/.github/workflows/reusable-e2e.yaml @@ -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 @@ -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: | diff --git a/.github/workflows/spawn-e2e.yaml b/.github/workflows/spawn-e2e.yaml index bb68cb5a..a80d92ea 100644 --- a/.github/workflows/spawn-e2e.yaml +++ b/.github/workflows/spawn-e2e.yaml @@ -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 & \ No newline at end of file diff --git a/.github/workflows/unit-test.yaml b/.github/workflows/unit-test.yaml deleted file mode 100644 index 2536d93b..00000000 --- a/.github/workflows/unit-test.yaml +++ /dev/null @@ -1,37 +0,0 @@ ---- - name: unit-test - - on: - push: - - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - - env: - GO_VERSION: 1.22.3 - - jobs: - build: - runs-on: ubuntu-latest - name: build - steps: - - uses: actions/checkout@v4 - - name: Setup go - uses: actions/setup-go@v4 - with: - go-version: ${{ env.GO_VERSION }} - - run: make install - - test: - runs-on: ubuntu-latest - name: test - steps: - - name: Install Go - uses: actions/setup-go@v4 - with: - go-version: ${{ env.GO_VERSION }} - - name: Checkout code - uses: actions/checkout@v4 - - name: Test - run: go test ./... \ No newline at end of file diff --git a/simapp/scripts/protocgen.sh b/simapp/scripts/protocgen.sh index 054f2e65..310c4f17 100644 --- a/simapp/scripts/protocgen.sh +++ b/simapp/scripts/protocgen.sh @@ -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/* ./