Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 70 additions & 49 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

name: "Continuous Integration"

on:
pull_request:
push:
branches:
- "master"

jobs:

unit-tests:
name: "Unit tests"

runs-on: "ubuntu-18.04"
runs-on: "ubuntu-latest"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i find this very risky, but maybe since stuff runs inside docker, does not matter that much

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woops I noticed this comment after merging 😅
Yeah I find it risky too, but a little (deps are fixed). cc @bendavies @localheinz in case you have an opinion to share on this.


strategy:
matrix:
Expand All @@ -23,101 +19,126 @@ jobs:
- "7.4"

steps:
- name: "Checkout"
uses: "actions/checkout@v2.0.0"
- name: "Checkout code"
uses: "actions/checkout@v2"

- name: "Install PHP"
uses: "shivammathur/setup-php@1.8.1"
uses: "shivammathur/setup-php@v2"
with:
coverage: "pcov"
coverage: "none"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this mean that we do not have a coverage metric for this library?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we don't have one.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

php-version: "${{ matrix.php-version }}"
tools: "cs2pr"

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v1.0.3"
uses: "actions/cache@v1"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"

- name: "Install dependencies with composer"
run: "composer update --no-interaction --no-progress --no-suggest"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Test fixes"
run: "vendor/bin/phpunit --coverage-text"

coding-standards:
name: "Coding Standards"

runs-on: "ubuntu-18.04"
static-analysis-phpstan:
name: "Static Analysis with PHPStan"
runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.2"
- "7.4"

steps:
- name: "Checkout"
uses: "actions/checkout@v2.0.0"
- name: "Checkout code"
uses: "actions/checkout@v2"

- name: "Install PHP"
uses: "shivammathur/setup-php@1.8.1"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
extensions: mbstring
tools: cs2pr

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v1.0.3"
uses: "actions/cache@v1"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('composer.json') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"

- name: "Install dependencies with composer"
run: "composer update --no-interaction --no-progress --no-suggest"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Run squizlabs/php_codesniffer"
run: "vendor/bin/phpcs"
- name: "Run a static analysis with phpstan/phpstan"
run: "vendor/bin/phpstan analyse --error-format=checkstyle | cs2pr"


static-analysis-psalm:
name: "Static Analysis with Psalm"
runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.4"

static-analysis-phpstan:
name: Static Analysis with PHPStan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: PHPStan
uses: "docker://oskarstark/phpstan-ga"
env:
REQUIRE_DEV: 'true'
- name: "Checkout code"
uses: "actions/checkout@v2"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
args: analyse
coverage: "none"
php-version: "${{ matrix.php-version }}"

static-analysis-psalm:
name: Static Analysis with Psalm
runs-on: ubuntu-latest
- name: "Cache dependencies installed with composer"
uses: "actions/cache@v1"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"

- name: "Install dependencies with composer"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Run a static analysis with vimeo/psalm"
run: "vendor/bin/psalm --show-info=false --stats --output-format=github --threads=4"

coding-standards:
name: "Coding Standards"
runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.2"
- "7.4"

steps:
- name: Checkout code
uses: actions/checkout@v2
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Install PHP"
uses: "shivammathur/setup-php@1.8.1"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
tools: "cs2pr"

- name: "Cache dependencies installed with composer"
uses: "actions/cache@v1.0.3"
uses: "actions/cache@v1"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('composer.json') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-"
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-version }}-composer-locked-"

- name: "Install dependencies with composer"
run: "composer update --no-interaction --no-progress --no-suggest"
run: "composer install --no-interaction --no-progress --no-suggest"

- name: Psalm
run: "vendor/bin/psalm"
# Remove -q when updating to phpcs v4
- name: "Run squizlabs/php_codesniffer"
run: "vendor/bin/phpcs -q --no-colors --report=checkstyle | cs2pr"
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"doctrine/coding-standard": "^7.0",
"phpstan/phpstan": "^0.12.18",
"phpunit/phpunit": "^8.0",
"psalm/plugin-phpunit": "^0.10.0",
"vimeo/psalm": "^3.10"
},
"authors": [
Expand Down
Loading