Skip to content

Commit 5edd727

Browse files
authored
Setup CircleCI
Use Sqlite for testing
2 parents 61a64b1 + 7558a70 commit 5edd727

File tree

2 files changed

+44
-48
lines changed

2 files changed

+44
-48
lines changed

.circleci/config.yml

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,58 @@
1-
# PHP CircleCI 2.0 configuration file
2-
#
3-
# Check https://circleci.com/docs/2.0/language-php/ for more details
4-
#
51
version: 2
62
jobs:
73
build:
84
docker:
9-
# Specify the version you desire here
10-
- image: circleci/php:7.4-node-browsers
11-
5+
- image: 'circleci/php:7.4-node-browsers'
126
steps:
137
- checkout
14-
158
- run:
16-
name: "Prepare Environment"
9+
name: Prepare Environment
1710
command: |
1811
sudo apt update
1912
sudo docker-php-ext-install zip
20-
2113
- run:
22-
name: "Create Environment file"
14+
name: Create Environment file
2315
command: |
2416
mv .env.testing .env
25-
26-
# Download and cache dependencies
2717
- restore_cache:
2818
keys:
29-
# "composer.lock" can be used if it is committed to the repo
30-
- v1-dependencies-{{ checksum "composer.json" }}
31-
# fallback to using the latest cache if no exact match is found
19+
- 'v1-dependencies-{{ checksum "composer.json" }}'
3220
- v1-dependencies-
33-
3421
- run:
35-
name: "Install Dependencies"
22+
name: Install Dependencies
3623
command: composer install -n --prefer-dist
37-
3824
- save_cache:
39-
key: v1-dependencies-{{ checksum "composer.json" }}
25+
key: 'v1-dependencies-{{ checksum "composer.json" }}'
4026
paths:
4127
- ./vendor
42-
4328
- run:
44-
name: "Generate App key"
45-
command: php artisan key:generate
46-
47-
# run tests with phpunit
29+
name: Generate App key
30+
command: 'php artisan key:generate'
4831
- run:
49-
name: "Run Unit Tests"
50-
command: ./vendor/bin/phpunit tests/Unit
32+
name: Run Unit Tests
33+
command: ./vendor/bin/phpunit tests/Unit
34+
- run:
35+
name: Create database and run migration
36+
command: |
37+
touch database/database.sqlite
38+
php artisan migrate --env=testing
39+
- run:
40+
name: Run Http Tests
41+
command: ./vendor/bin/phpunit tests/Feature
42+
- run:
43+
name: Install Dusk and Update Chrome Drivers
44+
command: |
45+
composer require --dev laravel/dusk:"^6.11"
46+
composer require --dev staudenmeir/dusk-updater
47+
php artisan dusk:update --detect
48+
- run:
49+
name: Start Chrome Driver
50+
command: ./vendor/laravel/dusk/bin/chromedriver-linux
51+
background: true
52+
- run:
53+
name: Run Laravel Server
54+
command: php artisan serve
55+
background: true
56+
- run:
57+
name: Run Browser Tests Tests
58+
command: php artisan dusk

.env.testing

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,33 @@ APP_NAME=Laravel
22
APP_ENV=local
33
APP_KEY=
44
APP_DEBUG=true
5-
APP_URL=http://localhost
5+
APP_URL=http://127.0.0.1:8000
66

77
LOG_CHANNEL=stack
8-
LOG_LEVEL=debug
98

10-
DB_CONNECTION=mysql
9+
DB_CONNECTION=sqlite
1110
DB_HOST=127.0.0.1
1211
DB_PORT=3306
13-
DB_DATABASE=laravel
14-
DB_USERNAME=root
15-
DB_PASSWORD=
12+
DB_DATABASE=database/database.sqlite
13+
DB_USERNAME=homestead
14+
DB_PASSWORD=secret
1615

1716
BROADCAST_DRIVER=log
1817
CACHE_DRIVER=file
19-
QUEUE_CONNECTION=sync
2018
SESSION_DRIVER=file
2119
SESSION_LIFETIME=120
22-
23-
MEMCACHED_HOST=127.0.0.1
20+
QUEUE_DRIVER=sync
2421

2522
REDIS_HOST=127.0.0.1
2623
REDIS_PASSWORD=null
2724
REDIS_PORT=6379
2825

29-
MAIL_MAILER=smtp
30-
MAIL_HOST=mailhog
31-
MAIL_PORT=1025
26+
MAIL_DRIVER=smtp
27+
MAIL_HOST=smtp.mailtrap.io
28+
MAIL_PORT=2525
3229
MAIL_USERNAME=null
3330
MAIL_PASSWORD=null
3431
MAIL_ENCRYPTION=null
35-
MAIL_FROM_ADDRESS=null
36-
MAIL_FROM_NAME="${APP_NAME}"
37-
38-
AWS_ACCESS_KEY_ID=
39-
AWS_SECRET_ACCESS_KEY=
40-
AWS_DEFAULT_REGION=us-east-1
41-
AWS_BUCKET=
4232

4333
PUSHER_APP_ID=
4434
PUSHER_APP_KEY=
@@ -47,5 +37,3 @@ PUSHER_APP_CLUSTER=mt1
4737

4838
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
4939
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
50-
51-

0 commit comments

Comments
 (0)