-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (71 loc) · 2.11 KB
/
ci.yml
File metadata and controls
82 lines (71 loc) · 2.11 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
name: CI
on:
push:
pull_request:
jobs:
unit:
name: Unit Tests (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ["18", "20", "22"]
steps:
- uses: actions/checkout@v6
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Run unit tests
run: node --experimental-vm-modules node_modules/.bin/jest --testPathPattern='src/__tests__/(?!integration)' --forceExit
integration:
name: Integration Tests
runs-on: ubuntu-latest
services:
localstack:
image: localstack/localstack:3
ports:
- 4566:4566
env:
SERVICES: kms
options: >-
--health-cmd "curl -sf http://localhost:4566/_localstack/health"
--health-interval 10s
--health-timeout 5s
--health-retries 15
vault:
image: hashicorp/vault:latest
ports:
- 8200:8200
env:
VAULT_DEV_ROOT_TOKEN_ID: root
VAULT_DEV_LISTEN_ADDRESS: 0.0.0.0:8200
SKIP_SETCAP: "true"
VAULT_ADDR: http://127.0.0.1:8200
options: >-
--health-cmd "vault status"
--health-interval 10s
--health-timeout 5s
--health-retries 15
steps:
- uses: actions/checkout@v6
- name: Set up Node.js 20
uses: actions/setup-node@v6
with:
node-version: "20"
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Run integration tests
run: node --experimental-vm-modules node_modules/.bin/jest --testPathPattern='src/__tests__/integration' --forceExit
env:
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_DEFAULT_REGION: us-east-1
AWS_ENDPOINT_URL: http://localhost:4566
VAULT_ADDR: http://localhost:8200
VAULT_TOKEN: root