mirror of
https://github.com/shlinkio/shlink.git
synced 2024-12-01 21:09:27 -06:00
38 lines
1.2 KiB
YAML
38 lines
1.2 KiB
YAML
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:
|
|
php-version: ['8.1', '8.2']
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- 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
|
|
- uses: './.github/actions/ci-setup'
|
|
with:
|
|
php-version: ${{ matrix.php-version }}
|
|
php-extensions: openswoole-4.12.0
|
|
extensions-cache-key: tests-extensions-${{ matrix.php-version }}-${{ inputs.test-group }}
|
|
- run: composer test:${{ inputs.test-group }}:ci
|
|
- uses: actions/upload-artifact@v3
|
|
if: ${{ matrix.php-version == '8.1' }}
|
|
with:
|
|
name: coverage-${{ inputs.test-group }}
|
|
path: |
|
|
build/coverage-${{ inputs.test-group }}
|
|
build/coverage-${{ inputs.test-group }}.cov
|