This repository was archived by the owner on Oct 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (54 loc) · 1.38 KB
/
test_pull.yml
File metadata and controls
56 lines (54 loc) · 1.38 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
name: Test pull request
on:
pull_request:
types:
- opened
- synchronize
jobs:
test:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
ports:
- 3306:3306
env:
MYSQL_DATABASE: laravel
MYSQL_ROOT_PASSWORD: password
steps:
- uses: actions/checkout@v2
- uses: nanasess/setup-php@master
with:
php-version: 7.4
- name: Cache composer packages
uses: actions/cache@v1
with:
path: vendor
key: ${{ runner.os }}-vendor-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-vendor-
- name: install packages
run: composer install
- name: setup .env file
run: |
cp .env.example .env
sed -i .env \
-e 's/^\(APP_KEY=\).*$/\1hkauMHOsNK82WMcuL9jQXr0n1pQ7Ndy3/' \
-e '/^DB_/d'
cat >> .env << EOF
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=password
TEST_FRESH_DB=true
EOF
- name: run migration test
run: |
php artisan migrate:fresh
php artisan migrate:rollback
- name: run test
run: vendor/bin/phpunit
- name: run linter
run: vendor/bin/phpcs