From af9c90e8a03111ca4f1f62692b59dd5c433fab8a Mon Sep 17 00:00:00 2001 From: Johan Cwiklinski Date: Tue, 7 Nov 2023 14:58:29 +0100 Subject: [PATCH] Use global plugin CI configuration --- .github/workflows/continuous-integration.yml | 98 +++----------------- 1 file changed, 15 insertions(+), 83 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 3fc90f7..b597d4c 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -8,93 +8,25 @@ on: 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"} - steps: - - name: "Checkout" - uses: "actions/checkout@v3" - - - name: "Setup PHP" - uses: "shivammathur/setup-php@v2" - with: - php-version: "${{ matrix.php-version }}" - coverage: "none" - tools: "composer, cs2pr" - - name: "Get Composer cache directory" - id: "composer-cache" - run: | - echo "::set-output name=dir::$(composer config cache-files-dir)" - - - name: "Restore dependencies cache" - uses: "actions/cache@v3" - with: - path: "${{ steps.composer-cache.outputs.dir }}" - key: "${{ github.job }}-${{ matrix.php-version }}-dependencies-${{ hashFiles('**/composer.lock') }}" - - - 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 - - unit-tests: - name: "unit-tests" - runs-on: "ubuntu-latest" - strategy: - fail-fast: false - matrix: - include: - - {php-version: "7.4"} - steps: - - name: "Clean workspace" - run: | - echo "APP_CONTAINER_HOME=${{ runner.temp }}/app_home" >> $GITHUB_ENV - rm -rf "${{ env.APPLICATION_ROOT }}/*" - - - name: "Checkout" - uses: "actions/checkout@v3" - - - name: "Initialize containers" - run: | - .github/actions/init_containers-start.sh - - - name: Cache Composer dependencies - uses: actions/cache@v3 - with: - path: /tmp/composer-cache - key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} - - - name: "Install dependencies" - uses: "ramsey/composer-install@v2" - - - name: "Install GLPI & plugin" - run: | - .github/actions/install.sh - - - name: "Run PHPUnit" - run: | - .github/actions/tests.sh - - - name: "Cleanup containers" - if: always() - run: | - ${{ github.workspace }}/.github/actions/teardown_containers-cleanup.sh + - {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: "centreon" + glpi-version: "${{ matrix.glpi-version }}" + php-version: "${{ matrix.php-version }}" + db-image: "${{ matrix.db-image }}"