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

[CI] Run PHPunit #1

Merged
merged 12 commits into from
Mar 19, 2021
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
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI

on:
pull_request:
paths:
- src/**

jobs:
matrix:
name: Find packages
runs-on: Ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 50

- name: Find packages
id: find-packages
run: |
echo "::set-output name=list::$(git diff --name-only ${{github.event.pull_request.head.sha}} ${{github.event.pull_request.base.sha}} | grep src/ | cut -d / -f 2 | sort | uniq | jq -R -s -c 'split("\n")[:-1]')"

outputs:
# Make the outputs accessible outside this job
list: ${{ steps.find-packages.outputs.list }}

build:
needs: matrix
name: Test
runs-on: Ubuntu-20.04
strategy:
fail-fast: false
matrix:
package: ${{ fromJson(needs.matrix.outputs.list) }}
php: [ '7.4', '8.0' ]
strategy: ['default', 'lowest' ]

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

- run: cd src/${{ matrix.package }}

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

- name: Download dependencies
uses: ramsey/composer-install@v1
with:
composer-options: --no-interaction --prefer-dist --optimize-autoloader ${{ matrix.strategy == 'lowest' && '--prefer-lowest' || '' }}

- name: Run tests
run: |
echo ::group::Install
./vendor/bin/simple-phpunit install
echo ::endgroup::
./vendor/bin/simple-phpunit

32 changes: 32 additions & 0 deletions .github/workflows/root.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Root

on:
pull_request: ~

jobs:

test:
name: Test
runs-on: Ubuntu-20.04

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

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
coverage: none

- name: Download dependencies
uses: ramsey/composer-install@v1
with:
composer-options: --no-interaction --prefer-dist --optimize-autoloader

- name: Run tests
run: |
echo ::group::Install
./vendor/bin/simple-phpunit install
echo ::endgroup::
./vendor/bin/simple-phpunit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/vendor/
.php_cs.cache
.phpunit.result.cache
composer.lock
21 changes: 12 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
{
"name": "runtime/runtime",
"description": "Includes all runtimes",
"type": "library",
"require": {
"symfony/runtime": "5.x-dev",
"nyholm/psr7": "^1.3",
"nyholm/psr7-server": "^1.0",
"laminas/laminas-httphandlerrunner": "^1.2"
},
"description": "Includes all runtimes",
"license": "MIT",
"authors": [
{
"name": "Nyholm",
"email": "[email protected]"
}
],
"minimum-stability": "dev",
"require": {
"laminas/laminas-httphandlerrunner": "^1.2",
"nyholm/psr7": "^1.3",
"nyholm/psr7-server": "^1.0",
"symfony/runtime": "5.x-dev"
},
"require-dev": {
"symfony/phpunit-bridge": "5.x-dev"
},
"autoload": {
"psr-4": {
"Runtime\\PsrNyholmLaminas\\": "src/psr-nyholm-laminas/src"
}
}
},
"minimum-stability": "dev"
}
Loading