forked from necobm/symfony-api-restfull
-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (58 loc) · 1.93 KB
/
ci.yml
File metadata and controls
72 lines (58 loc) · 1.93 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
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
services:
db:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: lotr
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping -h localhost -u root --password=root"
--health-interval=30s
--health-timeout=10s
--health-retries=3
redis:
image: redis:latest
ports:
- 6379:6379
options: >-
--health-cmd="redis-cli ping"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: mbstring, pdo_mysql, redis
- name: Clear Composer cache
run: composer clear-cache
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest --no-interaction
- name: Import init-test.sql
run: |
mysql -h 127.0.0.1 -u root --password=root < opt/db/init-test.sql
- name: Run BDD tests
run: |
export DATABASE_URL="mysql://root:root@127.0.0.1:3306/lotr?serverVersion=8.0.32&charset=utf8mb4"
export REDIS_HOST=127.0.0.1
export REDIS_PORT=6379
export REDIS_PASS=null
export REDIS_DB=0
./vendor/bin/behat --no-snippets --strict --colors -v
- name: Run PHPStan
run: ./vendor/bin/phpstan analyse
- name: Run PHPUnit with coverage
run: ./coverage-checker.sh
- name: Run Mutant tests
run: ./vendor/bin/infection --coverage=report --skip-initial-tests --show-mutations --min-msi=6 # I set 6 but it should be 100%
- name: Check for security vulnerabilities
run: composer audit --abandoned=ignore