psalm-plugin-symfony/.github/workflows/integrate.yaml

112 lines
3.4 KiB
YAML
Raw Normal View History

2020-03-13 16:54:07 +01:00
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
name: "Integrate"
on:
pull_request: ~
push:
branches:
- master
jobs:
static-code-analysis:
name: "Static Code Analysis"
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- 7.4
dependencies:
- highest
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)"
2020-03-13 16:54:07 +01:00
- name: "Cache dependencies installed with composer"
uses: actions/cache@v1
with:
path: ${{ steps.determine-composer-cache-directory.outputs.directory }}
2020-03-18 12:12:52 +01:00
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.json') }}
2020-03-13 16:54:07 +01:00
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
- name: "Install highest dependencies from composer.json"
if: matrix.dependencies == 'highest'
2020-03-13 17:12:47 +01:00
run: composer install --no-interaction --no-progress --no-suggest
2020-03-13 16:54:07 +01:00
- 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-
2020-03-13 16:54:07 +01:00
- name: "Run vimeo/psalm"
run: vendor/bin/psalm --config=psalm.xml --diff --diff-methods --shepherd --show-info=false --stats --output-format=github
2020-03-13 16:54:07 +01:00
tests:
name: "Tests"
runs-on: ubuntu-latest
strategy:
matrix:
php-version:
- 7.1
- 7.2
- 7.3
- 7.4
dependencies:
- lowest
- highest
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 }}
2020-03-18 12:12:52 +01:00
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.json') }}
2020-03-13 16:54:07 +01:00
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 --no-suggest --prefer-lowest
- name: "Install highest dependencies from composer.json"
if: matrix.dependencies == 'highest'
run: composer update --no-interaction --no-progress --no-suggest
- name: "Run unit tests with phpunit"
run: vendor/bin/phpunit --configuration=phpunit.xml
- name: "Run acceptance tests with codeception"
run: |
vendor/bin/codecept build
2020-03-13 17:13:45 +01:00
vendor/bin/codecept run -v