forked from InfotelGLPI/transferticketentity
-
Notifications
You must be signed in to change notification settings - Fork 1
151 lines (129 loc) · 4.28 KB
/
phpunit.yml
File metadata and controls
151 lines (129 loc) · 4.28 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
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: PHPUnit
on:
push:
pull_request:
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
jobs:
unit-tests:
name: "Unit tests (PHP ${{ matrix.php-version }})"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version: ["8.3", "8.4"]
steps:
- name: Checkout GLPI core (shallow)
uses: actions/checkout@v4
with:
repository: glpi-project/glpi
ref: 11.0/bugfixes
path: glpi
- name: Checkout plugin
uses: actions/checkout@v4
with:
path: glpi/plugins/transferticketentity
- name: Setup PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, openssl
coverage: none
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: ~/.cache/composer
key: composer-${{ matrix.php-version }}-${{ hashFiles('glpi/composer.lock') }}
restore-keys: composer-${{ matrix.php-version }}-
- name: Install GLPI Composer dependencies
run: composer install --no-interaction --prefer-dist --no-progress
working-directory: glpi
- name: Run unit tests
run: >
php vendor/bin/phpunit
--configuration plugins/transferticketentity/phpunit.xml
--testsuite Unit
working-directory: glpi
integration-tests:
name: "Integration tests (PHP ${{ matrix.php-version }} / ${{ matrix.db-image }})"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- php-version: "8.3"
db-image: "mysql:8.0"
- php-version: "8.3"
db-image: "mariadb:10.11"
services:
db:
image: ${{ matrix.db-image }}
env:
MYSQL_ROOT_PASSWORD: ""
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
MYSQL_DATABASE: glpi_test
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping -uroot"
--health-interval=10s
--health-timeout=5s
--health-retries=10
steps:
- name: Checkout GLPI core
uses: actions/checkout@v4
with:
repository: glpi-project/glpi
ref: 11.0/bugfixes
path: glpi
- name: Checkout plugin
uses: actions/checkout@v4
with:
path: glpi/plugins/transferticketentity
- name: Setup PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, openssl, mysqli, pdo_mysql
coverage: none
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: ~/.cache/composer
key: composer-${{ matrix.php-version }}-${{ hashFiles('glpi/composer.lock') }}
restore-keys: composer-${{ matrix.php-version }}-
- name: Install GLPI Composer dependencies
run: composer install --no-interaction --prefer-dist --no-progress
working-directory: glpi
- name: Build GLPI frontend dependencies
run: |
npm install --no-save
npm run-script build
working-directory: glpi
- name: Compile GLPI locales
run: |
sudo apt-get install -y gettext
php bin/console tools:locales:compile --allow-superuser
working-directory: glpi
- name: Install GLPI test database
run: >
php bin/console glpi:database:install
--no-interaction --force
--env=testing
--db-host=127.0.0.1
--db-name=glpi_test
--db-user=root
--db-password=""
working-directory: glpi
- name: Install transferticketentity plugin
run: |
php bin/console glpi:plugin:install --no-interaction --env=testing transferticketentity
php bin/console glpi:plugin:activate --no-interaction --env=testing transferticketentity
working-directory: glpi
- name: Run integration tests
run: >
php vendor/bin/phpunit
--configuration plugins/transferticketentity/phpunit.integration.xml
--testsuite Integration
working-directory: glpi