-
Notifications
You must be signed in to change notification settings - Fork 6
73 lines (73 loc) · 2.13 KB
/
actions-test.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
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
name: 'Tests'
on:
push:
branches:
- 'main'
pull_request:
branches:
- 'main'
types:
- opened
- synchronize
- reopened
- ready_for_review
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20.12.x
cache: npm
- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v4
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- name: Install Dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm install
- name: Run unit tests with coverage
run: npm run test
e2e-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20.12.x
cache: npm
- name: Start test containers
run: docker compose -f "./e2e/helpers/docker/docker-compose.yml" up -d
- name: Cache node modules
id: cache-node-modules
uses: actions/cache@v4
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- name: Install Dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm install
- name: Start indexer
run: npm run start:e2e > indexer.log 2>&1 &
- name: Wait for indexer to become available
run: |
for i in {1..24}; do
curl --fail -X GET http://localhost:3000/health && break || sleep 2
done
- name: Run e2e tests
run: npm run test:e2e
- name: Fetch bitcoin core logs
if: always()
run: docker compose -f "./e2e/helpers/docker/docker-compose.yml" logs bitcoin
- name: Fetch indexer logs
if: always()
run: cat indexer.log
- name: Stop test containers
run: docker compose -f "./e2e/helpers/docker/docker-compose.yml" down