diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 2efcbe7..f8093d9 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -3,59 +3,29 @@ name: "Continuous integration" on: push: branches: - - "master" - - "develop" + - "main" tags: - "*" pull_request: + schedule: + - cron: "0 0 * * *" workflow_dispatch: jobs: - lint: - name: "Lint" - runs-on: "ubuntu-latest" + ci: + name: "GLPI ${{ matrix.glpi-version }} - php:${{ matrix.php-version }} - ${{ matrix.db-image }}" strategy: fail-fast: false matrix: include: - - {php-version: "7.4"} - - {php-version: "8.0"} - - {php-version: "8.1"} - - {php-version: "8.2"} - - {php-version: "8.3-rc"} - steps: - - name: "Checkout" - uses: "actions/checkout@v4" - - name: "Setup PHP" - uses: "shivammathur/setup-php@v2" - with: - php-version: "${{ matrix.php-version }}" - coverage: "none" - tools: "composer, cs2pr" - - name: "Install Composer dependencies" - run: | - composer install --ansi --no-interaction --no-progress --prefer-dist - - name: "PHP Parallel Lint" - run: | - vendor/bin/parallel-lint --colors --checkstyle --exclude ./vendor/ . | cs2pr - - name: "PHP_CodeSniffer" - run: | - vendor/bin/phpcs -q --report=checkstyle | cs2pr - - name: "Check for missing/outdated headers" - run: | - vendor/bin/licence-headers-check --ansi --no-interaction - - name: Checkout GLPI - uses: actions/checkout@v4 - with: - repository: glpi-project/glpi - path: glpi - fetch-depth: 1 - ref: 10.0/bugfixes - - name: Install xmllint - run: sudo apt-get install -y gettext - - name: "Build dependencies / translations" - run: cd glpi && php bin/console dependencies install && php bin/console locales:compile - - name: Copy plugin - run: rsync -avr --exclude='glpi' ./* glpi/plugins/databaseinventory/ - - name: PHPStan checks - run: cd glpi/plugins/databaseinventory && php vendor/bin/phpstan analyze --ansi --memory-limit=1G --no-interaction --no-progress + - {glpi-version: "10.0.x", php-version: "7.4", db-image: "mysql:5.7"} + - {glpi-version: "10.0.x", php-version: "8.0", db-image: "mysql:8.0"} + - {glpi-version: "10.0.x", php-version: "8.1", db-image: "mariadb:10.2"} + - {glpi-version: "10.0.x", php-version: "8.2", db-image: "mariadb:11.0"} + - {glpi-version: "10.0.x", php-version: "8.3-rc", db-image: "mysql:8.0"} + uses: "glpi-project/plugin-ci-workflows/.github/workflows/continuous-integration.yml@v1" + with: + plugin-key: "databaseinventory" + glpi-version: "${{ matrix.glpi-version }}" + php-version: "${{ matrix.php-version }}" + db-image: "${{ matrix.db-image }}"