PR tests #1759
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: PR tests | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| - v1 | |
| - release/* | |
| paths: | |
| - "starship/**" | |
| - "!starship/docker/**" | |
| - ".github/workflows/pr-tests.yaml" | |
| types: [opened, reopened, synchronize, ready_for_review] | |
| push: | |
| branches: | |
| - main | |
| - release/* | |
| paths: | |
| - "starship/**" | |
| - ".github/workflows/e2e-tests.yaml" | |
| # Run every day at 18:00 UTC | |
| schedule: | |
| - cron: '0 18 * * *' | |
| workflow_dispatch: {} | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }}-pr-tests | |
| cancel-in-progress: true | |
| jobs: | |
| pr-test: | |
| if: github.event_name != 'pull_request' || !github.event.pull_request.draft | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| strategy: | |
| matrix: | |
| config-file: | |
| - "one-chain-custom-scripts.yaml" | |
| - "one-chain.yaml" | |
| - "one-custom-chain.yaml" | |
| - "multi-validator.yaml" | |
| - "simapp.yaml" | |
| - "one-chain-cosmjs-faucet.yaml" | |
| - "multi-validator-starship-faucet.yaml" | |
| - "one-chain-cometmock.yaml" | |
| - "one-cosmoshub-cosmjs-faucet.yaml" | |
| - "eth-lite.yaml" | |
| - "solana-lite.yaml" | |
| fail-fast: true | |
| max-parallel: 3 | |
| env: | |
| CONFIG_FILE: "starship/tests/e2e/configs/${{ matrix.config-file }}" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - uses: actions/setup-go@v4 | |
| with: | |
| 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 packages | |
| yarn | |
| yarn build | |
| chmod +x node_modules/.bin/starship | |
| echo "PATH=$GITHUB_WORKSPACE/packages/node_modules/.bin:$PATH" >> $GITHUB_ENV | |
| - name: Setup Test infra | |
| id: starship-action | |
| uses: hyperweb-io/[email protected] | |
| with: | |
| config: ${{ env.CONFIG_FILE }} | |
| chart: ./starship/charts/devnet | |
| cli-version: 0.0.0 | |
| - name: Run tests | |
| id: tests | |
| run: | | |
| cd tests/e2e/ && go test -v ./... | |
| env: | |
| TEST_CONFIG_FILE: ${{ env.CONFIG_FILE }} | |
| working-directory: starship | |
| - name: Log pods if failure | |
| if: failure() | |
| run: | | |
| kubectl get pods -n $NAMESPACE | |
| for i in `kubectl get po -n $NAMESPACE -o json | jq -r '.items[].metadata.name'`; do | |
| echo "===================================================" | |
| echo "Logs for $i" | |
| kubectl describe pods $i -n $NAMESPACE | |
| kubectl logs $i -n $NAMESPACE --all-containers --tail=10000 | |
| echo "=====================Previous======================" | |
| kubectl logs $i -n $NAMESPACE --all-containers --previous --tail=10000 | |
| echo "===================================================" | |
| done | |
| env: | |
| NAMESPACE: ${{ steps.starship-action.outputs.namespace }} | |
| # todo: change this to be post step of the action | |
| - name: Cleanup cluster | |
| if: always() | |
| run: | | |
| helm delete $DEVNET_NAME --debug --namespace $DEVNET_NAMESPACE --wait || true | |
| kubectl delete namespace $DEVNET_NAMESPACE --wait=true || true | |
| env: | |
| DEVNET_NAME: ${{ steps.starship-action.outputs.name }} | |
| DEVNET_NAMESPACE: ${{ steps.starship-action.outputs.namespace }} | |
| working-directory: starship |