-
Notifications
You must be signed in to change notification settings - Fork 3
50 lines (40 loc) · 1.15 KB
/
test-cc.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
name: Tests Code Coverage
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- main
- master
pull_request:
jobs:
phpunit-code-coverage:
runs-on: ubuntu-latest
container:
image: escolalms/php:8.2
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: database
MYSQL_PASSWORD: password
MYSQL_USER: username
ports:
- 33306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Instantiate package
uses: actions/checkout@v2
- name: Setup environment
run: cp -r env/codecov/. .
- name: Update composer
run: composer update
- name: Clear config
run: vendor/bin/testbench config:clear
- name: Publish things
run: vendor/bin/testbench migrate:fresh
- name: Run tests
run: XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-clover coverage.xml
- name: Code Coverage upload
uses: codecov/codecov-action@v1