Skip to content

Commit

Permalink
Merge pull request #29 from Elendev/firstTests
Browse files Browse the repository at this point in the history
Matrix testing with better version specification
  • Loading branch information
Elendev authored May 19, 2020
2 parents 3aeff07 + 8f42823 commit 6e92647
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .github/actions/php-7.3/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM php:7.3-cli

RUN apt-get update && apt-get install -y libz-dev

RUN docker-php-ext-install zip
5 changes: 5 additions & 0 deletions .github/actions/php-7.4/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM php:7.4-cli

RUN apt-get update && apt-get install -y libz-dev

RUN docker-php-ext-install zip
44 changes: 34 additions & 10 deletions .github/workflows/testing-and-cs.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: Testing and Code Quality
on: [push, pull_request]
on: push

jobs:

install:
name: Composer install, test and code sniff
PHPCS:
name: Code Sniffing
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -13,11 +12,36 @@ jobs:
uses: docker://composer:1.9
with:
args: install
- name: 'PHPUnit testing'
uses: ./.github/actions/php-7.2
with:
args: vendor/bin/phpunit tests
- name: 'Code sniffing'
uses: ./.github/actions/php-7.2
uses: docker://php:7.2-cli
with:
args: "vendor/bin/php-cs-fixer fix src --dry-run"

PHPUnit:
name: PHPUnit testing
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [7.2, 7.3, 7.4]
composer: [1.6, 1.7, 1.8, 1.9, 1.10]
symfony: [^3.0, ^4.0, ^5.0]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: 'Unit testing'
uses: shivammathur/setup-php@v2
with:
args: "vendor/bin/php-cs-fixer fix src --dry-run"
php-version: ${{ matrix.php }}
tools: composer:${{ matrix.composer }}
- run: composer require "symfony/finder:${{ matrix.symfony }}" "symfony/filesystem:${{ matrix.symfony }}"
- run: composer install
- run: vendor/bin/phpunit tests

BuildDone:
name: PHP full build
needs: [PHPCS, PHPUnit]
runs-on: ubuntu-latest
steps:
- run: "echo build done"

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"psr-4": {"Elendev\\NexusComposerPush\\": "src/"}
},
"require": {
"php": "^5.6 || ^7.0",
"php": ">=7.2 <7.5",
"ext-curl": "*",
"ext-zip": "*",
"composer-plugin-api": "^1.1",
Expand Down

0 comments on commit 6e92647

Please sign in to comment.