-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
81 lines (78 loc) · 1.96 KB
/
unit-backend-mysql.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
name: Backend Unit Tests - MySQL
on:
pull_request:
branches:
- master
paths-ignore:
- resources/assets/**
push:
branches:
- master
paths-ignore:
- resources/assets/**
workflow_dispatch:
branches:
- master
paths-ignore:
- resources/assets/**
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: [ 8.0 ]
mysql-version: [ 5.7, 8.0 ]
fail-fast: false
services:
mysql:
image: mysql:${{ matrix.mysql-version }}
env:
MYSQL_DATABASE: koel
MYSQL_USER: mysql
MYSQL_PASSWORD: mysql
MYSQL_ROOT_PASSWORD: mysql
ports:
- 3306:3306
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
DB_CONNECTION: mysql-ci
DB_HOST: 127.0.1.1
DB_PORT: 3306
DB_DATABASE: koel
DB_USERNAME: mysql
DB_PASSWORD: mysql
steps:
- uses: actions/checkout@v1
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer:v2
coverage: xdebug
extensions: pdo_sqlite, zip, gd
- name: Install PHP dependencies
uses: ramsey/composer-install@v2
with:
composer-options: --prefer-dist
- name: Generate app key
run: php artisan key:generate --quiet
- name: Run code style checker
run: composer cs
- name: Run static analysis
run: composer analyze -- --no-progress
- name: Run tests
run: composer coverage
- name: Upload logs if broken
uses: actions/upload-artifact@v1
if: failure()
with:
name: logs
path: storage/logs
- name: Upload coverage
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}