-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (59 loc) · 1.83 KB
/
Copy pathnpm_test.yml
File metadata and controls
71 lines (59 loc) · 1.83 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
name: Node.js CI
on:
pull_request:
branches: [ development, main, production ]
workflow_call:
secrets:
DEVELOPMENT_EJSON_PRIVATE_KEY:
required: true
DEVELOPMENT_EJSON_PUBLIC_KEY:
required: true
NPM_TASKFORCESH_TOKEN:
required: true
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
services:
postgres:
image: postgres:14
env:
POSTGRES_USER: "codex-test-user"
POSTGRES_PASSWORD: "password"
POSTGRES_DB: "codex-test"
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Port mapping from service container to the host
- 5432:5432
redis:
image: redis:6.2.6
ports:
- 6379:6379
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install ejson
run: curl -sSL -o ejson https://github.com/Shopify/ejson/releases/download/v1.3.0/linux-amd64 && chmod +x ejson && sudo ln -s $(pwd)/ejson /usr/bin/ejson
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: Install dependencies
run: npm ci
env:
NPM_TASKFORCESH_TOKEN: ${{ secrets.NPM_TASKFORCESH_TOKEN }}
- name: Configure private ejson key
run: mkdir ./keys && echo "${{ secrets.DEVELOPMENT_EJSON_PRIVATE_KEY }}" > ./keys/${{ secrets.DEVELOPMENT_EJSON_PUBLIC_KEY }}
- name: Build
run: EJSON_KEYDIR=$(pwd)/keys/ npm run decrypt:dev && npm run build
- name: Delete ejson key
run: rm -r ./keys
- name: Run Tests
run: npm test