Skip to content

Commit

Permalink
Migrate CI from travis to GH action for 2.x (#1475)
Browse files Browse the repository at this point in the history
  • Loading branch information
koriym committed Sep 6, 2023
1 parent f144351 commit 261a0dd
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 27 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: build

on:
push:
pull_request:
workflow_dispatch:

jobs:
test:
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: true
matrix:
operating-system: [ ubuntu-latest ]
php: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ]
dependencies: [ 'lowest', 'highest' ]

name: PHP ${{ matrix.php }} on ${{ matrix.operating-system }} with ${{ matrix.dependencies }} dependencies

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

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

- name: Composer install
uses: ramsey/composer-install@v2
with:
dependency-versions: ${{ matrix.dependencies }}
composer-options: "${{ matrix.composer-options }}"

- name: PHPUnit Tests
run: bin/phpunit --configuration phpunit.xml.dist
25 changes: 25 additions & 0 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: code-style

on:
push:
pull_request:
workflow_dispatch:

jobs:
php-cs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Checkout repository

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'

- uses: ramsey/composer-install@v2
with:
dependency-versions: 'highest'

- name: Check Code Style
run: ./bin/phpcs -p --extensions=php --standard=PSR2 --error-severity=1 --warning-severity=0 ./src ./tests;
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
"require-dev": {
"squizlabs/php_codesniffer": ">=2.7",
"phpunit/phpunit": "^8 || ^9"
"phpunit/phpunit": "^8.5.21 || ^9"
},
"autoload-dev": {
"psr-4": {
Expand Down

0 comments on commit 261a0dd

Please sign in to comment.