Skip to content

Commit

Permalink
Merge pull request #36 from boesing/qa/laminas-continous-integration
Browse files Browse the repository at this point in the history
  • Loading branch information
boesing authored Mar 14, 2021
2 parents 99d56ca + fae42c4 commit 56a8992
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 93 deletions.
111 changes: 22 additions & 89 deletions .github/workflows/continues-integration.yml
Original file line number Diff line number Diff line change
@@ -1,98 +1,31 @@
name: CI Pipeline
name: "Continuous Integration"

on:
pull_request:
push:
branches:
- 'refs/pull/*'

jobs:

coding-standard:

name: "Coding Standard"

runs-on: "${{ matrix.operating-system }}"

strategy:
fail-fast: true
matrix:
operating-system: ['ubuntu-latest']
php-version: ['7.4']

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: "composer:v2"

- name: Install dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Check codestyle
run: vendor/bin/phpcs -s

static-analysis:
name: "Static Analysis"
runs-on: "${{ matrix.operating-system }}"

strategy:
fail-fast: true
matrix:
php-version: ['7.4']
operating-system: ['ubuntu-latest']

matrix:
name: Generate job matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: "composer:v2"

- name: Install dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Analyze code with static-analysis
run: vendor/bin/psalm --shepherd

unit-tests:
name: "Unit Tests"

runs-on: "${{ matrix.operating-system }}"
continue-on-error: "${{ matrix.experimental }}"

- name: Gather CI configuration
id: matrix
uses: laminas/laminas-ci-matrix-action@v1

qa:
name: QA Checks
needs: [matrix]
runs-on: ${{ matrix.operatingSystem }}
strategy:
fail-fast: false
matrix:
php-version: ["7.3", "7.4", "8.0"]
operating-system: ["ubuntu-latest", "macos-latest"]
experimental: [false]
composer-dependencies: ['lowest', 'latest']

matrix: ${{ fromJSON(needs.matrix.outputs.matrix) }}
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: "composer:v2"

- name: Install dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader ${{ matrix.composer-options }}

- name: Ensure lowest dependencies
if: ${{ matrix.composer-dependencies == 'lowest' }}
run: composer update --no-progress --prefer-dist --prefer-lowest ${{ matrix.composer-options }}

- name: Execute tests
run: vendor/bin/phpunit --colors=always --coverage-clover=build/coverage-clover.xml --coverage-xml=build/coverage-xml --log-junit build/coverage-junit.xml --coverage-text

- name: "Publish Coverage Report to Codecov"
uses: "codecov/codecov-action@v1"
- name: ${{ matrix.name }}
uses: laminas/laminas-continuous-integration-action@v1
with:
file: ./build/coverage-clover.xml
job: ${{ matrix.job }}
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@
"doctrine/coding-standard": "^8.1",
"lcobucci/clock": "^1.2",
"phpunit/phpunit": "^9.2",
"psalm/plugin-phpunit": "^0.12.2",
"vimeo/psalm": "^4.0"
"psalm/plugin-phpunit": "^0.15.1",
"vimeo/psalm": "^4.6"
},
"conflict": {
"vimeo/psalm": "4.6.2"
},
"config": {
"preferred-install": "dist",
Expand All @@ -29,8 +32,6 @@
"Boesing\\TypedArrays\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"cs-check": "phpcs",
"cs-fix": "phpcbf",
Expand Down

0 comments on commit 56a8992

Please sign in to comment.