From d54a30ead0bcb7a249645e19717414de8171d0f0 Mon Sep 17 00:00:00 2001 From: jawira Date: Sat, 27 Jan 2024 11:22:18 +0100 Subject: [PATCH] test: Use github actions to run tests --- .github/workflows/qa.yaml | 55 +++++++++++++++++++++++++++++++++++++++ README.md | 5 ++-- build.xml | 13 ++++++++- docs/images/build.svg | 2 +- 4 files changed, 70 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/qa.yaml diff --git a/.github/workflows/qa.yaml b/.github/workflows/qa.yaml new file mode 100644 index 0000000..c1847dd --- /dev/null +++ b/.github/workflows/qa.yaml @@ -0,0 +1,55 @@ +name: Tests + +on: + pull_request: + push: + branches: + - master + +jobs: + qa: + strategy: + matrix: + php: [ '8.0','8.1','8.2','8.3' ] + runs-on: ubuntu-22.04 + timeout-minutes: 5 + steps: + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: mbstring, intl + coverage: xdebug + tools: composer:v2 + + - uses: actions/checkout@v3 + + - name: Download phing + run: mkdir bin && curl -L -C - -s -S -o bin/phing https://github.com/phingofficial/phing/releases/download/3.0.0-rc6/phing-3.0.0-RC6.phar && chmod +x bin/phing + + - name: composer:validate + run: bin/phing composer:validate + + - name: composer:install + run: bin/phing composer:install + + - name: php:lint + run: bin/phing php:lint + + - name: cs:fix + run: bin/phing cs:fix + + - name: cs:check + run: bin/phing cs:check + + - name: phpstan:analyze + run: bin/phing phpstan:analyze + + - uses: isbang/compose-action@v1.5.1 + with: + compose-file: "./compose.yaml" + down-flags: "--volumes" + + - name: phpunit:run + run: bin/phing phpunit:run diff --git a/README.md b/README.md index 6da2a35..ecc6d30 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,8 @@ **📐 Takes a DoctrineORM connection and generates a database diagram in .puml format.** [![Latest Stable Version](http://poser.pugx.org/jawira/db-draw/v)](https://packagist.org/packages/jawira/db-draw) -[![.gitattributes](http://poser.pugx.org/jawira/db-draw/gitattributes)](https://packagist.org/packages/jawira/db-draw) -[![composer.lock](http://poser.pugx.org/jawira/db-draw/composerlock)](https://packagist.org/packages/jawira/db-draw) -[![License](http://poser.pugx.org/jawira/db-draw/license)](https://packagist.org/packages/jawira/db-draw) +[![PHP Version Require](http://poser.pugx.org/jawira/db-draw/require/php)](https://packagist.org/packages/jawira/db-draw) +![Github Actions](https://github.com/jawira/db-draw/actions/workflows/qa.yaml/badge.svg) ## Installing diff --git a/build.xml b/build.xml index 4a41d24..67cb2c0 100644 --- a/build.xml +++ b/build.xml @@ -6,7 +6,7 @@ + depends="composer:validate,composer:normalize,php:lint,cs:fix,cs:check,phpstan:analyze,phpunit:run,plantuml:convert"/> @@ -127,6 +127,17 @@ + + + + + + + + + + + diff --git a/docs/images/build.svg b/docs/images/build.svg index 86a83fa..7f6dabf 100644 --- a/docs/images/build.svg +++ b/docs/images/build.svg @@ -1 +1 @@ -DB drawsetupcomposer:installdc:updc:ipqacomposer:validatecomposer:normalizecs:fixphpstan:analyzephpunit:runplantuml:convertdb:wait-for-databasehelpvisualizerdc:stopdc:downdc:shellremote:shellremote:qamkdocs:buildmkdocs:servemkdocs:gh-deploydepend:1depend:2depend:3depend:1depend:2depend:3depend:4depend:5depend:6depend:1call:1 \ No newline at end of file +DB drawsetupcomposer:installdc:upqacomposer:validatecomposer:normalizephp:lintcs:fixcs:checkphpstan:analyzephpunit:runplantuml:convertdb:wait-for-databasehelpvisualizerdc:stopdc:downmkdocs:buildmkdocs:servemkdocs:gh-deploydepend:1depend:2depend:1depend:2depend:3depend:4depend:5depend:6depend:7depend:8depend:1call:1 \ No newline at end of file