From 8e74eb5f709c65817278b1195b52434940034265 Mon Sep 17 00:00:00 2001 From: otsch Date: Wed, 31 Jan 2024 13:28:46 +0100 Subject: [PATCH] Github workflow, .editorconfig and .gitattributes --- .editorconfig | 17 +++++++++++ .gitattributes | 9 ++++++ .github/workflows/ci.yml | 64 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+) create mode 100644 .editorconfig create mode 100644 .gitattributes create mode 100644 .github/workflows/ci.yml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..75349f8 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,17 @@ +# EditorConfig is awesome: http://EditorConfig.org + +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_style = space +indent_size = 4 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false + +[*.yml] +indent_size = 2 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..b06645b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,9 @@ +.github export-ignore +bin export-ignore +tests export-ignore +.editorconfig export-ignore +.gitattributes export-ignore +.gitignore export-ignore +.php-cs-fixer.php export-ignore +phpstan.neon export-ignore +phpunit.xml export-ignore diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..f44514b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,64 @@ +name: CI + +on: pull_request + +jobs: + cs: + name: PHP CS Fixer + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.1' + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + + - name: Run PHP CS Fixer + run: composer cs + + tests: + name: PestPHP Tests + runs-on: ubuntu-latest + strategy: + matrix: + php-versions: [ '8.1', '8.2', '8.3' ] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + + - name: Run tests + run: composer test + + stan: + name: PHPStan + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.1' + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + + - name: Run PHPStan + run: composer stan