-
Notifications
You must be signed in to change notification settings - Fork 39
131 lines (117 loc) · 3.88 KB
/
pr-tests.yaml
File metadata and controls
131 lines (117 loc) · 3.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
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/starship-action@1.0.0
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