Skip to content

ci: Add dependabot #132

ci: Add dependabot

ci: Add dependabot #132

Workflow file for this run

name: CI
on:
pull_request:
push:
branches: [ master, main ]
schedule:
- cron: '45 4 1 * *'
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php:
- '8.1'
- '8.2'
symfony-versions: [false]
include:
- description: 'Symfony 5.4'
symfony-versions: 5.4.*
- description: 'Symfony 6.3'
symfony-versions: 6.3.*
name: PHP ${{ matrix.php }} ${{ matrix.description }}
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/.composer/cache/files
key: ${{ matrix.php }}-${{ matrix.symfony-versions }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- name: Install dependencies
run: composer install
- name: Setup Symfony version
run: |
composer bin symfony require "symfony/framework-bundle:${{ matrix.symfony-versions }}" --no-update
composer bin symfony require "symfony/serializer:${{ matrix.symfony-versions }}" --no-update
if: matrix.symfony-versions
- name: Install bin dependencies
run: composer bin symfony install
if: matrix.symfony-versions
- name: Run PHPUnit tests
run: XDEBUG_MODE=coverage bin/phpunit --coverage-clover=coverage.xml
if: false == matrix.symfony-versions
- name: Run Symfony tests
run: bin/phpunit --configuration phpunit_symfony.xml.dist
if: matrix.symfony-versions
- name: Run codecov
uses: codecov/codecov-action@v1
with:
file: './coverage.xml'
fail_ci_if_error: true
if: false == matrix.symfony-versions
# This is a "trick", a meta task which does not change, and we can use in
# the protected branch rules as opposed to the tests one above which
# may change regularly.
validate-tests:
name: Tests status
runs-on: ubuntu-latest
needs:
- tests
if: always()
steps:
- name: Successful run
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Failing run
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1