-
Notifications
You must be signed in to change notification settings - Fork 113
76 lines (67 loc) · 2.04 KB
/
integration-tests-api.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
74
75
76
name: Integration test - API
on: pull_request
jobs:
runTests:
timeout-minutes: 30
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
checks: write
strategy:
matrix:
node-version: ['lts/*'] # 18.17.1 or lts/*
test-pattern:
#- accounts.test.ts
#- addresses.test.ts
#- batches.test.ts
#- blocks.test.ts
#- contracts.test.ts
#- logs.test.ts
#- stats.test.ts
#- tokens.test.ts
- transactions.test.ts
name: 'API test set: ${{ matrix.test-pattern}} / Node: ${{ matrix.node-version}}'
steps:
- name: Checkout with Submodule
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install dependencies
run: |
npm ci --no-audit
npx playwright install --with-deps chromium
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Cache Docker images
id: cache-docker-images
uses: actions/cache@v3
with:
path: |
/var/lib/docker/
# where the cache is stored -> /var/lib/docker/
# test
key: ${{ runner.os }}-docker-${{ hashFiles('**/docker-compose.yaml') }}
restore-keys: |
${{ runner.os }} docker
- name: Start docker containers
run: |
docker-compose -f "docker-compose.yaml" up -d --build
- name: List running containers
run: docker ps
- name: API tests run (parallel)
run: |
cd packages/integration-tests
npx jest --verbose --testPathPattern=${{ matrix.test-pattern }}
- name: Stop containers
if: always()
run: |
docker-compose -f "docker-compose.yaml" down