mirror of
https://github.com/danog/psalm-plugin-symfony.git
synced 2024-12-02 17:37:52 +01:00
140 lines
4.1 KiB
YAML
140 lines
4.1 KiB
YAML
name: "Integrate"
|
|
|
|
on:
|
|
pull_request: ~
|
|
push:
|
|
branches:
|
|
- master
|
|
schedule:
|
|
- cron: "0 10 * * *"
|
|
|
|
jobs:
|
|
static-code-analysis:
|
|
name: "Static Code Analysis"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
php-version:
|
|
- 7.3
|
|
- 7.4
|
|
- 8.0
|
|
|
|
dependencies:
|
|
- highest
|
|
- lowest
|
|
|
|
exclude:
|
|
- php-version: 7.3
|
|
dependencies: lowest
|
|
- php-version: 7.4
|
|
dependencies: lowest
|
|
|
|
steps:
|
|
- name: "Checkout"
|
|
uses: actions/checkout@v2
|
|
|
|
- name: "Install PHP with extensions"
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
coverage: none
|
|
php-version: ${{ matrix.php-version }}
|
|
|
|
- name: "Determine composer cache directory"
|
|
id: determine-composer-cache-directory
|
|
run: echo "::set-output name=directory::$(composer config cache-dir)"
|
|
|
|
- name: "Cache dependencies installed with composer"
|
|
uses: actions/cache@v1
|
|
with:
|
|
path: ${{ steps.determine-composer-cache-directory.outputs.directory }}
|
|
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.json') }}
|
|
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
|
|
|
|
- name: "Install lowest dependencies from composer.json"
|
|
if: matrix.dependencies == 'lowest'
|
|
run: composer update --no-interaction --no-progress --prefer-lowest
|
|
|
|
- name: "Install highest dependencies from composer.json"
|
|
if: matrix.dependencies == 'highest'
|
|
run: composer install --no-interaction --no-progress
|
|
|
|
- name: "Cache cache directory for vimeo/psalm"
|
|
uses: actions/cache@v1
|
|
with:
|
|
path: .build/psalm
|
|
key: php-${{ matrix.php-version }}-psalm-${{ github.sha }}
|
|
restore-keys: php-${{ matrix.php-version }}-psalm-
|
|
|
|
- name: "Run vimeo/psalm"
|
|
run: vendor/bin/psalm --find-dead-code --find-unused-psalm-suppress --shepherd --show-info=false --stats --output-format=github
|
|
|
|
tests:
|
|
name: "Tests"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
php-version:
|
|
- 7.1
|
|
- 7.2
|
|
- 7.3
|
|
- 7.4
|
|
- 8.0
|
|
|
|
symfony-version:
|
|
- 3
|
|
- 4
|
|
- 5
|
|
|
|
exclude:
|
|
- php-version: 7.1
|
|
symfony-version: 5
|
|
- php-version: 8.0
|
|
symfony-version: 3
|
|
|
|
steps:
|
|
- name: "Checkout"
|
|
uses: actions/checkout@v2
|
|
|
|
- name: "Install PHP with extensions"
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
coverage: none
|
|
php-version: ${{ matrix.php-version }}
|
|
tools: flex
|
|
|
|
- name: "Determine composer cache directory"
|
|
id: determine-composer-cache-directory
|
|
run: echo "::set-output name=directory::$(composer config cache-dir)"
|
|
|
|
- name: "Cache dependencies installed with composer"
|
|
uses: actions/cache@v1
|
|
with:
|
|
path: ${{ steps.determine-composer-cache-directory.outputs.directory }}
|
|
key: php-${{ matrix.php-version }}-composer-${{ matrix.symfony-version }}-${{ hashFiles('composer.json') }}
|
|
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.symfony-version }}-
|
|
|
|
- name: "Restrict symfony dependencies to the correct version"
|
|
run: composer config extra.symfony.require ${{ matrix.symfony-version }}.*
|
|
|
|
- name: "Update dependencies with restricted symfony version"
|
|
run: composer update --prefer-stable --no-interaction --no-progress
|
|
|
|
- name: "Run unit tests with phpunit"
|
|
run: vendor/bin/phpunit --configuration=phpunit.xml
|
|
|
|
- name: "Build acceptance tests with codeception"
|
|
run: vendor/bin/codecept build
|
|
|
|
- name: "Run acceptance tests with codeception"
|
|
run: vendor/bin/codecept run -v -g symfony-common -g symfony-${{ matrix.symfony-version }}
|
|
|
|
- name: "Run acceptance tests with codeception PHP8 only tests"
|
|
run: vendor/bin/codecept run -v -g php-8
|
|
if: matrix.php-version == '8.0'
|