This repository has been archived by the owner on Feb 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
93 lines (79 loc) · 2.41 KB
/
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
name: E2E Tests
on:
push:
branches: [ master ]
pull_request:
jobs:
e2e:
runs-on: ubuntu-latest
env:
APP_ENV: prod
APP_DEBUG: false
DATABASE_URL: pgsql://ergonode:123@localhost:5432/ergonode_test?serverVersion=10&charset=utf8
USE_ASYNC_BUS: true
LEAVE_TEST_TAG_ATTRS: true
API_BASE_URL: http://localhost:8000/api/v1/
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '14'
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none
extensions: imagick
- name: Set up PostgreSQL
uses: harmon758/postgresql-action@v1
with:
postgresql version: 10
postgresql user: ergonode
postgresql password: 123
- name: Set up RabbitMQ
uses: getong/[email protected]
with:
rabbitmq version: 'latest'
host port: 5672
rabbitmq user: 'guest'
rabbitmq password: 'guest'
rabbitmq vhost: '/'
- name: PHP version
run: php -v
- name: Clone Backend
uses: actions/checkout@master
with:
repository: ergonode/backend
path: backend
- name: Run backend
run: |
cd backend
composer install
openssl genrsa -aes256 -passout pass:1234 -out "config/jwt/private.pem" 4096
openssl rsa -pubout -in "config/jwt/private.pem" -passin pass:1234 -out "config/jwt/public.pem"
./bin/phing database:create
./bin/phing database:migrate
./bin/phing database:fixture:e2e
composer install --no-dev
wget https://get.symfony.com/cli/installer -O - | bash
~/.symfony/bin/symfony server:start -d --no-tls --port=8000
cd ..
- name: Test backend
run: wget localhost:8000/api/doc
- name: Run frontend
run: |
npm ci
npm run modules:all
npm run build
./node_modules/.bin/pm2 start npm -- start
- name: Test frontend
run: wget --retry-connrefused --waitretry=1 localhost:3000
- name: Run E2E tests
run: npm run cypress:run
- name: Archive artifacts
uses: actions/upload-artifact@v2
if: always()
with:
name: artifacts
path: |
./backend/var/log