Skip to content

Commit ccb175e

Browse files
committed
Update documentation
1 parent f0fa850 commit ccb175e

File tree

1 file changed

+49
-15
lines changed

1 file changed

+49
-15
lines changed

README.md

+49-15
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Continuous integration workflow
44

5-
This workflow will execute the following actions as long as they are available on the checked repository.
5+
This workflow will execute the following actions as long as they are available on the plugin repository.
66

77
| Action | Required package | Required config file |
88
| -------- | -------- | -------- |
@@ -15,8 +15,42 @@ This workflow will execute the following actions as long as they are available o
1515
| PHPUnit | [phpunit/phpunit](https://packagist.org/packages/phpunit/phpunit) | `phpunit.xml` |
1616
| Jest | [jest](https://www.npmjs.com/package/jest) | `jest.config.js` |
1717

18-
You can use this workflow in any plugin using the following Github Actions configuration.
19-
You will have to use your plugin system name in the `plugin-key` parameter.
18+
```yaml
19+
name: "Continuous integration"
20+
21+
on:
22+
pull_request:
23+
24+
jobs:
25+
ci:
26+
uses: "glpi-project/plugin-ci-workflows/.github/workflows/continuous-integration.yml@v1"
27+
with:
28+
# The plugin key (system name).
29+
plugin-key: "myplugin"
30+
31+
# The version of GLPI on which to run the tests.
32+
glpi-version: "10.0.x"
33+
34+
# The version of PHP on which to run the tests.
35+
php-version: "8.1"
36+
37+
# The database docker image on which to run the tests.
38+
db-image: "10.6"
39+
```
40+
41+
The available `glpi-version`/`php-version` combinations corresponds to the `ghcr.io/glpi-project/githubactions-glpi` images tags
42+
that can be found [here](https://github.com/orgs/glpi-project/packages/container/githubactions-glpi/versions?filters%5Bversion_type%5D=tagged).
43+
44+
The `db-image` parameter is a combination of the DB server engine (`mysql`, `mariadb` or `percona`) and the server version.
45+
- MariaDB available versions are listed [here](https://github.com/orgs/glpi-project/packages/container/githubactions-mariadb/versions?filters%5Bversion_type%5D=tagged)
46+
- MySQL available versions are listed [here](https://github.com/orgs/glpi-project/packages/container/githubactions-mysql/versions?filters%5Bversion_type%5D=tagged).
47+
- Percona available versions are listed [here](https://github.com/orgs/glpi-project/packages/container/githubactions-percona/versions?filters%5Bversion_type%5D=tagged).
48+
49+
## Generate CI matrix
50+
51+
This workflow can be used to generate a matrix that contains all the PHP/SQL versions that are supported by the target GLPI version.
52+
You can use it in combination with the `Continuous Integration` workflow to execute the continuous integration
53+
test suite on all PHP/SQL versions supported by the target version of GLPI, as shown in the example below.
2054

2155
```yaml
2256
name: "Continuous integration"
@@ -30,28 +64,28 @@ on:
3064
pull_request:
3165
schedule:
3266
- cron: "0 0 * * *"
67+
workflow_dispatch:
68+
69+
concurrency:
70+
group: "${{ github.workflow }}-${{ github.ref }}"
71+
cancel-in-progress: true
3372
3473
jobs:
74+
generate-ci-matrix:
75+
name: "Generate CI matrix"
76+
uses: "glpi-project/plugin-ci-workflows/.github/workflows/generate-ci-matrix.yml@v1"
77+
with:
78+
glpi-version: "10.0.x"
3579
ci:
3680
name: "GLPI ${{ matrix.glpi-version }} - php:${{ matrix.php-version }} - ${{ matrix.db-image }}"
81+
needs: "generate-ci-matrix"
3782
strategy:
3883
fail-fast: false
39-
matrix:
40-
include:
41-
- {glpi-version: "10.0.x", php-version: "7.4", db-image: "mysql:5.7"}
42-
- {glpi-version: "10.0.x", php-version: "8.2", db-image: "mariadb:10.6"}
84+
matrix: ${{ fromJson(needs.generate-ci-matrix.outputs.matrix) }}
4385
uses: "glpi-project/plugin-ci-workflows/.github/workflows/continuous-integration.yml@v1"
4486
with:
4587
plugin-key: "myplugin"
4688
glpi-version: "${{ matrix.glpi-version }}"
4789
php-version: "${{ matrix.php-version }}"
4890
db-image: "${{ matrix.db-image }}"
4991
```
50-
51-
The available `glpi-version`/`php-version` combinations corresponds to the `ghcr.io/glpi-project/githubactions-glpi` images tags
52-
that can be found [here](https://github.com/orgs/glpi-project/packages/container/githubactions-glpi/versions?filters%5Bversion_type%5D=tagged).
53-
54-
The `db-image` parameter is a combination of the DB server engine (`mysql`, `mariadb` or `percona`) and the server version.
55-
- MariaDB available versions are listed [here](https://github.com/orgs/glpi-project/packages/container/githubactions-mariadb/versions?filters%5Bversion_type%5D=tagged)
56-
- MySQL available versions are listed [here](https://github.com/orgs/glpi-project/packages/container/githubactions-mysql/versions?filters%5Bversion_type%5D=tagged).
57-
- Percona available versions are listed [here](https://github.com/orgs/glpi-project/packages/container/githubactions-percona/versions?filters%5Bversion_type%5D=tagged).

0 commit comments

Comments
 (0)