Skip to content

Commit

Permalink
update tests so that starship cli is installed beforehand
Browse files Browse the repository at this point in the history
  • Loading branch information
Anmol1696 committed Jun 16, 2024
1 parent 227fa1c commit 7decc5a
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 13 deletions.
22 changes: 17 additions & 5 deletions .github/actions/e2e-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,31 @@ 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"
cache-dependency-path: clients/js

- name: Install starshipjs
- name: Install starship CLI
run: |
cd clients/js
yarn
yarn build
ln -s $GITHUB_WORKSPACE/clients/js/dist/index.js /usr/local/bin/starship
starship --version
chmod +x node_modules/.bin/starship
echo "PATH=$GITHUB_WORKSPACE/clients/js/node_modules/.bin:$PATH" >> $GITHUB_ENV
shell: bash

- name: Setup Test infra
Expand All @@ -86,7 +98,7 @@ runs:
version: 0.0.0
chart: ./starship/charts/devnet
kubeconfig: ${{ steps.kubeconfig.outputs.content }}
cli-version: 2.6.1
cli-version: 0.0.0

- name: Run tests
run: |
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/pr-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,14 @@ jobs:
node-version: "20.x"
cache: "yarn"

- name: Install starshipjs
- 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: Verify starship CLI
run: |
starship --version
- name: Setup Test infra
id: starship-action
uses: cosmology-tech/starship-action@0.5.1
Expand Down
81 changes: 78 additions & 3 deletions .github/workflows/smoke-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +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.5.1
with:
config: ${{ env.CONFIG_FILE }}
version: 0.0.0
chart: ./starship/charts/devnet
cli-version: 2.6.1
cli-version: 0.0.0

# todo: change this to be post step of the action
- name: Cleanup cluster
Expand Down Expand Up @@ -63,14 +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.5.1
with:
config: ${{ env.CONFIG_FILE }}
version: 0.0.0
chart: ./starship/charts/devnet
cli-version: 2.6.1
cli-version: 0.0.0

# todo: change this to be post step of the action
- name: Cleanup cluster
Expand Down Expand Up @@ -99,14 +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.5.1
with:
config: ${{ env.CONFIG_FILE }}
version: 0.0.0
chart: ./starship/charts/devnet
cli-version: 2.6.1
cli-version: 0.0.0

# todo: change this to be post step of the action
- name: Cleanup cluster
Expand Down

0 comments on commit 7decc5a

Please sign in to comment.