shlink/.github/workflows/ci.yml

103 lines
2.4 KiB
YAML
Raw Normal View History

name: Continuous integration
on:
pull_request:
paths-ignore:
- 'LICENSE'
- '.*'
- '*.md'
- '*.xml'
- '*.yml*'
- '*.neon'
push:
branches:
- main
- develop
2022-01-25 13:39:31 -06:00
- 2.x
paths-ignore:
- 'LICENSE'
- '.*'
- '*.md'
- '*.xml'
- '*.yml*'
- '*.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
db-tests:
strategy:
matrix:
platform: ['sqlite:ci', 'mysql', 'maria', 'postgres', 'ms']
uses: './.github/workflows/ci-db-tests.yml'
with:
platform: ${{ matrix.platform }}
upload-coverage:
needs:
- unit-tests
2024-02-16 16:02:46 -06:00
- api-tests
- cli-tests
- 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: './.github/actions/ci-setup'
with:
php-version: ${{ matrix.php-version }}
extensions-cache-key: tests-extensions-${{ matrix.php-version }}
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
- run: vendor/bin/phpcov merge build --clover build/clover.xml
2020-12-19 03:25:19 -06:00
- name: Publish coverage
uses: codecov/codecov-action@v4
2020-12-19 03:25:19 -06:00
with:
file: ./build/clover.xml
delete-artifacts:
needs:
- 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-*