-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (66 loc) · 1.93 KB
/
ci.yaml
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
name: CI
on:
workflow_dispatch:
push:
jobs:
xtp:
runs-on: ubuntu-latest
env:
XTP_TOKEN: ${{ secrets.XTP_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: test the schema
run: |
body="$(jq -rcM -n --arg content "$(cat plugin.yaml)" '{"name":"chat_test", "schema": $content}')"
EXTENSION_ID=ext_01j8t7m4s6e0trqftejwvh1je5
curl -sLfi \
-H "Authorization: Bearer $XTP_TOKEN" \
-H "content-type: application/json" \
-X PUT -d "$body" \
'https://xtp.dylibso.com/api/v1/extension-points/'$EXTENSION_ID
test:
needs: [xtp]
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
env:
PGURL: postgres://postgres:postgres@localhost:5432/postgres
FORCE_PRETTY_OUTPUT: true
HOST_SECRET: stub value
DISCORD_BOT_TOKEN: stub value
DISCORD_BOT_CLIENT_ID: stub value
SESSION_SECRET: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa any value is fine as long as its 32 chars long"
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '22.x'
- name: cache npm dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-discordbot-npm-cache-${{ hashFiles('service/api/package-lock.json') }}
restore-keys: |
${{ runner.os }}-discordbot-npm-cache-
- name: install deps
run: |
npm ci
- name: migrate
run: |
npm run migrate
- name: run tests
run: |
TEST_LOG=1 npm t