2020-12-13 10:44:02 +01:00
|
|
|
name: Continuous integration
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request: null
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
- develop
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
lint:
|
|
|
|
runs-on: ubuntu-latest
|
2020-12-13 12:31:34 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
php-version: ['7.4']
|
2020-12-13 10:44:02 +01:00
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Use PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
2020-12-13 12:31:34 +01:00
|
|
|
php-version: ${{ matrix.php-version }}
|
2020-12-13 10:44:02 +01:00
|
|
|
tools: composer
|
|
|
|
extensions: swoole-4.5.9
|
2020-12-13 12:31:34 +01:00
|
|
|
coverage: none
|
2020-12-13 10:44:02 +01:00
|
|
|
- run: composer install --no-interaction --prefer-dist
|
|
|
|
- run: composer cs
|
|
|
|
|
|
|
|
unit-tests:
|
|
|
|
runs-on: ubuntu-latest
|
2020-12-13 12:31:34 +01:00
|
|
|
continue-on-error: ${{ matrix.php-version == '8.0' }}
|
2020-12-13 10:44:02 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-12-13 12:31:34 +01:00
|
|
|
php-version: ['7.4', '8.0']
|
2020-12-13 10:44:02 +01:00
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Use PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
php-version: ${{ matrix.php-version }}
|
|
|
|
tools: composer
|
|
|
|
extensions: swoole-4.5.9
|
2020-12-13 11:37:45 +01:00
|
|
|
coverage: pcov
|
|
|
|
ini-values: pcov.directory=module
|
2020-12-13 10:44:02 +01:00
|
|
|
- if: ${{ matrix.php-version == '8.0' }}
|
|
|
|
run: composer install --no-interaction --prefer-dist --ignore-platform-req=php
|
|
|
|
- if: ${{ matrix.php-version != '8.0' }}
|
|
|
|
run: composer install --no-interaction --prefer-dist
|
|
|
|
- run: composer test:unit:ci
|
2020-12-13 12:31:34 +01:00
|
|
|
# TODO Upload code coverage on one PHP version only
|
2020-12-13 10:44:02 +01:00
|
|
|
|
|
|
|
db-tests-sqlite:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-12-13 12:31:34 +01:00
|
|
|
php-version: ['7.4', '8.0']
|
2020-12-13 10:44:02 +01:00
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Use PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
php-version: ${{ matrix.php-version }}
|
|
|
|
tools: composer
|
|
|
|
extensions: swoole-4.5.9
|
2020-12-13 11:37:45 +01:00
|
|
|
coverage: pcov
|
|
|
|
ini-values: pcov.directory=module
|
2020-12-13 10:44:02 +01:00
|
|
|
- if: ${{ matrix.php-version == '8.0' }}
|
|
|
|
run: composer install --no-interaction --prefer-dist --ignore-platform-req=php
|
|
|
|
- if: ${{ matrix.php-version != '8.0' }}
|
|
|
|
run: composer install --no-interaction --prefer-dist
|
|
|
|
- run: composer test:db:sqlite:ci
|
2020-12-13 12:31:34 +01:00
|
|
|
# TODO Upload code coverage on one PHP version only
|
2020-12-13 10:44:02 +01:00
|
|
|
|
|
|
|
db-tests-mysql:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-12-13 12:31:34 +01:00
|
|
|
php-version: ['7.4', '8.0']
|
2020-12-13 10:44:02 +01:00
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Start database
|
|
|
|
run: docker-compose -f docker-compose.yml -f docker-compose.ci.yml up -d shlink_db
|
|
|
|
- name: Use PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
php-version: ${{ matrix.php-version }}
|
|
|
|
tools: composer
|
|
|
|
extensions: swoole-4.5.9
|
2020-12-13 12:31:34 +01:00
|
|
|
coverage: none
|
2020-12-13 10:44:02 +01:00
|
|
|
- if: ${{ matrix.php-version == '8.0' }}
|
|
|
|
run: composer install --no-interaction --prefer-dist --ignore-platform-req=php
|
|
|
|
- if: ${{ matrix.php-version != '8.0' }}
|
|
|
|
run: composer install --no-interaction --prefer-dist
|
|
|
|
- run: composer test:db:mysql
|
|
|
|
|
2020-12-13 12:31:34 +01:00
|
|
|
db-tests-maria:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
php-version: ['7.4', '8.0']
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Start database
|
|
|
|
run: docker-compose -f docker-compose.yml -f docker-compose.ci.yml up -d shlink_db_maria
|
|
|
|
- name: Use PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
php-version: ${{ matrix.php-version }}
|
|
|
|
tools: composer
|
|
|
|
extensions: swoole-4.5.9
|
|
|
|
coverage: none
|
|
|
|
- if: ${{ matrix.php-version == '8.0' }}
|
|
|
|
run: composer install --no-interaction --prefer-dist --ignore-platform-req=php
|
|
|
|
- if: ${{ matrix.php-version != '8.0' }}
|
|
|
|
run: composer install --no-interaction --prefer-dist
|
|
|
|
- run: composer test:db:maria
|
|
|
|
|
|
|
|
db-tests-postgres:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
php-version: ['7.4', '8.0']
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Start database
|
|
|
|
run: docker-compose -f docker-compose.yml -f docker-compose.ci.yml up -d shlink_db_postgres
|
|
|
|
- name: Use PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
php-version: ${{ matrix.php-version }}
|
|
|
|
tools: composer
|
|
|
|
extensions: swoole-4.5.9
|
|
|
|
coverage: none
|
|
|
|
- if: ${{ matrix.php-version == '8.0' }}
|
|
|
|
run: composer install --no-interaction --prefer-dist --ignore-platform-req=php
|
|
|
|
- if: ${{ matrix.php-version != '8.0' }}
|
|
|
|
run: composer install --no-interaction --prefer-dist
|
|
|
|
- run: composer test:db:postgres
|
|
|
|
|
|
|
|
db-tests-ms:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
php-version: ['7.4', '8.0']
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Install MSSQL ODBC
|
2020-12-13 12:38:12 +01:00
|
|
|
run: sudo ./data/infra/ci/install-ms-odbc.sh
|
2020-12-13 12:31:34 +01:00
|
|
|
- name: Start database
|
|
|
|
run: docker-compose -f docker-compose.yml -f docker-compose.ci.yml up -d shlink_db_ms
|
|
|
|
- name: Use PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
php-version: ${{ matrix.php-version }}
|
|
|
|
tools: composer
|
|
|
|
extensions: swoole-4.5.9, pdo_sqlsrv-5.9.0beta2
|
|
|
|
coverage: none
|
|
|
|
- if: ${{ matrix.php-version == '8.0' }}
|
|
|
|
run: composer install --no-interaction --prefer-dist --ignore-platform-req=php
|
|
|
|
- if: ${{ matrix.php-version != '8.0' }}
|
|
|
|
run: composer install --no-interaction --prefer-dist
|
2020-12-13 12:40:38 +01:00
|
|
|
- run: docker-compose exec -T shlink_db_ms /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P 'Passw0rd!' -Q "CREATE DATABASE shlink_test;"
|
2020-12-13 12:31:34 +01:00
|
|
|
- run: composer test:db:ms
|
|
|
|
|
2020-12-13 10:44:02 +01:00
|
|
|
api-tests:
|
|
|
|
runs-on: ubuntu-latest
|
2020-12-13 12:31:34 +01:00
|
|
|
continue-on-error: ${{ matrix.php-version == '8.0' }}
|
2020-12-13 10:44:02 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-12-13 12:31:34 +01:00
|
|
|
php-version: ['7.4', '8.0']
|
2020-12-13 10:44:02 +01:00
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Start database
|
|
|
|
run: docker-compose -f docker-compose.yml -f docker-compose.ci.yml up -d shlink_db
|
|
|
|
- name: Use PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
php-version: ${{ matrix.php-version }}
|
|
|
|
tools: composer
|
|
|
|
extensions: swoole-4.5.9
|
2020-12-13 11:37:45 +01:00
|
|
|
coverage: pcov
|
|
|
|
ini-values: pcov.directory=module
|
2020-12-13 10:44:02 +01:00
|
|
|
- if: ${{ matrix.php-version == '8.0' }}
|
|
|
|
run: composer install --no-interaction --prefer-dist --ignore-platform-req=php
|
|
|
|
- if: ${{ matrix.php-version != '8.0' }}
|
|
|
|
run: composer install --no-interaction --prefer-dist
|
|
|
|
- run: bin/test/run-api-tests.sh
|
2020-12-13 12:31:34 +01:00
|
|
|
# TODO Upload code coverage on one PHP version only
|