-
Notifications
You must be signed in to change notification settings - Fork 2
147 lines (127 loc) · 4.37 KB
/
Copy pathtest.yml
File metadata and controls
147 lines (127 loc) · 4.37 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: Run Tests
on:
push:
branches-ignore:
- develop
- beta
- stable
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Set up Bun
uses: oven-sh/setup-bun@v2
- name: Set up Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: Install dependencies
run: |
sudo apt-get install jq
yarn
yarn build
- name: Run linter
run: |
yarn lint
- name: Run environment smoke tests
run: |
npm run smoke:web:install
npm run smoke:worker:install
npm --prefix scripts/env-smoke/web exec playwright install --with-deps chromium
npm run smoke:node
npm run smoke:node:cjs
npm run smoke:web:runtime
npm run smoke:web:build
npm run smoke:worker:runtime
npm run smoke:worker:dry
npm run smoke:bun
npm run smoke:deno
- name: Run sgx container
run: |
export SGX_WALLET_TAG=1.10.2-develop.6
echo "SGX_WALLET_TAG=$SGX_WALLET_TAG" >> $GITHUB_ENV
bash ./scripts/run_sgx_container.sh $SGX_WALLET_TAG
echo "Waiting for SGX wallet to be ready..."
for i in {1..60}; do
if curl -s -o /dev/null -w "%{http_code}" https://127.0.0.1:1026 2>/dev/null | grep -q "405\|200"; then
echo "SGX wallet is ready after $((i*2)) seconds"
break
fi
echo "Attempt $i: SGX wallet not ready yet..."
sleep 2
done
docker logs sgx-simulator 2>&1 | tail -20 || true
shell: bash
- name: Import ssl certificates
run: |
bash ./scripts/import_ssl_certificates.sh
shell: bash
- name: Import keys
run: |
bash ./scripts/import_sgx_keys.sh
shell: bash
- name: Run skaled container
run: |
export SKALED_RELEASE=5.1.0-develop.38-bite
echo "SKALED_RELEASE=$SKALED_RELEASE" >> $GITHUB_ENV
shell: bash
- name: Run tests
env:
SKALED_RELEASE: ${{ env.SKALED_RELEASE }}
run: |
bash ./scripts/run_test.sh $SKALED_RELEASE
shell: bash
- name: Stop containers
if: always()
run: |
# Stop sgxwallet container
SGX_CONTAINER_ID=$(docker ps -q --filter "ancestor=skalenetwork/sgxwallet_sim:${{ env.SGX_WALLET_TAG }}")
if [ ! -z "$SGX_CONTAINER_ID" ]; then
echo "Stopping sgxwallet container: $SGX_CONTAINER_ID"
docker stop $SGX_CONTAINER_ID
fi
# Stop skaled container
SKALED_CONTAINER_ID=$(docker ps -q --filter "ancestor=skalenetwork/schain:${{ env.SKALED_RELEASE }}")
if [ ! -z "$SKALED_CONTAINER_ID" ]; then
echo "Stopping skaled container: $SKALED_CONTAINER_ID"
docker stop -t 270 $SKALED_CONTAINER_ID
fi
shell: bash
- name: Collect sgxwallet container logs
env:
SGX_WALLET_TAG: ${{ env.SGX_WALLET_TAG }}
if: always()
run: |
CONTAINER_ID=$(docker ps -a -q --filter "ancestor=skalenetwork/sgxwallet_sim:$SGX_WALLET_TAG")
echo "Container ID: $CONTAINER_ID"
docker ps -a
docker logs --details --timestamps --tail=all $CONTAINER_ID > sgxwallet_logs.txt 2>&1
shell: bash
- name: Collect skaled container logs
env:
SKALED_RELEASE: ${{ env.SKALED_RELEASE }}
if: always()
run: |
CONTAINER_ID=$(docker ps -a -q --filter "ancestor=skalenetwork/schain:$SKALED_RELEASE")
echo "Container ID: $CONTAINER_ID"
docker ps -a
docker logs --details --timestamps --tail=all $CONTAINER_ID > skaled_logs.txt 2>&1
shell: bash
- name: Upload sgxwallet logs as artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: sgxwallet-logs
path: sgxwallet_logs.txt
- name: Upload skaled logs as artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: skaled-logs
path: skaled_logs.txt