Skip to content

Commit

Permalink
Merge branch 'main' into anmol/dym-chain-support
Browse files Browse the repository at this point in the history
  • Loading branch information
Anmol1696 authored Jun 19, 2024
2 parents 6890989 + 7e6784b commit abb05d0
Show file tree
Hide file tree
Showing 84 changed files with 2,713 additions and 2,058 deletions.
34 changes: 30 additions & 4 deletions .github/actions/e2e-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,42 @@ runs:
go-version: "1.21"
check-latest: true

- name: Create yarn.lock and package.json file if not exists
run: |
if [ ! -f $GITHUB_WORKSPACE/yarn.lock ]; then
echo 'Creating temporary yarn.lock file'
echo '' > $GITHUB_WORKSPACE/yarn.lock
fi
if [ ! -f $GITHUB_WORKSPACE/package.json ]; then
echo 'Creating temporary package.json file'
echo '{}' > $GITHUB_WORKSPACE/package.json
fi
shell: bash

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "yarn"

- name: Install starship CLI
run: |
cd clients/js
yarn
yarn build
chmod +x node_modules/.bin/starship
echo "PATH=$GITHUB_WORKSPACE/clients/js/node_modules/.bin:$PATH" >> $GITHUB_ENV
shell: bash

- name: Setup Test infra
id: starship-action
uses: cosmology-tech/starship-action@0.2.19
uses: cosmology-tech/starship-action@0.5.1
with:
values: ${{ env.CONFIG_FILE }}
port-forward: true
config: ${{ env.CONFIG_FILE }}
version: 0.0.0
chart: ./starship/charts/devnet
kubeconfig: ${{ steps.kubeconfig.outputs.content }}
cli-version: f35dc85407b350077765a0b3c17a4c1632c7d53c
cli-version: 0.0.0

- name: Run tests
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
- "agoric.yaml"
- "multi-relayer.yaml"
- "neutron-relayer.yaml"
- "one-cosmoshub-starship-faucet.yaml"
fail-fast: true
max-parallel: 1

Expand Down
39 changes: 31 additions & 8 deletions .github/workflows/pr-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30

defaults:
run:
working-directory: starship

strategy:
matrix:
config-file:
Expand All @@ -36,6 +32,7 @@ jobs:
- "one-chain-starship-faucet.yaml"
- "multi-validator-starship-faucet.yaml"
- "one-chain-cometmock.yaml"
- "one-cosmoshub-starship-faucet.yaml"
fail-fast: true
max-parallel: 3

Expand All @@ -51,21 +48,46 @@ jobs:
go-version: "1.21"
check-latest: true

- name: Create yarn.lock and package.json file if not exists
run: |
if [ ! -f $GITHUB_WORKSPACE/yarn.lock ]; then
echo 'Creating temporary yarn.lock file'
echo '' > $GITHUB_WORKSPACE/yarn.lock
fi
if [ ! -f $GITHUB_WORKSPACE/package.json ]; then
echo 'Creating temporary package.json file'
echo '{}' > $GITHUB_WORKSPACE/package.json
fi
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "yarn"

- name: Install starship CLI
run: |
cd clients/js
yarn
yarn build
chmod +x node_modules/.bin/starship
echo "PATH=$GITHUB_WORKSPACE/clients/js/node_modules/.bin:$PATH" >> $GITHUB_ENV
- name: Setup Test infra
id: starship-action
uses: cosmology-tech/starship-action@0.2.19
uses: cosmology-tech/starship-action@0.5.1
with:
values: ${{ env.CONFIG_FILE }}
port-forward: true
config: ${{ env.CONFIG_FILE }}
version: 0.0.0
chart: ./starship/charts/devnet
cli-version: f35dc85407b350077765a0b3c17a4c1632c7d53c
cli-version: 0.0.0

- name: Run tests
run: |
cd tests/e2e/ && go test -v ./...
env:
TEST_CONFIG_FILE: ${{ env.CONFIG_FILE }}
working-directory: starship

# todo: change this to be post step of the action
- name: Cleanup cluster
Expand All @@ -76,3 +98,4 @@ jobs:
env:
DEVNET_NAME: ${{ steps.starship-action.outputs.name }}
DEVNET_NAMESPACE: ${{ steps.starship-action.outputs.namespace }}
working-directory: starship
99 changes: 84 additions & 15 deletions .github/workflows/smoke-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,39 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Create yarn.lock and package.json file if not exists
run: |
if [ ! -f $GITHUB_WORKSPACE/yarn.lock ]; then
echo 'Creating temporary yarn.lock file'
echo '' > $GITHUB_WORKSPACE/yarn.lock
fi
if [ ! -f $GITHUB_WORKSPACE/package.json ]; then
echo 'Creating temporary package.json file'
echo '{}' > $GITHUB_WORKSPACE/package.json
fi
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "yarn"

- name: Install starship CLI
run: |
cd clients/js
yarn
yarn build
chmod +x node_modules/.bin/starship
echo "PATH=$GITHUB_WORKSPACE/clients/js/node_modules/.bin:$PATH" >> $GITHUB_ENV
- name: Setup Test infra
id: starship-action
uses: cosmology-tech/starship-action@0.2.19
uses: cosmology-tech/starship-action@0.5.1
with:
values: ${{ env.CONFIG_FILE }}
port-forward: true
config: ${{ env.CONFIG_FILE }}
version: 0.0.0
chart: ./starship/charts/devnet
timeout: 10m
cli-version: f35dc85407b350077765a0b3c17a4c1632c7d53c
cli-version: 0.0.0

# todo: change this to be post step of the action
- name: Cleanup cluster
Expand Down Expand Up @@ -65,16 +88,39 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Create yarn.lock and package.json file if not exists
run: |
if [ ! -f $GITHUB_WORKSPACE/yarn.lock ]; then
echo 'Creating temporary yarn.lock file'
echo '' > $GITHUB_WORKSPACE/yarn.lock
fi
if [ ! -f $GITHUB_WORKSPACE/package.json ]; then
echo 'Creating temporary package.json file'
echo '{}' > $GITHUB_WORKSPACE/package.json
fi
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "yarn"

- name: Install starship CLI
run: |
cd clients/js
yarn
yarn build
chmod +x node_modules/.bin/starship
echo "PATH=$GITHUB_WORKSPACE/clients/js/node_modules/.bin:$PATH" >> $GITHUB_ENV
- name: Setup Test infra
id: starship-action
uses: cosmology-tech/starship-action@0.2.19
uses: cosmology-tech/starship-action@0.5.1
with:
values: ${{ env.CONFIG_FILE }}
port-forward: true
config: ${{ env.CONFIG_FILE }}
version: 0.0.0
chart: ./starship/charts/devnet
timeout: 10m
cli-version: f35dc85407b350077765a0b3c17a4c1632c7d53c
cli-version: 0.0.0

# todo: change this to be post step of the action
- name: Cleanup cluster
Expand Down Expand Up @@ -103,16 +149,39 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Create yarn.lock and package.json file if not exists
run: |
if [ ! -f $GITHUB_WORKSPACE/yarn.lock ]; then
echo 'Creating temporary yarn.lock file'
echo '' > $GITHUB_WORKSPACE/yarn.lock
fi
if [ ! -f $GITHUB_WORKSPACE/package.json ]; then
echo 'Creating temporary package.json file'
echo '{}' > $GITHUB_WORKSPACE/package.json
fi
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "yarn"

- name: Install starship CLI
run: |
cd clients/js
yarn
yarn build
chmod +x node_modules/.bin/starship
echo "PATH=$GITHUB_WORKSPACE/clients/js/node_modules/.bin:$PATH" >> $GITHUB_ENV
- name: Setup Test infra
id: starship-action
uses: cosmology-tech/starship-action@0.2.19
uses: cosmology-tech/starship-action@0.5.1
with:
values: ${{ env.CONFIG_FILE }}
port-forward: true
config: ${{ env.CONFIG_FILE }}
version: 0.0.0
chart: ./starship/charts/devnet
timeout: 10m
cli-version: f35dc85407b350077765a0b3c17a4c1632c7d53c
cli-version: 0.0.0

# todo: change this to be post step of the action
- name: Cleanup cluster
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/starship-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:
- "starship/exposer/**"
- "starship/faucet/**"
- ".github/workflows/starship-docker.yaml"
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-starship-docker
Expand Down Expand Up @@ -51,37 +52,37 @@ jobs:
with:
filters: |
src:
- '${{ matrix.type }}/**'
- 'starship/${{ matrix.type }}/**'
- name: Set up QEMU
if: steps.changes.outputs.src == 'true'
if: steps.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch'
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
if: steps.changes.outputs.src == 'true'
if: steps.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch'
uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub
if: steps.changes.outputs.src == 'true'
if: steps.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Determine tag
if: steps.changes.outputs.src == 'true'
if: steps.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch'
id: docker-tag
run: |
tag=$(date -u "+%Y%m%d")-$(echo ${GITHUB_SHA} | cut -c1-7)
echo Tag will be $tag
echo ::set-output name=version::$tag
- name: Build and push
if: steps.changes.outputs.src == 'true'
if: steps.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch'
uses: docker/build-push-action@v4
with:
push: ${{ github.event_name == 'push' }}
context: ${{ matrix.type }}/
push: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
context: starship/${{ matrix.type }}/
tags: ghcr.io/cosmology-tech/starship/${{ matrix.type }}:${{ steps.docker-tag.outputs.version }}
platforms: linux/amd64,linux/arm64
31 changes: 6 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,33 +37,17 @@ Stay tuned for a `create-cosmos-app` boilerplate! For now, this is the most reco

- We recommend studying the [osmojs starship integration](https://github.com/osmosis-labs/osmojs/tree/main/packages/osmojs/starship) and replicating it.
- Add your configs, similar to how it's done [here](https://github.com/osmosis-labs/osmojs/tree/main/packages/osmojs/starship/configs)
- Add your workflows for github [like this](https://github.com/osmosis-labs/osmojs/blob/main/.github/workflows/e2e-tests.yaml)
- Add `yarn starship` commands to your package.json scripts [like this](https://github.com/osmosis-labs/osmojs/blob/20d749c8c5a4ec3db374221dabdf185fa18025a3/packages/osmojs/package.json#L34C5-L38C74)
- Add your workflows for GitHub Actions [like this](https://github.com/osmosis-labs/osmojs/blob/main/.github/workflows/e2e-tests.yaml)
- Add `yarn starship` commands to your package.json scripts [like this](https://github.com/osmosis-labs/osmojs/blob/c456184666eda55cd6fee5cd09ba6c05c898d55c/packages/osmojs/package.json#L31-L34)
— Note the jest configurations in the [osmojs package](https://github.com/osmosis-labs/osmojs/tree/main/packages/osmojs)


This will allow you to run `yarn starship` to `setup`, `deploy`, `clean` and other `starship` commands:
This will allow you to run `yarn starship` to `start`, `setup`, `deploy`, `stop` and other `starship` commands:

#### Deploying `Starship` 🚀

```sh
# setup helm/starship
yarn starship setup

# sanity check
yarn starship get-pods

# deploy starship
yarn starship deploy

# wait til STATUS=Running
yarn starship get-pods

# port forwarding
yarn starship start-ports

# check pids
yarn starship port-pids
yarn starship start
```

#### Running End-to-End Tests 🧪
Expand All @@ -79,11 +63,8 @@ yarn starship:watch
#### Teardown 🛠️

```sh
# stop port forwarding (done by clean() too)
# yarn starship stop-ports

# stop ports and delete & remove helm chart
yarn starship clean
# stop ports and delete deployment
yarn starship stop
```

## Related
Expand Down
Loading

0 comments on commit abb05d0

Please sign in to comment.