Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 42 additions & 40 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,63 @@
on:
---

name: build

on: # yamllint disable-line rule:truthy
push:
branches:
- master
- '*.*'
- '*.*.*'
pull_request: null

name: build

jobs:
test:
name: Test PHP ${{ matrix.php-versions }} with Code Coverage
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.0', '8.1', '8.2', '8.3']
php-versions: ['8.0', '8.1', '8.2', '8.3', '8.4']
steps:
- name: Checkout
- name: Install ODBC driver.
run: |
sudo curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list
sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18

- name: 📦 Checkout
uses: actions/checkout@v2
- name: Setup DB services
- name: 🛠️ Setup DB services
run: |
cd tests
docker compose up -d
cd ..
- name: Setup PHP ${{ matrix.php-versions }}
- name: 🛠️ Setup PHP ${{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: pcov
tools: pecl
extensions: mbstring, pdo, pdo_sqlite, pdo_pgsql, pdo_sqlsrv, pdo_mysql
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Restore Composer Cache
uses: actions/cache@v2

- name: Validate composer.json and composer.lock
run: composer validate --ansi --strict

- name: 📥 Install dependencies with composer
uses: ramsey/composer-install@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies with composer
if: matrix.php-versions != '8.3'
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
- name: Install dependencies with composer php 8.3
if: matrix.php-versions == '8.3'
run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
- name: Execute Tests
dependency-versions: "highest"

- name: 🚀 Execute Tests
run: |
vendor/bin/phpunit --coverage-clover=coverage.clover
- name: Upload coverage to Codecov

- name: 🦆 Upload coverage to Codecov
continue-on-error: true # if is fork
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.clover
- name: Upload coverage to Scrutinizer

- name: 🦆 Upload coverage to Scrutinizer
continue-on-error: true # if is fork
uses: sudo-bot/action-scrutinizer@latest
with:
Expand All @@ -64,32 +67,31 @@ jobs:
name: SQLite PHP ${{ matrix.php-versions }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions: ['8.0', '8.1']
php-versions: ['8.0', '8.1', '8.2', '8.3', '8.4']
steps:
- name: Checkout
- name: 📦 Checkout
uses: actions/checkout@v2
- name: Setup PHP ${{ matrix.php-versions }}
- name: 🛠️ Setup PHP ${{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: pcov
tools: pecl
extensions: mbstring, pdo, pdo_sqlite
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Restore Composer Cache
uses: actions/cache@v2

- name: 🤖 Validate composer.json and composer.lock
run: composer validate --ansi --strict

- name: 📥 Install dependencies with composer
uses: ramsey/composer-install@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Dependencies
run: composer install --no-interaction --prefer-dist
- name: Execute Tests
dependency-versions: "highest"

- name: 🚀 Execute Tests
env:
DB: sqlite
run: |
vendor/bin/phpunit tests/Schema/Driver/SQLite --colors=always
vendor/bin/phpunit --group driver-sqlite --colors=always

...
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ To test Cycle ORM Schema Builder locally, download the `cycle/schema-builder` re

```bash
$ cd tests/
$ docker-composer up
$ docker compose up
```

To run full test suite:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"require-dev": {
"phpunit/phpunit": "^9.5",
"spiral/tokenizer": "^2.8",
"vimeo/psalm": "^5.12",
"vimeo/psalm": "^5.12 || ^6.12",
"symfony/console": "^6.0 || ^7.0",
"spiral/code-style": "^2.2"
},
Expand Down
Loading
Loading