-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (105 loc) · 3.32 KB
/
push.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
on: push
name: Run tests
jobs:
spec_tests:
name: "Spec tests"
runs-on: ubuntu-latest
if: '!github.event.deleted'
steps:
- name: 'Checkout code'
uses: actions/checkout@v4
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@master
with:
php-version: 7.2
# We're using phpdbg, we don't need a coverage extension.
coverage: none
- name: Install Dependencies
run: |
composer install --no-interaction --no-progress
- name: 'Run spec tests'
env:
APP_KEY: "base64:Z++HhObkg1plehwZlK6RGSRVi4uWPiUGRYFoDOt2/Ig="
DB_CONNECTION: "sqlite"
DB_DATABASE: "/tmp/acdc.sqlite"
LOG_CHANNEL: "errorlog"
APP_ENV: "testing"
run: |
phpdbg -qrr vendor/bin/phpspec run
- name: 'Merge coverage'
run: |
phpdbg -qrr vendor/bin/phpcov merge --clover=spec.xml coverage/spec.cov
- name: 'Upload CodeCov report'
uses: codecov/codecov-action@v4
with:
files: ./spec.xml
flags: spec
fail_ci_if_error: true
# Needed for Dependabot PRs.
token: ${{ secrets.CODECOV_TOKEN }}
unit_tests:
name: "Unit tests"
runs-on: ubuntu-latest
if: '!github.event.deleted'
steps:
- name: 'Checkout code'
uses: actions/checkout@v4
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@master
with:
php-version: 7.2
# We're using phpdbg, we don't need a coverage extension.
coverage: none
- name: Install Dependencies
run: |
composer install --no-interaction --no-progress
- name: 'Run unit tests'
run: |
phpdbg -qrr vendor/bin/phpunit --testsuite Unit --coverage-php=coverage/unit.cov
- name: 'Merge coverage'
run: |
phpdbg -qrr vendor/bin/phpcov merge --clover=unit.xml coverage/unit.cov
- name: 'Upload CodeCov report'
uses: codecov/codecov-action@v4
with:
files: ./unit.xml
flags: unit
fail_ci_if_error: true
# Needed for Dependabot PRs.
token: ${{ secrets.CODECOV_TOKEN }}
feature_tests:
name: "Feature tests"
runs-on: ubuntu-latest
if: '!github.event.deleted'
steps:
- name: 'Checkout code'
uses: actions/checkout@v4
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@master
with:
php-version: 7.2
# We're using phpdbg, we don't need a coverage extension.
coverage: none
- name: Install Dependencies
run: |
composer install --no-interaction --no-progress
- name: 'Run unit tests'
env:
APP_KEY: "base64:Z++HhObkg1plehwZlK6RGSRVi4uWPiUGRYFoDOt2/Ig="
DB_CONNECTION: "sqlite"
DB_DATABASE: "/tmp/acdc.sqlite"
LOG_CHANNEL: "errorlog"
APP_ENV: "testing"
run: |
phpdbg -qrr vendor/bin/phpunit --testsuite Feature --coverage-php=coverage/feature.cov
- name: 'Merge coverage'
run: |
phpdbg -qrr vendor/bin/phpcov merge --clover=feature.xml coverage/feature.cov
- name: 'Upload CodeCov report'
uses: codecov/codecov-action@v4
with:
files: ./feature.xml
flags: feature
fail_ci_if_error: true
# Needed for Dependabot PRs.
token: ${{ secrets.CODECOV_TOKEN }}