-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
81 lines (68 loc) · 1.97 KB
/
test-cli-with-database.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
name: CLI Pipeline
on:
pull_request:
jobs:
test-cli-with-database:
env:
NODE_ENV: CI
REDIS_URL: redis://localhost:6379
DATABASE_URL: "postgres://postgres:postgres@localhost/cli-test"
services:
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: cli-test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup development server
uses: ./.github/actions/setup-server
with:
cache-extension: "cli-test"
node-version: 20
- name: Install Medusa cli
run: npm i -g @medusajs/cli@preview
- name: Create Medusa project
run: |
medusa new cli-test --skip-db --v2 --branch ci
working-directory: ..
- name: run medusa dev
run: medusa-dev --force-install
working-directory: ../cli-test
- name: Run migrations
run: medusa db:migrate
working-directory: ../cli-test
- name: Create admin user
run: medusa user -e test@test.com -p password -i admin_123
working-directory: ../cli-test
- name: Run development server
run: medusa develop &
working-directory: ../cli-test
- name: Testing development server
uses: ./.github/actions/test-server
- name: Starting medusa
run: medusa start &
working-directory: ../cli-test
- name: Testing server
uses: ./.github/actions/test-server