Skip to content
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

GH Actions: improve workflows #55

Merged
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
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/.github/ export-ignore
/appveyor.yml export-ignore
/box.json export-ignore
/doc export-ignore
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
tags:
- 'v*'
# Allow manually triggering the workflow.
workflow_dispatch:

jobs:
bundle:
Expand All @@ -19,7 +21,7 @@ jobs:
with:
php-version: 5.4
extensions: exif, phar, openssl
coverage: false
coverage: none
ini-values: phar.readonly=Off

- name: Install Box from GitHub
Expand All @@ -33,6 +35,8 @@ jobs:

- name: Install Composer dependencies
uses: ramsey/composer-install@v1
with:
composer-options: "--no-dev"

- name: Building binary...
run: box build -v
Expand Down Expand Up @@ -79,7 +83,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: false
coverage: none

- name: Run linter against codebase
run: php ./parallel-lint.phar src/
Expand Down
75 changes: 43 additions & 32 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
branches:
- develop
- master
# Allow manually triggering the workflow.
workflow_dispatch:

jobs:
lint:
Expand All @@ -15,9 +17,9 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
extensions: json
php-version: '7.4'
coverage: none
tools: cs2pr

- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -26,27 +28,11 @@ jobs:
uses: ramsey/composer-install@v1

- name: Run code sniffer
run: vendor/bin/phpcs
continue-on-error: true
run: vendor/bin/phpcs --report-full --report-checkstyle=./phpcs-report.xml

test:
name: Run unit tests
runs-on: ubuntu-latest

steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 5.4
extensions: json, tokenizer

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

- name: Install Composer dependencies
uses: ramsey/composer-install@v1

- name: Run tests
run: composer test
- name: Show PHPCS results in PR
run: cs2pr ./phpcs-report.xml

bundle:
name: Bundle binary
Expand All @@ -61,7 +47,7 @@ jobs:
with:
php-version: 5.4
extensions: exif, phar, openssl
coverage: false
coverage: none
ini-values: phar.readonly=Off

- name: Install Box from GitHub
Expand All @@ -75,6 +61,8 @@ jobs:

- name: Install Composer dependencies
uses: ramsey/composer-install@v1
with:
composer-options: "--no-dev"

- name: Building binary...
run: box build -v
Expand All @@ -84,8 +72,8 @@ jobs:
name: parallel-lint-phar
path: ./parallel-lint.phar

verify-bundle:
name: Validate binary on PHP ${{ matrix.php }}
test:
name: Run tests on PHP ${{ matrix.php }}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental == true }}
needs:
Expand Down Expand Up @@ -113,15 +101,38 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- uses: actions/download-artifact@v2
with:
name: parallel-lint-phar

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: false
coverage: none

# Remove PHPCS as it has a minimum PHP requirements of PHP 5.4 and would block install on PHP 5.3.
- name: 'Composer: remove PHPCS'
if: ${{ matrix.php < 5.4 }}
run: composer remove --dev squizlabs/php_codesniffer --no-update

- name: Install Composer dependencies
uses: ramsey/composer-install@v1

- name: 'Integration test 1 - linting own code, no colors'
continue-on-error: true
run: ./parallel-lint --exclude vendor --exclude tests/examples --no-colors .

- name: 'Integration test 2 - linting own code'
run: ./parallel-lint --exclude vendor --exclude tests/examples .

- name: 'Run unit tests PHP 5.4, 5.5'
if: ${{ matrix.php < 5.6 }}
run: composer testphp5

- name: 'Run unit tests PHP >= 5.6'
if: ${{ matrix.php >= 5.6 }}
run: composer test

- uses: actions/download-artifact@v2
with:
name: parallel-lint-phar

- name: Run linter against codebase
run: php ./parallel-lint.phar src/
- name: Run linter against codebase using the phar
run: php ./parallel-lint.phar --exclude vendor --exclude tests/examples .
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# PHP Parallel Lint

[![Downloads this Month](https://img.shields.io/packagist/dm/php-parallel-lint/php-parallel-lint.svg)](https://packagist.org/packages/php-parallel-lint/php-parallel-lint)
[![Build Status](https://travis-ci.org/php-parallel-lint/PHP-Parallel-Lint.svg?branch=master)](https://travis-ci.org/php-parallel-lint/PHP-Parallel-Lint)
[![Build Status](https://github.com/php-parallel-lint/PHP-Parallel-Lint/actions/workflows/test.yml/badge.svg)](https://github.com/php-parallel-lint/PHP-Parallel-Lint/actions/workflows/test.yml)
[![License](https://poser.pugx.org/php-parallel-lint/php-parallel-lint/license.svg)](https://packagist.org/packages/php-parallel-lint/php-parallel-lint)

This application checks syntax of PHP files in parallel.
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"parallel-lint"
],
"scripts": {
"test": "@php vendor/bin/tester -p php tests"
"test": "@php vendor/bin/tester -C -p php tests",
"testphp5": "@php vendor/bin/tester -p php tests"
},
"scripts-descriptions": {
"test": "Run all tests!"
Expand Down