-
Notifications
You must be signed in to change notification settings - Fork 8
101 lines (98 loc) · 4.4 KB
/
test.yml
File metadata and controls
101 lines (98 loc) · 4.4 KB
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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Testing
on:
push:
branches:
- master
- feature/LOG-12
pull_request:
branches:
- master
- feature/LOG-12
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup PHP with composer v2
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
tools: composer:v2, phpunit:9.5
coverage: xdebug
- name: Use Node.js 14
uses: actions/setup-node@v2
with:
node-version: 14
- uses: actions/cache@v2
with:
path: |
~/.npm
~/.cache/Cypress
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Shutdown Ubuntu MySQL (SUDO)
run: sudo service mysql stop # Shutdown the Default MySQL, "sudo" is necessary, please not remove it
- name: Set up MySQL
uses: mirromutth/mysql-action@v1.1
with:
# host port: 3800 # Optional, default value is 3306. The port of host
# container port: 3307 # Optional, default value is 3306. The port of container
character set server: 'utf8mb4' # Optional, default value is 'utf8mb4'. The '--character-set-server' option for mysqld
collation server: 'utf8mb4_general_ci' # Optional, default value is 'utf8mb4_general_ci'. The '--collation-server' option for mysqld
mysql version: '5.7' # Optional, default value is "latest". The version of the MySQL
mysql database: 'test' # Optional, default value is "test". The specified database which will be create
# mysql root password: ${{ secrets.RootPassword }} # Required if "mysql user" is empty, default is empty. The root superuser password
mysql user: 'dev' # Required if "mysql root password" is empty, default is empty. The superuser for the specified database. Can use secrets, too
mysql password: 'dev'
- name: ClickHouse install
run: |
sudo apt-get update -y
sudo apt -y install apt-transport-https ca-certificates dirmngr
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv E0C56BD4
echo "deb https://repo.clickhouse.tech/deb/stable/ main/" | sudo tee /etc/apt/sources.list.d/clickhouse.list
sudo apt-get update -y
sudo apt-get install -y clickhouse-server clickhouse-client
sudo service clickhouse-server start
- name: Install Cypress dependencies
run: sudo apt-get install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
- name: Create .env
run: |
cp .env.dist .env
sed -i 's/APP_ENV=dev/APP_ENV=dev/' .env
sed -i 's/MYSQL_URL=mysql:\/\/dev:dev@mysql:3306\/dev/MYSQL_URL=mysql:\/\/dev:dev@127.0.0.1:3306\/test/' .env
sed -i 's/DATABASE_HOST=db/DATABASE_HOST=127.0.0.1/' .env
sed -i 's/DATABASE_DBNAME=logs/DATABASE_DBNAME=default/' .env
- name: Install NPM
run: npm i
- name: Build NPM
run: npm run build
- name: Run composer
run: |
composer self-update
composer install --no-interaction --prefer-dist --optimize-autoloader
- name: Migration
run: bin/console doctrine:migrations:migrate --no-interaction --env="dev"
- name: Fixtures
run: bin/console doctrine:fixtures:load -n --env="dev"
- name: Create sample database
run: bin/console app:createsampledatabase --env="dev"
- name: Create sample data
run: bin/console app:createsampledata 300 --env="dev"
# - name: Run test
# run: php bin/phpunit
- name: Symfony start server
run: |
curl -sS https://get.symfony.com/cli/installer | bash
/home/runner/.symfony5/bin/symfony server:start -d
- name: Cypress test
run: CYPRESS_BASE_URL=http://localhost:8000 ./node_modules/.bin/cypress run
- name: Upload test failed
uses: actions/upload-artifact@v2
if: failure()
with:
name: Cypress
path: |
cypress/screenshots