shlink/.github/workflows/ci.yml

156 lines
3.5 KiB
YAML
Raw Normal View History

name: Continuous integration
on:
pull_request:
paths-ignore:
- 'LICENSE'
- '.*'
- '*.md'
- '*.xml'
- '*.yml*'
- '*.json5'
- '*.neon'
push:
branches:
- main
- develop
2022-01-25 13:39:31 -06:00
- 2.x
paths-ignore:
- 'LICENSE'
- '.*'
- '*.md'
- '*.xml'
- '*.yml*'
- '*.json5'
- '*.neon'
jobs:
static-analysis:
2022-08-01 10:13:34 -05:00
runs-on: ubuntu-22.04
strategy:
matrix:
2023-05-29 02:43:12 -05:00
php-version: ['8.2']
command: ['cs', 'stan', 'swagger:validate']
steps:
2023-11-04 06:42:31 -05:00
- uses: actions/checkout@v4
- uses: './.github/actions/ci-setup'
with:
php-version: ${{ matrix.php-version }}
extensions-cache-key: tests-extensions-${{ matrix.php-version }}-${{ matrix.command }}
- run: composer ${{ matrix.command }}
unit-tests:
uses: './.github/workflows/ci-tests.yml'
with:
test-group: unit
2022-08-27 12:38:05 -05:00
cli-tests:
uses: './.github/workflows/ci-tests.yml'
with:
test-group: cli
2024-02-16 16:02:46 -06:00
api-tests:
uses: './.github/workflows/ci-tests.yml'
with:
test-group: api
sqlite-db-tests:
uses: './.github/workflows/ci-db-tests.yml'
with:
platform: 'sqlite:ci'
mysql-db-tests:
uses: './.github/workflows/ci-db-tests.yml'
with:
platform: 'mysql'
maria-db-tests:
uses: './.github/workflows/ci-db-tests.yml'
with:
platform: 'maria'
postgres-db-tests:
uses: './.github/workflows/ci-db-tests.yml'
with:
platform: 'postgres'
ms-db-tests:
uses: './.github/workflows/ci-db-tests.yml'
with:
platform: 'ms'
unit-mutation-tests:
needs:
- unit-tests
2022-08-12 02:32:30 -05:00
uses: './.github/workflows/ci-mutation-tests.yml'
with:
test-group: unit
db-mutation-tests:
needs:
- sqlite-db-tests
2022-08-12 02:32:30 -05:00
uses: './.github/workflows/ci-mutation-tests.yml'
with:
test-group: db
api-mutation-tests:
needs:
2024-02-16 16:02:46 -06:00
- api-tests
2022-08-12 02:32:30 -05:00
uses: './.github/workflows/ci-mutation-tests.yml'
with:
test-group: api
cli-mutation-tests:
needs:
- cli-tests
2022-08-12 02:32:30 -05:00
uses: './.github/workflows/ci-mutation-tests.yml'
with:
test-group: cli
upload-coverage:
needs:
- unit-tests
2024-02-16 16:02:46 -06:00
- api-tests
- cli-tests
- sqlite-db-tests
2022-08-01 10:13:34 -05:00
runs-on: ubuntu-22.04
strategy:
matrix:
2023-05-29 02:43:12 -05:00
php-version: ['8.2']
steps:
- name: Checkout code
2023-11-04 06:42:31 -05:00
uses: actions/checkout@v4
- name: Use PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: pcov
ini-values: pcov.directory=module
2023-12-19 04:13:13 -06:00
- uses: actions/download-artifact@v4
with:
path: build
- run: mv build/coverage-unit/coverage-unit.cov build/coverage-unit.cov
- run: mv build/coverage-db/coverage-db.cov build/coverage-db.cov
- run: mv build/coverage-api/coverage-api.cov build/coverage-api.cov
2022-08-10 10:13:21 -05:00
- run: mv build/coverage-cli/coverage-cli.cov build/coverage-cli.cov
2023-02-13 12:05:27 -06:00
- run: wget https://phar.phpunit.de/phpcov-9.0.0.phar
- run: php phpcov-9.0.0.phar merge build --clover build/clover.xml
2020-12-19 03:25:19 -06:00
- name: Publish coverage
uses: codecov/codecov-action@v1
with:
file: ./build/clover.xml
delete-artifacts:
needs:
- unit-mutation-tests
- db-mutation-tests
- api-mutation-tests
- cli-mutation-tests
- upload-coverage
2022-08-01 10:13:34 -05:00
runs-on: ubuntu-22.04
steps:
2023-04-12 12:13:35 -05:00
- uses: geekyeggo/delete-artifact@v2
with:
name: |
2023-04-12 12:13:35 -05:00
coverage-*