-
Notifications
You must be signed in to change notification settings - Fork 3
174 lines (156 loc) · 6.07 KB
/
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
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
name: CI
on: [ "push" ]
jobs:
run-tests:
name: PHP ${{ matrix.php-versions }}
runs-on: ubuntu-latest
env:
extensions: mbstring, intl, json, redis, swoole, xdebug, igbinary
APP_ENV: testing
DB_HOST: 127.0.0.1
DB_HOST_READ: 127.0.0.1
REDIS_URL: tcp://127.0.0.1:6379?database=0
REDIS_HOST: 127.0.0.1
DB_USERNAME: root
DB_PASSWORD: password
DB_DATABASE: kanvas
DB_INVENTORY_DATABASE: inventory
DB_INVENTORY_USERNAME: root
DB_INVENTORY_PASSWORD: password
DB_SOCIAL_DATABASE: social
DB_SOCIAL_USERNAME: root
DB_SOCIAL_PASSWORD: password
DB_CRM_DATABASE: crm
DB_CRM_USERNAME: root
DB_CRM_PASSWORD: password
DB_WORKFLOW_DATABASE: workflows
DB_WORKFLOW_USERNAME: root
DB_WORKFLOW_PASSWORD: password
DB_ACTION_ENGINE_DATABASE: action_engine
DB_ACTION_ENGINE_USERNAME: root
DB_ACTION_ENGINE_PASSWORD: password
DB_COMMERCE_DATABASE: commerce
DB_COMMERCE_USERNAME: root
DB_COMMERCE_PASSWORD: password
KANVAS_APP_ID: 059ddaaf-89b5-4158-a85a-90cbd69aa34b
APP_KEY: base64:Wm5KmkE4aWFjdFUzU2o3SElYNGc0QlpLcXNWR0hMME0=
APP_JWT_TOKEN: Wm5KmkE4aWFjdFUzU2o3SElYNGc0QlpLcXNWR0hMME0=4QZVysw1MIFmwZi0KvEOaHs0leAix3U6zueUZJtQYjYj
TOKEN_PASSWORD: base64:Z1dVYk5TcEZWUVhMNHZCUllIc3JQTVg0ZEdWTTh5eDg=
TOKEN_AUDIENCE: http://localhost
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
AWS_BUCKET: ${{ secrets.AWS_BUCKET }}
AWS_ACCESS_KEY_CICD: ${{ secrets.AWS_ACCESS_KEY_CICD }}
AWS_SECRET_ACCESS_KEY_CICD: ${{ secrets.AWS_SECRET_ACCESS_KEY_CICD }}
AWS_DEFAULT_REGION_CICD: ${{ secrets.AWS_DEFAULT_REGION_CICD }}
AWS_BUCKET_CICD: ${{ secrets.AWS_BUCKET_CICD }}
AWS_URL: ${{ secrets.AWS_URL }}
MODEL_CACHE_STORE: model
MODEL_CACHE_ENABLED: false
LIGHTHOUSE_CACHE_ENABLE: true
LIGHTHOUSE_CACHE_VERSION: 2
SCOUT_DRIVER: meilisearch
MEILISEARCH_HOST: http://localhost:7700
MEILISEARCH_KEY: masterKey
SCOUT_QUEUE: false
# APP_DEBUG: true
#third party integration
TEST_ZOHO_CLIENT_ID: ${{ secrets.TEST_ZOHO_CLIENT_ID }}
TEST_ZOHO_CLIENT_SECRET: ${{ secrets.TEST_ZOHO_CLIENT_SECRET }}
TEST_ZOHO_CLIENT_REFRESH_TOKEN: ${{ secrets.TEST_ZOHO_CLIENT_REFRESH_TOKEN }}
TEST_SHOPIFY_API_KEY: ${{ secrets.TEST_SHOPIFY_API_KEY }}
TEST_SHOPIFY_API_SECRET: ${{ secrets.TEST_SHOPIFY_API_SECRET }}
TEST_SHOPIFY_SHOP_URL: ${{ secrets.TEST_SHOPIFY_SHOP_URL }}
TEST_APPLE_LOGIN_TOKEN: ${{ secrets.TEST_APPLE_LOGIN_TOKEN }}
TEST_APOLLO_KEY: ${{ secrets.TEST_APOLLO_KEY }}
TEST_STRIPE_SECRET_KEY: ${{ secrets.TEST_STRIPE_SECRET_KEY }}
strategy:
fail-fast: false
matrix:
php-versions: ["8.3"]
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: kanvas
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
redis:
# Docker Hub image
image: redis
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
rabbitmq:
image: rabbitmq
ports:
- 5672:5672
meilisearch:
image: getmeili/meilisearch:latest
env:
MEILI_MASTER_KEY: masterKey
MEILI_NO_ANALYTICS: true
MEILI_ENV: development
MEILI_DB_PATH: data.ms
ports:
- 7700:7700
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
tools: pecl
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Setup Inventory DB
run: |
mysql -uroot -h127.0.0.1 -ppassword -e 'CREATE DATABASE IF NOT EXISTS inventory;'
- name: Setup Social DB
run: |
mysql -uroot -h127.0.0.1 -ppassword -e 'CREATE DATABASE IF NOT EXISTS social;'
- name: Setup CRM DB
run: |
mysql -uroot -h127.0.0.1 -ppassword -e 'CREATE DATABASE IF NOT EXISTS crm;'
- name: Setup WORKFLOW DB
run: |
mysql -uroot -h127.0.0.1 -ppassword -e 'CREATE DATABASE IF NOT EXISTS workflow;'
- name: Setup ACTION ENGINE DB
run: |
mysql -uroot -h127.0.0.1 -ppassword -e 'CREATE DATABASE IF NOT EXISTS action_engine;'
- name: Setup COMMERCE DB
run: |
mysql -uroot -h127.0.0.1 -ppassword -e 'CREATE DATABASE IF NOT EXISTS commerce;'
- name: Install Composer dependencies
run: composer install --prefer-dist --no-interaction --no-progress
- name: Setup Kanvas Ecosystem
run: php artisan kanvas:setup-ecosystem
- name: Setup Kanvas Integrations
run: php artisan kanvas:create-integration kanvas --config='{"client_id":{"type":"text","required":true},"client_secret":{"type":"text","required":true},"shop_url":{"type":"text","required":true}}' --handler='Kanvas\Connectors\Shopify\Handlers\ShopifyHandler'
- name: create .env file
run: echo '' > .env
- name: Run Tests
if: success()
run: php artisan test
- name: Upload artifacts
uses: actions/upload-artifact@master
if: failure()
with:
name: Logs
path: ./storage/logs