diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 0efb651..41a0f81 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -15,139 +15,9 @@ concurrency: permissions: contents: read -env: - COMPOSER_ROOT_VERSION: 1.x-dev - # An unreachable database fails the run instead of skipping its tests. - DB_REQUIRED: 1 - jobs: - unit: - name: Unit ยท PHP ${{ matrix.php-version }} ยท ${{ matrix.dependencies }} - timeout-minutes: 6 - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - php-version: - - '8.2' - - '8.3' - - '8.4' - - '8.5' - dependencies: - - lowest - - highest - steps: - - name: ๐Ÿ“ฆ Check out the codebase - uses: actions/checkout@v6 - with: - persist-credentials: false - - - name: ๐Ÿ› ๏ธ Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-version }} - extensions: pdo, pdo_sqlite - ini-values: error_reporting=E_ALL - coverage: none - - - name: ๐Ÿค– Validate composer.json - run: composer validate --ansi --strict - - - name: ๐Ÿ“ฅ Install dependencies with composer - uses: ramsey/composer-install@v3 - with: - dependency-versions: ${{ matrix.dependencies }} - - - name: ๐Ÿงช Run unit tests - run: composer test:unit - - database: - name: ${{ matrix.driver }} ยท PHP ${{ matrix.php-version }} ยท ${{ matrix.dependencies }} - timeout-minutes: 12 - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - driver: - - sqlite - - mysql - - postgres - - sqlserver - php-version: - - '8.2' - - '8.3' - - '8.4' - - '8.5' - dependencies: - - highest - include: - - {driver: sqlite, php-version: '8.2', dependencies: lowest} - - {driver: mysql, php-version: '8.2', dependencies: lowest} - - {driver: postgres, php-version: '8.2', dependencies: lowest} - - {driver: sqlserver, php-version: '8.2', dependencies: lowest} - steps: - - name: ๐Ÿ“ฆ Check out the codebase - uses: actions/checkout@v6 - with: - persist-credentials: false - - - name: ๐Ÿ›ข๏ธ Start ${{ matrix.driver }} - if: matrix.driver != 'sqlite' - run: docker compose -f resources/docker/compose.yaml up -d --wait ${{ matrix.driver }} - - - name: ๐Ÿ› ๏ธ Install the Microsoft ODBC driver - if: matrix.driver == 'sqlserver' - run: | - curl -fsSL https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list - sudo apt-get update - sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 - - - name: ๐Ÿ› ๏ธ Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-version }} - extensions: pdo, pdo_sqlite, pdo_mysql, pdo_pgsql, pdo_sqlsrv - ini-values: error_reporting=E_ALL - coverage: none - - - name: ๐Ÿ“ฅ Install dependencies with composer - uses: ramsey/composer-install@v3 - with: - dependency-versions: ${{ matrix.dependencies }} - - - name: ๐Ÿงช Run Feature, Acceptance and Regression suites - run: composer test:${{ matrix.driver }} - - coverage: - name: Code coverage - timeout-minutes: 6 - runs-on: ubuntu-latest - steps: - - name: ๐Ÿ“ฆ Check out the codebase - uses: actions/checkout@v6 - with: - persist-credentials: false - - - name: ๐Ÿ› ๏ธ Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.4' - extensions: pdo, pdo_sqlite - ini-values: error_reporting=E_ALL - coverage: xdebug - - - name: ๐Ÿ“ฅ Install dependencies with composer - uses: ramsey/composer-install@v3 - with: - dependency-versions: highest - - - name: ๐Ÿงช Collect code coverage (Unit and SQLite suites) - run: composer test:cc - - - name: ๐Ÿ“ค Upload code coverage report to Codecov - uses: codecov/codecov-action@v5 - continue-on-error: true - with: - files: runtime/clover.xml - token: ${{ secrets.CODECOV_TOKEN }} - verbose: true + testo: + uses: cycle/gh-actions/.github/workflows/testo.yml@master + with: + coverage: true + secrets: inherit