forked from botpress/botpress
-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (48 loc) · 1.39 KB
/
migration-tests.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
name: Migration Tests
on:
pull_request:
paths:
- '**/migrations/*'
permissions:
contents: read
jobs:
migration:
name: Test Server Migrations
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11.2-alpine
env:
PGPORT: 5432
POSTGRES_DB: bp
POSTGRES_PASSWORD: pgsecret
POSTGRES_USER: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@master
- uses: actions/setup-node@v2
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Fetch Node Packages
run: |
yarn add -W @actions/core @actions/github aws-sdk
- name: Build core, UI and modules
run: |
NODE_OPTIONS="--max-old-space-size=6000" yarn build
- name: Test Migrations
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DATABASE_URL: postgres://postgres:pgsecret@localhost:5432/bp
TOKEN: ${{ secrets.GITHUB_TOKEN }}
PULL_REQUEST: ${{ toJson(github.event.pull_request) }}
run: |
node .github/workflows/code/test-migrations/index.js