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

Added GitHub Actions for testing #20

Merged
merged 1 commit into from
Feb 4, 2022
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
@@ -1,5 +1,5 @@
/.github export-ignore
/tests export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.travis.yml export-ignore
phpunit.xml.dist export-ignore
54 changes: 54 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Run unit tests

on:
pull_request:
push:
# Allow manually triggering the workflow.
workflow_dispatch:

# Cancels all previous workflow runs for the same branch that have not yet completed.
concurrency:
# The concurrency group contains the workflow name and the branch name.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Run tests on PHP ${{ matrix.php }}
runs-on: ubuntu-latest

strategy:
matrix:
php:
- '5.4'
- '5.5'
- '5.6'
- '7.0'
- '7.1'
- '7.2'
- '7.3'
- '7.4'
Copy link
Collaborator

Choose a reason for hiding this comment

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

What about adding PHP 8.0, 8.1 and 8.2 ?

For PHP 8.2, you could then change the continue-on-error: ${{ matrix.experimental == true }} setting to: continue-on-error: ${{ matrix.php == '8.2' }} to allow builds against PHP 8.2 to fail while it is still under development.

Copy link
Member Author

Choose a reason for hiding this comment

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

PHP 8.x will be added in next step. I want convert 1:1 state previous TravisCI state

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

That's fair enough. I'm actually tempted to suggest abandoning this repo in favour of a PHP_CodeSniffer sniff for the same at some point in the future. Should make PHP cross-version support easier ;-)


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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: zend.assertions=1, error_reporting=-1, display_errors=On
coverage: none
jrfnl marked this conversation as resolved.
Show resolved Hide resolved
tools: cs2pr

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

- name: 'Linting code'
run: ./vendor/bin/parallel-lint --exclude vendor . --exclude git . --checkstyle | cs2pr

- name: 'Run unit tests'
run: ./vendor/bin/phpunit

- name: 'Check var dump on own code'
run: ./var-dump-check src
38 changes: 0 additions & 38 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
Expand Up @@ -79,6 +79,6 @@ or setting for ANT:

------

[![Build Status](https://travis-ci.org/php-parallel-lint/PHP-Var-Dump-Check.svg?branch=master)](https://travis-ci.org/php-parallel-lint/PHP-Var-Dump-Check)
[![Build Status](https://github.com/php-parallel-lint/PHP-Var-Dump-Check/actions/workflows/test.yml/badge.svg)](https://github.com/php-parallel-lint/PHP-Var-Dump-Check/actions/workflows/test.yml)
[![Downloads this Month](https://img.shields.io/packagist/dm/php-parallel-lint/php-var-dump-check.svg)](https://packagist.org/packages/php-parallel-lint/php-var-dump-check)
[![Latest stable](https://img.shields.io/packagist/v/php-parallel-lint/php-var-dump-check.svg)](https://packagist.org/packages/php-parallel-lint/php-var-dump-check)