-
Notifications
You must be signed in to change notification settings - Fork 27
Normalize ci #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Normalize ci #51
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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" | ||
|
|
||
| strategy: | ||
| matrix: | ||
|
|
@@ -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" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, we don't have one.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" | ||
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.