forked from TBD54566975/example-pfi-aud-usd-tbdex
-
Notifications
You must be signed in to change notification settings - Fork 12
48 lines (39 loc) · 1.08 KB
/
ci.yml
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
name: Node.js CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build_and_test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['20.4.0']
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
- name: Start the server
run: npm run server &
- name: Wait for server to be ready
run: |
timeout=30
start_time=$(date +%s)
while ! curl -s -o /dev/null -w "%{http_code}" http://localhost:9000/ | grep -q 200; do
current_time=$(date +%s)
elapsed_time=$((current_time - start_time))
if [ $elapsed_time -gt $timeout ]; then
echo "Server did not respond within the timeout of $timeout seconds"
exit 1
fi
sleep 1
done
- name: Run end-to-end tests
run: npm run test:e2e