-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (59 loc) · 2.32 KB
/
laravel.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
name: Laravel CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
laravel:
name: Laravel Testsuite
runs-on: ubuntu-20.04 # has mysql 8 installed by default
steps:
- name: Set Up Mysql 8
run: |
echo -e "Enable LOAD DATA LOCAL INFILE in my.cnf\n"
echo -e "SETTING secure-file-priv TO EMPTY STRING\n"
echo -e "[mysqld]\nsecure-file-priv=''" | sudo tee -a /etc/mysql/my.cnf
echo -e "SETTING local_infile TO ON\n"
echo -e "[mysqld]\nlocal_infile='ON'" | sudo tee -a /etc/mysql/my.cnf
echo -e "Start MYSQL service, it is off by default\n"
sudo systemctl enable mysql.service
sudo systemctl start mysql.service
echo -e "Creating Laravel Database\n"
mysql --host 127.0.0.1 -uroot -proot -e 'CREATE DATABASE IF NOT EXISTS laravel;'
echo -e "Check new settings\n"
mysql --host 127.0.0.1 -uroot -proot -e "SELECT @@global.secure_file_priv, @@global.local_infile"
- name: Checkout
uses: actions/checkout@v2
- name: Get Composer Cache Directory
id: get-composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache Composer
uses: actions/cache@v1
id: composer-cache
with:
path: ${{ steps.get-composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Install composer dependencies
run: composer install --no-progress --prefer-dist --no-interaction --no-suggest --optimize-autoloader --no-scripts
- name: Clear Config
run: |
php artisan config:clear
php artisan cache:clear
- name: Prepare the application
run: |
cp .env.ci .env
php artisan key:generate
- name: Run Migrations
run: php artisan migrate --force -v
- name: Test with phpunit
run: ./vendor/bin/pest
- name: Run Sensiolabs security checks
run: |
test -d security-checker || git clone https://github.com/sensiolabs/security-checker.git
cd security-checker
composer install
php security-checker security:check ../composer.lock