2022-08-12 09:35:10 +03:00
|
|
|
name: Tests
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
test-group:
|
|
|
|
type: string
|
|
|
|
required: true
|
|
|
|
description: One of unit, api or cli
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
tests:
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-09-24 09:03:38 +03:00
|
|
|
php-version: ['8.1', '8.2']
|
2022-08-12 09:35:10 +03:00
|
|
|
steps:
|
2022-08-13 12:56:46 +03:00
|
|
|
- uses: actions/checkout@v3
|
2022-08-12 09:35:10 +03:00
|
|
|
- name: Start postgres database server
|
|
|
|
if: ${{ inputs.test-group == 'api' }}
|
|
|
|
run: docker-compose -f docker-compose.yml -f docker-compose.ci.yml up -d shlink_db_postgres
|
|
|
|
- name: Start maria database server
|
|
|
|
if: ${{ inputs.test-group == 'cli' }}
|
|
|
|
run: docker-compose -f docker-compose.yml -f docker-compose.ci.yml up -d shlink_db_maria
|
2022-08-13 12:56:46 +03:00
|
|
|
- uses: './.github/actions/ci-setup'
|
2022-08-12 21:32:16 +03:00
|
|
|
with:
|
|
|
|
php-version: ${{ matrix.php-version }}
|
2023-01-22 22:57:48 +03:00
|
|
|
php-extensions: openswoole-4.12.1
|
2022-08-13 12:56:46 +03:00
|
|
|
extensions-cache-key: tests-extensions-${{ matrix.php-version }}-${{ inputs.test-group }}
|
2022-08-12 09:35:10 +03:00
|
|
|
- run: composer test:${{ inputs.test-group }}:ci
|
2022-08-12 19:19:12 +03:00
|
|
|
- uses: actions/upload-artifact@v3
|
2022-08-12 09:35:10 +03:00
|
|
|
if: ${{ matrix.php-version == '8.1' }}
|
|
|
|
with:
|
|
|
|
name: coverage-${{ inputs.test-group }}
|
|
|
|
path: |
|
|
|
|
build/coverage-${{ inputs.test-group }}
|
|
|
|
build/coverage-${{ inputs.test-group }}.cov
|