Skip to content

Commit

Permalink
Merge pull request #476 from cosmology-tech/anmol/starship-action-upg…
Browse files Browse the repository at this point in the history
…rade

feature: upgrade starship-action v5
  • Loading branch information
Anmol1696 committed Jun 19, 2024
2 parents 9a7a4f1 + 2d82c05 commit 34bc7c1
Show file tree
Hide file tree
Showing 6 changed files with 153 additions and 33 deletions.
33 changes: 30 additions & 3 deletions .github/actions/e2e-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +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.3.0
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: 0.0.0

- name: Run tests
run: |
Expand Down
37 changes: 30 additions & 7 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 Down Expand Up @@ -52,20 +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.3.0
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: 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
96 changes: 84 additions & 12 deletions .github/workflows/smoke-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +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.3.0
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: 0.0.0

# todo: change this to be post step of the action
- name: Cleanup cluster
Expand Down Expand Up @@ -64,15 +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.3.0
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: 0.0.0

# todo: change this to be post step of the action
- name: Cleanup cluster
Expand Down Expand Up @@ -101,15 +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.3.0
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: 0.0.0

# todo: change this to be post step of the action
- name: Cleanup cluster
Expand Down
2 changes: 1 addition & 1 deletion clients/js/packages/client/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const defaultStarshipContext: Partial<StarshipContext> = {
helmRepo: 'starship',
helmRepoUrl: 'https://cosmology-tech.github.io/starship/',
helmChart: 'starship/devnet',
helmVersion: 'v0.2.3',
helmVersion: 'v0.2.4',
helmNamespace: '',
};

Expand Down
10 changes: 6 additions & 4 deletions starship/charts/devnet/templates/chains/cosmos/cometmock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,22 +128,24 @@ spec:
- bash
- "-c"
- |
mkdir -p /chain/genesis/config /chain/genesis/data
mkdir -p /chain/genesis/config
mkdir -p /chain/genesis/data
curl http://$GENESIS_HOST.$NAMESPACE.svc.cluster.local:$GENESIS_PORT/genesis -o /chain/genesis/config/genesis.json
echo "Genesis file that we got....."
cat /chain/genesis/config/genesis.json
## fetch priv_validator and priv_validator_state of all validators
curl http://$GENESIS_HOST.$NAMESPACE.svc.cluster.local:$GENESIS_PORT/priv_keys -o /chain/genesis/config/priv_validator_key.json
curl http://$GENESIS_HOST.$NAMESPACE.svc.cluster.local:$GENESIS_PORT/priv_validator_state -o /chain/genesis/data/priv_validator_state.json
echo '{"height":"0","round":0,"step":0}' > /chain/genesis/data/priv_validator_state.json
{{- if gt $chain.numValidators 1.0}}
for i in $(seq 0 {{ sub $chain.numValidators 2 }});
do
mkdir -p /chain/validator-$i/config /chain/validator-$i/data
mkdir -p /chain/validator-$i/config
mkdir -p /chain/validator-$i/data
curl http://{{ $chain.hostname }}-validator-$i.{{ $chain.hostname }}-validator.$NAMESPACE.svc.cluster.local:$GENESIS_PORT/node_key -o /chain/validator-$i/config/node_key.json
curl http://{{ $chain.hostname }}-validator-$i.{{ $chain.hostname }}-validator.$NAMESPACE.svc.cluster.local:$GENESIS_PORT/priv_keys -o /chain/validator-$i/config/priv_validator_key.json
curl http://{{ $chain.hostname }}-validator-$i.{{ $chain.hostname }}-validator.$NAMESPACE.svc.cluster.local:$GENESIS_PORT/priv_validator_state -o /chain/validator-$i/data/priv_validator_state.json
echo '{"height":"0","round":0,"step":0}' > /chain/validator-$i/data/priv_validator_state.json
done
{{- end }}
Expand Down
8 changes: 2 additions & 6 deletions starship/tests/e2e/configs/multi-validator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,8 @@ chains:
exposer: 38083
faucet: 8000
resources:
limits:
cpu: "0.4"
memory: 1Gi
requests:
cpu: "0.2"
memory: 600M
cpu: "0.3"
memory: 600M
faucet:
concurrency: 2
resources:
Expand Down

0 comments on commit 34bc7c1

Please sign in to comment.