From 2a83359f1a2b208340b71677cc2cb00d9430e1e0 Mon Sep 17 00:00:00 2001 From: Daniel Badura Date: Mon, 5 Oct 2020 23:10:14 +0200 Subject: [PATCH 1/3] add workflows to be able to remove travis and appveyor later on --- .github/workflows/phpstan.yml | 61 +++++++++++++++++++++++++ .github/workflows/phpunit.yml | 64 +++++++++++++++++++++++++++ .github/workflows/psalm.yml | 61 +++++++++++++++++++++++++ .github/workflows/require-checker.yml | 59 ++++++++++++++++++++++++ 4 files changed, 245 insertions(+) create mode 100644 .github/workflows/phpstan.yml create mode 100644 .github/workflows/phpunit.yml create mode 100644 .github/workflows/psalm.yml create mode 100644 .github/workflows/require-checker.yml diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml new file mode 100644 index 00000000..0d49e2d5 --- /dev/null +++ b/.github/workflows/phpstan.yml @@ -0,0 +1,61 @@ +# https://help.github.com/en/categories/automating-your-workflow-with-github-actions + +name: "Static Analysis by PHPStan" + +on: + pull_request: + push: + branches: + - "master" + +jobs: + static-analysis-phpstan: + name: "Static Analysis by PHPStan" + + runs-on: ${{ matrix.os }} + + strategy: + matrix: + dependencies: + - "locked" + php-version: + - "7.2" + - "7.3" + - "7.4" + operating-system: + - "ubuntu-latest" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "pcov" + php-version: "${{ matrix.php-version }}" + ini-values: memory_limit=-1 + + - name: "Cache dependencies" + uses: "actions/cache@v2" + with: + path: | + ~/.composer/cache + vendor + key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" + restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" + + - name: "Install lowest dependencies" + if: ${{ matrix.dependencies == 'lowest' }} + run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest" + + - name: "Install highest dependencies" + if: ${{ matrix.dependencies == 'highest' }} + run: "composer update --no-interaction --no-progress --no-suggest" + + - name: "Install locked dependencies" + if: ${{ matrix.dependencies == 'locked' }} + run: "composer install --no-interaction --no-progress --no-suggest" + + - name: "PHPStan" + run: "vendor/bin/phpstan analyse -l 5 src --memory-limit=-1" diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml new file mode 100644 index 00000000..7d731faf --- /dev/null +++ b/.github/workflows/phpunit.yml @@ -0,0 +1,64 @@ +# https://help.github.com/en/categories/automating-your-workflow-with-github-actions + +name: "PHPUnit tests" + +on: + pull_request: + push: + branches: + - "master" + +jobs: + phpunit: + name: "PHPUnit tests" + + runs-on: ${{ matrix.os }} + + strategy: + matrix: + dependencies: + - "lowest" + - "highest" + - "locked" + php-version: + - "7.2" + - "7.3" + - "7.4" + operating-system: + - "ubuntu-latest" + - "windows-latest" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "pcov" + php-version: "${{ matrix.php-version }}" + ini-values: memory_limit=-1 + + - name: "Cache dependencies" + uses: "actions/cache@v2" + with: + path: | + ~/.composer/cache + vendor + key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" + restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" + + - name: "Install lowest dependencies" + if: ${{ matrix.dependencies == 'lowest' }} + run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest" + + - name: "Install highest dependencies" + if: ${{ matrix.dependencies == 'highest' }} + run: "composer update --no-interaction --no-progress --no-suggest" + + - name: "Install locked dependencies" + if: ${{ matrix.dependencies == 'locked' }} + run: "composer install --no-interaction --no-progress --no-suggest" + + - name: "Tests" + run: "vendor/bin/phpunit --coverage-clover=clover.xml --coverage-text" diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml new file mode 100644 index 00000000..81d628ed --- /dev/null +++ b/.github/workflows/psalm.yml @@ -0,0 +1,61 @@ +# https://help.github.com/en/categories/automating-your-workflow-with-github-actions + +name: "Static Analysis by Psalm" + +on: + pull_request: + push: + branches: + - "master" + +jobs: + static-analysis-psalm: + name: "Static Analysis by Psalm" + + runs-on: ${{ matrix.os }} + + strategy: + matrix: + dependencies: + - "locked" + php-version: + - "7.2" + - "7.3" + - "7.4" + operating-system: + - "ubuntu-latest" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "pcov" + php-version: "${{ matrix.php-version }}" + ini-values: memory_limit=-1 + + - name: "Cache dependencies" + uses: "actions/cache@v2" + with: + path: | + ~/.composer/cache + vendor + key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" + restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" + + - name: "Install lowest dependencies" + if: ${{ matrix.dependencies == 'lowest' }} + run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest" + + - name: "Install highest dependencies" + if: ${{ matrix.dependencies == 'highest' }} + run: "composer update --no-interaction --no-progress --no-suggest" + + - name: "Install locked dependencies" + if: ${{ matrix.dependencies == 'locked' }} + run: "composer install --no-interaction --no-progress --no-suggest" + + - name: "psalm" + run: "vendor/bin/psalm --shepherd --stats" diff --git a/.github/workflows/require-checker.yml b/.github/workflows/require-checker.yml new file mode 100644 index 00000000..666d6e09 --- /dev/null +++ b/.github/workflows/require-checker.yml @@ -0,0 +1,59 @@ +# https://help.github.com/en/categories/automating-your-workflow-with-github-actions + +name: "Static Analysis by Require-Checker" + +on: + pull_request: + push: + branches: + - "master" + +jobs: + static-analysis-require-checker: + name: "Static Analysis by Require-Checker" + + runs-on: ${{ matrix.os }} + + strategy: + matrix: + dependencies: + - "locked" + php-version: + - "7.4" + operating-system: + - "ubuntu-latest" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "pcov" + php-version: "${{ matrix.php-version }}" + ini-values: memory_limit=-1 + + - name: "Cache dependencies" + uses: "actions/cache@v2" + with: + path: | + ~/.composer/cache + vendor + key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" + restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}" + + - name: "Install lowest dependencies" + if: ${{ matrix.dependencies == 'lowest' }} + run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest" + + - name: "Install highest dependencies" + if: ${{ matrix.dependencies == 'highest' }} + run: "composer update --no-interaction --no-progress --no-suggest" + + - name: "Install locked dependencies" + if: ${{ matrix.dependencies == 'locked' }} + run: "composer install --no-interaction --no-progress --no-suggest" + + - name: "self-check" + run: "bin/composer-require-checker" From fac4806cc653086581560e74408afdaf8e29ea22 Mon Sep 17 00:00:00 2001 From: Daniel Badura Date: Mon, 5 Oct 2020 23:16:52 +0200 Subject: [PATCH 2/3] try to add master for pull requests --- .github/workflows/psalm.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml index 81d628ed..0198eabb 100644 --- a/.github/workflows/psalm.yml +++ b/.github/workflows/psalm.yml @@ -4,6 +4,8 @@ name: "Static Analysis by Psalm" on: pull_request: + branches: + - "master" push: branches: - "master" From a1cd7be50b8f6cf63beef668e8e5396ee68890ad Mon Sep 17 00:00:00 2001 From: Daniel Badura Date: Mon, 5 Oct 2020 23:20:47 +0200 Subject: [PATCH 3/3] fix typo in matrix property access --- .github/workflows/phpstan.yml | 2 +- .github/workflows/phpunit.yml | 2 +- .github/workflows/psalm.yml | 2 +- .github/workflows/require-checker.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 0d49e2d5..dd206cd3 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -12,7 +12,7 @@ jobs: static-analysis-phpstan: name: "Static Analysis by PHPStan" - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.operating-system }} strategy: matrix: diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 7d731faf..b9b317ad 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -12,7 +12,7 @@ jobs: phpunit: name: "PHPUnit tests" - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.operating-system }} strategy: matrix: diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml index 0198eabb..c305e8ef 100644 --- a/.github/workflows/psalm.yml +++ b/.github/workflows/psalm.yml @@ -14,7 +14,7 @@ jobs: static-analysis-psalm: name: "Static Analysis by Psalm" - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.operating-system }} strategy: matrix: diff --git a/.github/workflows/require-checker.yml b/.github/workflows/require-checker.yml index 666d6e09..30c78015 100644 --- a/.github/workflows/require-checker.yml +++ b/.github/workflows/require-checker.yml @@ -12,7 +12,7 @@ jobs: static-analysis-require-checker: name: "Static Analysis by Require-Checker" - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.operating-system }} strategy: matrix: