mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-26 04:09:02 +03:00
194 lines
6.3 KiB
YAML
194 lines
6.3 KiB
YAML
name: Continuous integration
|
|
|
|
on:
|
|
pull_request: null
|
|
push:
|
|
branches:
|
|
- main
|
|
- develop
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
php-version: ['7.4']
|
|
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
|
|
coverage: none
|
|
- run: composer install --no-interaction --prefer-dist
|
|
- run: composer cs
|
|
|
|
unit-tests:
|
|
runs-on: ubuntu-latest
|
|
continue-on-error: ${{ matrix.php-version == '8.0' }}
|
|
strategy:
|
|
matrix:
|
|
php-version: ['7.4', '8.0']
|
|
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
|
|
coverage: pcov
|
|
ini-values: pcov.directory=module
|
|
- 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
|
|
# TODO Upload code coverage on one PHP version only
|
|
|
|
db-tests-sqlite:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
php-version: ['7.4', '8.0']
|
|
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
|
|
coverage: pcov
|
|
ini-values: pcov.directory=module
|
|
- 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
|
|
# TODO Upload code coverage on one PHP version only
|
|
|
|
db-tests-mysql:
|
|
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
|
|
- 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:mysql
|
|
|
|
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
|
|
run: sudo ./data/infra/ci/install-ms-odbc.sh
|
|
- 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
|
|
- run: composer test:db:ms
|
|
|
|
api-tests:
|
|
runs-on: ubuntu-latest
|
|
continue-on-error: ${{ matrix.php-version == '8.0' }}
|
|
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
|
|
- name: Use PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php-version }}
|
|
tools: composer
|
|
extensions: swoole-4.5.9
|
|
coverage: pcov
|
|
ini-values: pcov.directory=module
|
|
- 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
|
|
# TODO Upload code coverage on one PHP version only
|