mirror of
https://github.com/danog/psalm-plugin-symfony.git
synced 2024-11-26 20:04:58 +01:00
Merge pull request #13 from bendavies/github-actions
Replace Travis with GitHub Actions
This commit is contained in:
commit
cbc2fb26c0
105
.github/workflows/integrate.yaml
vendored
Normal file
105
.github/workflows/integrate.yaml
vendored
Normal file
@ -0,0 +1,105 @@
|
||||
# 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=dir::$(composer config cache-files-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 highest dependencies from composer.json"
|
||||
if: matrix.dependencies == 'highest'
|
||||
run: composer install --no-interaction --no-progress --no-suggestc
|
||||
|
||||
- name: "Run vimeo/psalm"
|
||||
run: vendor/bin/psalm --config=psalm.xml --shepherd --show-info=false --stats --output-format=github
|
||||
|
||||
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 }}
|
||||
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 --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
|
||||
vendor/bin/codecept build run -v
|
27
.travis.yml
27
.travis.yml
@ -1,27 +0,0 @@
|
||||
language: php
|
||||
|
||||
php:
|
||||
- 7.1
|
||||
- 7.2
|
||||
- 7.3
|
||||
- 7.4
|
||||
|
||||
before_install:
|
||||
- phpenv config-rm xdebug.ini || true
|
||||
- composer validate
|
||||
|
||||
install:
|
||||
- composer install
|
||||
- if [[ "$DEPS" = 'high' ]]; then travis_retry composer $DEFAULT_COMPOSER_FLAGS update; fi
|
||||
- if [[ "$DEPS" = 'low' ]]; then travis_retry composer $DEFAULT_COMPOSER_FLAGS --prefer-lowest --prefer-stable update; fi
|
||||
- if [[ "$DEPS" = 'stable' ]]; then travis_retry composer $DEFAULT_COMPOSER_FLAGS --prefer-stable update; fi
|
||||
|
||||
script: composer check
|
||||
|
||||
env:
|
||||
matrix:
|
||||
- DEPS="low"
|
||||
- DEPS="high"
|
||||
- DEPS="stable"
|
||||
global:
|
||||
- DEFAULT_COMPOSER_FLAGS="--no-interaction --no-suggest --prefer-dist"
|
@ -1,6 +1,6 @@
|
||||
# Symfony Psalm Plugin
|
||||
|
||||
[![Build Status](https://travis-ci.org/psalm/psalm-plugin-symfony.svg?branch=master)](https://travis-ci.org/psalm/psalm-plugin-symfony)
|
||||
![Continuous Integration](https://github.com/psalm/psalm-plugin-symfony/workflows/Continuous%20Integration/badge.svg)
|
||||
|
||||
### Installation
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user