From 44107c9c5440720e4acdc9247b41b733109da5e5 Mon Sep 17 00:00:00 2001 From: Romain Monteil Date: Tue, 7 Mar 2023 10:54:19 +0100 Subject: [PATCH] Add GitHub workflow and gitattribute file --- .gitattributes | 9 +++++++++ .github/workflows/ci.yml | 43 ++++++++++++++++++++++++++++++++++++++++ .gitignore | 18 ++++++----------- composer.json | 1 + 4 files changed, 59 insertions(+), 12 deletions(-) create mode 100644 .gitattributes create mode 100644 .github/workflows/ci.yml diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..304e5fa --- /dev/null +++ b/.gitattributes @@ -0,0 +1,9 @@ +# Path-based git attributes +# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html + +# Ignore all test and documentation with "export-ignore". +/.github export-ignore +/tests export-ignore +/.gitattributes export-ignore +/.gitignore export-ignore +/phpunit.xml.dist export-ignore diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9a67b46 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: ci + +on: + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + php-version: [ '7.4', '8.0', '8.1', '8.2' ] + + steps: + - name: checkout + uses: actions/checkout@v3 + + - name: php-setup + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + + - name: composer-validate + run: composer validate + + - name: composer-cache + id: composer-cache + uses: actions/cache@v3 + with: + path: vendor + key: ${{ runner.os }}-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.php-version }}-composer- + + - name: composer-install + if: steps.composer-cache.outputs.cache-hit != 'true' + run: composer install --prefer-dist --no-progress --no-suggest + + - name: phpunit + run: vendor/bin/phpunit diff --git a/.gitignore b/.gitignore index 9734907..5cf8cb5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,8 @@ -/tests/cache +/.idea/ +/tests/App/var +/tests/coverage/ /vendor/ -phpunit.xml -.phpunit.result.cache -composer.lock -.idea/ -cache/ -var/ -tests/coverage/ .DS_Store -.php_cs.cache -.php-cs-fixer.cache -*.sqlite -.preload.php +composer.lock +.phpunit.result.cache +phpunit.xml diff --git a/composer.json b/composer.json index 14fd114..764d218 100644 --- a/composer.json +++ b/composer.json @@ -20,6 +20,7 @@ ], "require": { "php": ">=7.4", + "doctrine/annotations": "^2.0", "doctrine/orm": "^2.7", "paragonie/ciphersweet": "^3.0", "symfony/config": "^4.4 || ^5.1 || ^6.0",