-
-
Notifications
You must be signed in to change notification settings - Fork 54
66 lines (54 loc) · 1.88 KB
/
coverage.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: Code Coverage (PHP)
on: [push, pull_request]
jobs:
tests:
name: Coverage
runs-on: ubuntu-latest
env:
DB_DATABASE: scout_testing
DB_USER: root
DB_PASSWORD: root
DB_PORT: 3306
DB_DRIVER: mysql
steps:
- uses: actions/checkout@v3
- name: Set up MySQL
run: |
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }}
- name: Setup cache environment
id: cache-env
uses: shivammathur/cache-extensions@v1
with:
php-version: 8.0
extensions: mbstring,dom,fileinfo,mysql,imagick,bcmath,pcntl,zip,soap,intl,gd,exif,iconv
key: extensions
- name: Cache extensions
uses: actions/cache@v1
with:
path: ${{ steps.cache-env.outputs.dir }}
key: ${{ steps.cache-env.outputs.key }}
restore-keys: ${{ steps.cache-env.outputs.key }}
- uses: shivammathur/setup-php@v2
with:
php-version: 8.0
extensions: mbstring,dom,fileinfo,mysql,imagick,bcmath,pcntl,zip,soap,intl,gd,exif,iconv
coverage: xdebug
- name: Get composer cache directory
id: composer-cache
run: echo "name=dir::$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
- name: Install dependencies
run: |
composer install --prefer-dist --no-interaction --no-suggest
- name: Run tests
run: |
mkdir -p build/logs
./vendor/bin/codecept run unit --coverage-xml coverage.xml;
bash <(curl -s https://codecov.io/bash)
env:
APP_ENV: testing