From 76e8d916f3b039c104e4c49fca1e5607f60b0da1 Mon Sep 17 00:00:00 2001 From: Mohammad Alavi Date: Mon, 25 Dec 2023 12:27:03 +0330 Subject: [PATCH 1/8] Create tests.yml --- .github/workflows/tests.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..91a525b7 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,36 @@ +on: + push: + branches: + - master + - '*.x' +name: Tests +permissions: + contents: read + +jobs: + phpunit: + runs-on: ubuntu-latest + container: + image: kirschbaumdevelopment/laravel-test-runner:8.1 + + services: + mysql: + image: mysql:5.7 + env: + MYSQL_ROOT_PASSWORD: password + MYSQL_DATABASE: test + ports: + - 33306:3306 + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 1 + + - name: Install composer dependencies + run: | + composer install --no-ansi --no-interaction --no-progress --no-scripts + + - name: Run Testsuite + run: vendor/bin/phpunit From a476dacc9bb4aee2660d08bbfea83acd6f6cbbcc Mon Sep 17 00:00:00 2001 From: Mohammad Alavi Date: Mon, 25 Dec 2023 12:38:05 +0330 Subject: [PATCH 2/8] Update tests.yml --- .github/workflows/tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 91a525b7..65a85e3e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,6 +3,10 @@ on: branches: - master - '*.x' + pull_request: + branches: + - master + - '*.x' name: Tests permissions: contents: read From 6c07266f6744984c5775ad436dd278696524b360 Mon Sep 17 00:00:00 2001 From: Mohammad Alavi Date: Mon, 25 Dec 2023 12:59:52 +0330 Subject: [PATCH 3/8] feat: add test coverage report --- .github/workflows/codecov.yaml | 4 ++ .../{php-cs-fixer.yml => php-cs-fixer.yaml} | 4 +- .github/workflows/{phpmd.yml => phpmd.yaml} | 4 +- .github/workflows/tests.yaml | 55 +++++++++++++++++++ .github/workflows/tests.yml | 40 -------------- 5 files changed, 65 insertions(+), 42 deletions(-) create mode 100644 .github/workflows/codecov.yaml rename .github/workflows/{php-cs-fixer.yml => php-cs-fixer.yaml} (99%) rename .github/workflows/{phpmd.yml => phpmd.yaml} (99%) create mode 100644 .github/workflows/tests.yaml delete mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/codecov.yaml b/.github/workflows/codecov.yaml new file mode 100644 index 00000000..1c6f740a --- /dev/null +++ b/.github/workflows/codecov.yaml @@ -0,0 +1,4 @@ +name: Upload coverage reports to Codecov +uses: codecov/codecov-action@v3 +env: +CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yaml similarity index 99% rename from .github/workflows/php-cs-fixer.yml rename to .github/workflows/php-cs-fixer.yaml index b7c53342..ab32244b 100644 --- a/.github/workflows/php-cs-fixer.yml +++ b/.github/workflows/php-cs-fixer.yaml @@ -1,5 +1,7 @@ -on: [push, pull_request] name: Check & fix styling + +on: [push, pull_request] + jobs: php-cs-fixer: name: PHP-CS-Fixer diff --git a/.github/workflows/phpmd.yml b/.github/workflows/phpmd.yaml similarity index 99% rename from .github/workflows/phpmd.yml rename to .github/workflows/phpmd.yaml index c671109e..9c358633 100644 --- a/.github/workflows/phpmd.yml +++ b/.github/workflows/phpmd.yaml @@ -1,5 +1,7 @@ -on: [push, pull_request] name: PHPMD + +on: [push, pull_request] + jobs: phpmd: name: PHPMD diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml new file mode 100644 index 00000000..05f3f9be --- /dev/null +++ b/.github/workflows/tests.yaml @@ -0,0 +1,55 @@ +name: Tests + +on: + push: + branches: + - master + - '*.x' + pull_request: + +permissions: + contents: read + +jobs: + tests: + runs-on: ubuntu-latest + strategy: + fail-fast: true + matrix: + php: [ 8.1, 8.2 ] + name: PHP ${{ matrix.php }} + + container: + image: kirschbaumdevelopment/laravel-test-runner:8.1 + + services: + mysql: + image: mysql:5.7 + env: + MYSQL_ROOT_PASSWORD: password + MYSQL_DATABASE: test + ports: + - 33306:3306 + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite + coverage: none + + - name: Install Composer dependencies + run: composer install --prefer-dist --no-interaction --no-progress + + - name: Execute tests + run: vendor/bin/phpunit + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index 65a85e3e..00000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,40 +0,0 @@ -on: - push: - branches: - - master - - '*.x' - pull_request: - branches: - - master - - '*.x' -name: Tests -permissions: - contents: read - -jobs: - phpunit: - runs-on: ubuntu-latest - container: - image: kirschbaumdevelopment/laravel-test-runner:8.1 - - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ROOT_PASSWORD: password - MYSQL_DATABASE: test - ports: - - 33306:3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 1 - - - name: Install composer dependencies - run: | - composer install --no-ansi --no-interaction --no-progress --no-scripts - - - name: Run Testsuite - run: vendor/bin/phpunit From cad72e99aedbba3ce9da5ead49301aed8efa9bc5 Mon Sep 17 00:00:00 2001 From: Mohammad Alavi Date: Mon, 25 Dec 2023 13:08:10 +0330 Subject: [PATCH 4/8] Delete codecov.yaml --- .github/workflows/codecov.yaml | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 .github/workflows/codecov.yaml diff --git a/.github/workflows/codecov.yaml b/.github/workflows/codecov.yaml deleted file mode 100644 index 1c6f740a..00000000 --- a/.github/workflows/codecov.yaml +++ /dev/null @@ -1,4 +0,0 @@ -name: Upload coverage reports to Codecov -uses: codecov/codecov-action@v3 -env: -CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 7949d3b0458292a41ec237d0bafcb0cfe80494f5 Mon Sep 17 00:00:00 2001 From: Mohammad Alavi Date: Mon, 25 Dec 2023 13:08:13 +0330 Subject: [PATCH 5/8] Update phpunit.xml --- phpunit.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpunit.xml b/phpunit.xml index c4d3a341..ff2801ea 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -8,9 +8,9 @@ - - - + + + From eff9baaf0f6b2c1371e3409597262edbef5ebe57 Mon Sep 17 00:00:00 2001 From: Mohammad Alavi Date: Mon, 25 Dec 2023 13:47:54 +0330 Subject: [PATCH 6/8] Create codecov.yaml --- .github/workflows/codecov.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/codecov.yaml diff --git a/.github/workflows/codecov.yaml b/.github/workflows/codecov.yaml new file mode 100644 index 00000000..cf188263 --- /dev/null +++ b/.github/workflows/codecov.yaml @@ -0,0 +1,16 @@ +- name: PHPUnit Tests + uses: php-actions/phpunit@v3 + env: + XDEBUG_MODE: coverage + with: + bootstrap: vendor/autoload.php + configuration: phpunit.xml + php_extensions: xdebug + args: tests --coverage-clover ./coverage.xml + +- name: Upload to Codecov + uses: codecov/codecov-action@v2 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage.xml + verbose: true From 86ea6e0750e3943fbf7c99a73f0d0b71ff63b00c Mon Sep 17 00:00:00 2001 From: Mohammad Alavi Date: Mon, 25 Dec 2023 13:47:58 +0330 Subject: [PATCH 7/8] Update tests.yaml --- .github/workflows/tests.yaml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 05f3f9be..492cf2f1 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -19,19 +19,6 @@ jobs: php: [ 8.1, 8.2 ] name: PHP ${{ matrix.php }} - container: - image: kirschbaumdevelopment/laravel-test-runner:8.1 - - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ROOT_PASSWORD: password - MYSQL_DATABASE: test - ports: - - 33306:3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - steps: - name: Checkout code uses: actions/checkout@v3 From 57e0cfd48cf1b4ce83ba227efa483e0d8f70031d Mon Sep 17 00:00:00 2001 From: Mohammad Alavi Date: Mon, 25 Dec 2023 13:50:50 +0330 Subject: [PATCH 8/8] Update .editorconfig --- .editorconfig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index e8b7a341..1938b93e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,4 +1,3 @@ -# http://editorconfig.org root = true [*] @@ -11,3 +10,9 @@ trim_trailing_whitespace = true [*.md] trim_trailing_whitespace = false + +[*.{yml,yaml}] +indent_size = 2 + +[docker-compose.yml] +indent_size = 4 \ No newline at end of file