forked from fusioninventory/fusioninventory-for-glpi
-
Notifications
You must be signed in to change notification settings - Fork 1
179 lines (165 loc) · 6.34 KB
/
tests.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
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# GitHub Actions docs
# https://help.github.com/en/articles/about-github-actions
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
name: CI
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.4', '8.0', '8.1', '8.2']
name: lint (${{ matrix.php-versions }})
env:
extensions: zip
key: cache-v1
steps:
- uses: actions/checkout@v1
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}
- name: Cache extensions
uses: actions/cache@v2
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
restore-keys: ${{ steps.extcache.outputs.key }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
- name: Cache Composer dependencies
uses: actions/cache@v2
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
- uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php-versions }}
- name: Lint
run: php vendor/bin/robo --no-interaction code:cs
phpunit-GLPI-latest:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions: ['7.4', '8.0', '8.1', '8.2']
glpi-versions: ['10.0.6']
name: phpunit-GLPI-latest (${{ matrix.glpi-versions }}) | PHP(${{ matrix.php-versions }})
env:
extensions: zip, hash, fileinfo, mysqli, gd, bz2, xdebug
key: cache-v1
steps:
- uses: ankane/setup-mariadb@v1
with:
mariadb-version: 10.8
- uses: actions/checkout@v1
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}
- name: Cache extensions
uses: actions/cache@v2
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
restore-keys: ${{ steps.extcache.outputs.key }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
- name: Cache Composer dependencies
uses: actions/cache@v2
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
- uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php-versions }}
- name: Get GLPI
run: wget https://github.com/glpi-project/glpi/releases/download/${{ matrix.glpi-versions }}/glpi-${{ matrix.glpi-versions }}.tgz
- name: Uncompress GLPI
run: tar zxvf glpi-${{ matrix.glpi-versions }}.tgz
- name: Copy Plugin FusionInventory
run: rsync -avr --exclude='glpi' ./* glpi/plugins/fusioninventory/
- name: Create the database
run: mysqladmin create glpi
- name: Check php dependencies
run: cd glpi && php bin/console glpi:system:check_requirements
- name: Install GLPI
run: cd glpi && mkdir tests && php bin/console glpi:database:install -n --config-dir=tests --db-name=glpi --db-user=root
- name: Install plugin FusionInventory
run: cd glpi && php bin/console glpi:plugin:install -vvv -n --config-dir=tests --username=glpi fusioninventory
- name: Activate plugin FusionInventory
run: cd glpi && php bin/console glpi:plugin:activate -n --config-dir=tests fusioninventory
- name: run tests
run: cd glpi/plugins/fusioninventory/ && php vendor/bin/phpunit --testdox tests/
# phpunit-GSIT:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# php-versions: ['7.3', '7.4', '8.0']
# gsit-versions: ['9.5.7']
# name: phpunit-GSIT (${{ matrix.gsit-versions }}) | PHP(${{ matrix.php-versions }})
# env:
# extensions: zip, hash, fileinfo, mysqli, gd, bz2, xdebug
# key: cache-v1
# steps:
# - uses: ankane/setup-mariadb@v1
# with:
# mariadb-version: 10.5
# - uses: actions/checkout@v1
# - name: Setup cache environment
# id: extcache
# uses: shivammathur/cache-extensions@v1
# with:
# php-version: ${{ matrix.php-versions }}
# extensions: ${{ env.extensions }}
# key: ${{ env.key }}
# - name: Cache extensions
# uses: actions/cache@v2
# with:
# path: ${{ steps.extcache.outputs.dir }}
# key: ${{ steps.extcache.outputs.key }}
# restore-keys: ${{ steps.extcache.outputs.key }}
# - name: Setup PHP
# uses: shivammathur/setup-php@v2
# with:
# php-version: ${{ matrix.php-versions }}
# extensions: ${{ env.extensions }}
# - name: Cache Composer dependencies
# uses: actions/cache@v2
# with:
# path: /tmp/composer-cache
# key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
# - uses: php-actions/composer@v6
# with:
# php_version: ${{ matrix.php-versions }}
# - name: Get GSIT
# run: wget https://github.com/DCS-Easyware/gsit/releases/download/GSIT-${{ matrix.gsit-versions }}/gsit-${{ matrix.gsit-versions }}.tar.gz
# - name: Uncompress GSIT
# run: tar zxvf gsit-${{ matrix.gsit-versions }}.tar.gz
# - name: Copy Plugin FusionInventory
# run: rsync -avr --exclude='gsit' ./* gsit/plugins/fusioninventory/
# - name: Create the database
# run: mysqladmin create gsit
# - name: Check php dependencies
# run: cd gsit && php bin/console glpi:system:check_requirements
# - name: Install GSIT
# run: cd gsit && mkdir tests && php bin/console glpi:database:install -n --config-dir=tests --db-name=gsit --db-user=root
# - name: Install plugin FusionInventory
# run: cd gsit && php bin/console glpi:plugin:install -vvv -n --config-dir=tests --username=glpi fusioninventory
# - name: Activate plugin FusionInventory
# run: cd gsit && php bin/console glpi:plugin:activate -n --config-dir=tests fusioninventory
# - name: run tests
# run: cd gsit/plugins/fusioninventory/ && php vendor/bin/phpunit --testdox tests/