Skip to content

Commit

Permalink
Merge pull request #1 from robvanaarle/github-actions
Browse files Browse the repository at this point in the history
Github Action workflows: Unit tests and code style
  • Loading branch information
robvanaarle authored Jun 9, 2022
2 parents a8820e5 + b9e36e2 commit ecb6c9a
Show file tree
Hide file tree
Showing 9 changed files with 139 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Code style
on:
push:
pull_request:
types: [closed]
branches: [main]

jobs:
phpcs:
name: PHP CodeSniffer
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install dependencies
uses: php-actions/composer@v6

- name: Check code style
run: vendor/bin/phpcs
13 changes: 13 additions & 0 deletions .github/workflows/test-php-70.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Test - PHP 7.0
on:
push:
pull_request:
types: [closed]
branches: [main]

jobs:
call-test:
uses: ./.github/workflows/test.yml
with:
php_version: 7.0
phpunit_version: 6.5.14
13 changes: 13 additions & 0 deletions .github/workflows/test-php-71.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Test - PHP 7.1
on:
push:
pull_request:
types: [closed]
branches: [main]

jobs:
call-test:
uses: ./.github/workflows/test.yml
with:
php_version: 7.1
phpunit_version: 7.5.20
13 changes: 13 additions & 0 deletions .github/workflows/test-php-72.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Test - PHP 7.2
on:
push:
pull_request:
types: [closed]
branches: [main]

jobs:
call-test:
uses: ./.github/workflows/test.yml
with:
php_version: 7.2
phpunit_version: 8.5.26
13 changes: 13 additions & 0 deletions .github/workflows/test-php-73.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Test - PHP 7.3
on:
push:
pull_request:
types: [closed]
branches: [main]

jobs:
call-test:
uses: ./.github/workflows/test.yml
with:
php_version: 7.3
phpunit_version: 9.5.20
13 changes: 13 additions & 0 deletions .github/workflows/test-php-74.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Test - PHP 7.4
on:
push:
pull_request:
types: [closed]
branches: [main]

jobs:
call-test:
uses: ./.github/workflows/test.yml
with:
php_version: 7.4
phpunit_version: 9.5.20
13 changes: 13 additions & 0 deletions .github/workflows/test-php-80.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Test - PHP 8.0
on:
push:
pull_request:
types: [closed]
branches: [main]

jobs:
call-test:
uses: ./.github/workflows/test.yml
with:
php_version: 8.0
phpunit_version: 9.5.20
13 changes: 13 additions & 0 deletions .github/workflows/test-php-81.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Test - PHP 8.1
on:
push:
pull_request:
types: [closed]
branches: [main]

jobs:
call-test:
uses: ./.github/workflows/test.yml
with:
php_version: 8.1
phpunit_version: 9.5.20
28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Test

on:
workflow_call:
inputs:
phpunit_version:
required: true
type: string
php_version:
required: true
type: string

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install dependencies
uses: php-actions/composer@v6

- name: Run PHPUnit tests
uses: php-actions/phpunit@v3
with:
php_version: ${{ inputs.php_version }}
version: ${{ inputs.phpunit_version }}

0 comments on commit ecb6c9a

Please sign in to comment.