-
Notifications
You must be signed in to change notification settings - Fork 24
95 lines (92 loc) · 3.33 KB
/
test-api-e2e.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: test-api-e2e
on:
pull_request:
push:
branches:
- dev
- main
env:
API_URL: 'http://localhost:3000'
APP_1_FEE_PAYER_SECRET: 'UvfuF3FPqLyvS8xGjSu4AUfdsY5QvLdnin8SKBLAi3UqgbmEWCDshPY3UcxvBgRAqHLzh5Ni1eypLVZArsis6FF'
APP_1_NAME: 'App 1'
AUTH_USERS: 'alice|Kinetic@alice1|Admin,bob|Kinetic@bob1'
AUTH_PASSWORD_ENABLED: true
COOKIE_NAME: '__session'
DATABASE_URL: 'postgresql://prisma:prisma@localhost:5432/prisma?schema=kinetic'
JWT_SECRET: 'KineticJwtSecret!'
NX_CLOUD_DISTRIBUTED_EXECUTION: false
REDIS_URL: 'redis://localhost:6379'
SOLANA_LOCAL_ENABLED: true
SOLANA_LOCAL_RPC_ENDPOINT: 'http://127.0.0.1:8899'
SOLANA_LOCAL_MINT_KIN: '*MoGaMuJnB3k8zXjBYBnHxHG47vWcW3nyb7bFYvdVzek,5,Kin'
SOLANA_LOCAL_MINT_KIN_AIRDROP_SECRET: 'UvfuF3FPqLyvS8xGjSu4AUfdsY5QvLdnin8SKBLAi3UqgbmEWCDshPY3UcxvBgRAqHLzh5Ni1eypLVZArsis6FF'
SOLANA_DEVNET_RPC_ENDPOINT: 'http://127.0.0.1:8899'
SOLANA_DEVNET_MINT_KIN: '*MoGaMuJnB3k8zXjBYBnHxHG47vWcW3nyb7bFYvdVzek,5,Kin'
SOLANA_DEVNET_MINT_KIN_AIRDROP_SECRET: 'UvfuF3FPqLyvS8xGjSu4AUfdsY5QvLdnin8SKBLAi3UqgbmEWCDshPY3UcxvBgRAqHLzh5Ni1eypLVZArsis6FF'
jobs:
main:
runs-on: ubuntu-20.04
if: ${{ github.event_name != 'pull_request' }}
services:
postgres:
image: postgres:15-alpine
env:
POSTGRES_DB: prisma
POSTGRES_USER: prisma
POSTGRES_PASSWORD: prisma
ports: ['5432:5432']
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
redis:
image: redis:7-alpine
ports: ['6379:6379']
options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
solana:
image: ghcr.io/kin-labs/kinetic-solana-network:latest
ports: ['8899:8899', '8900:8900']
steps:
- uses: actions/checkout@v3
name: Checkout [main]
with:
fetch-depth: 0
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- uses: actions/setup-node@v3
with:
node-version: '16'
- run: yarn install --frozen-lockfile
- run: yarn prisma db push
- run: yarn nx e2e api-e2e --skip-nx-cache
pr:
runs-on: ubuntu-20.04
if: ${{ github.event_name == 'pull_request' }}
services:
postgres:
image: postgres:15-alpine
env:
POSTGRES_DB: prisma
POSTGRES_USER: prisma
POSTGRES_PASSWORD: prisma
ports: ['5432:5432']
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
redis:
image: redis:7-alpine
ports: ['6379:6379']
options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
solana:
image: ghcr.io/kin-labs/kinetic-solana-network:latest
ports: ['8899:8899', '8900:8900']
steps:
- uses: actions/checkout@v3
name: Checkout pr
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- uses: actions/setup-node@v3
with:
node-version: '16'
- run: yarn install --frozen-lockfile
- run: yarn prisma db push
- run: yarn nx e2e api-e2e --skip-nx-cache