-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (53 loc) · 1.92 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Tests Code Coverage
on:
push:
branches:
- main
pull_request:
jobs:
phpunit-code-coverage:
runs-on: ubuntu-latest
container:
image: escolalms/php:8-work
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: install git
run: apt-get install git -y
- 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: require phpunit-github-actions-printer
run: COMPOSER_ROOT_VERSION=0.9.9 composer require --dev mheap/phpunit-github-actions-printer
- name: Run tests
run: XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-clover coverage.xml --printer mheap\\GithubActionsReporter\\Printer
- name: Code Coverage upload
uses: codecov/codecov-action@v1
- name: Setup Code Climate test-reporter
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
- name: SafeDirFix
run: git config --global safe.directory '*'
- name: Convert
run: ./cc-test-reporter format-coverage coverage.xml -t clover -o codeclimate.0.json
- name: Upload
run: ./cc-test-reporter upload-coverage -i codeclimate.0.json
env:
CC_TEST_REPORTER_ID: 24d39b073fa0d5fd489f641f77013cc86b5b70d16dcd364d0e8498bd532da062