Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Api 734 setup a GitHub actions #189

Merged
merged 18 commits into from
Dec 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .github/workflows/codecov.yaml

This file was deleted.

5 changes: 4 additions & 1 deletion .github/workflows/php-cs-fixer.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
name: Check & fix styling

on: [push, pull_request]
on:
pull_request:
types: [ opened, synchronize, reopened ]

jobs:
php-cs-fixer:
name: PHP-CS-Fixer
runs-on: ubuntu-latest
permissions:
contents: write
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down
32 changes: 17 additions & 15 deletions .github/workflows/phpmd.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
name: PHPMD

on: [push, pull_request]
on:
pull_request:
types: [ opened, synchronize, reopened ]

jobs:
phpmd:
name: PHPMD
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup PHP environment
uses: shivammathur/setup-php@v2
with:
coverage: none
tools: phpmd
- name: Run PHPMD
run: phpmd . github ruleset.xml --exclude 'Tests/*,vendor/*'
phpmd:
name: PHPMD
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup PHP environment
uses: shivammathur/setup-php@v2
with:
coverage: none
tools: phpmd
- name: Run PHPMD
run: phpmd . github ruleset.xml --exclude 'Tests/*,vendor/*'
52 changes: 28 additions & 24 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,33 @@ jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [ 8.1, 8.2 ]
fail-fast: true
matrix:
php: [ 8.1, 8.2 ]
name: PHP ${{ matrix.php }}

timeout-minutes: 10
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 }}
- 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: xdebug
tools: phpunit:10.*

- name: Install Composer dependencies
run: composer install --prefer-dist --no-interaction --no-progress

- name: Execute tests
run: vendor/bin/phpunit --coverage-clover=coverage.xml

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
29 changes: 16 additions & 13 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd" bootstrap="vendor/autoload.php"
colors="true">
<testsuites>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true">
<testsuites>
<testsuite name="Unit">
<directory>./Tests</directory>
<directory>./Tests</directory>
</testsuite>
</testsuites>
<coverage ignoreDeprecatedCodeUnits="true" pathCoverage="true">
<!-- <report>-->
<!-- <html outputDirectory="html_coverage"/>-->
<!-- </report>-->
</coverage>
<php>
</testsuites>
<coverage ignoreDeprecatedCodeUnits="true" pathCoverage="true"/>
<php>
<env name="DB_CONNECTION" value="testing"/>
</php>
</php>
<source>
<include>
<directory suffix=".php">./</directory>
</include>
<exclude>
<directory suffix=".php">./Tests</directory>
<directory suffix=".php">./vendor</directory>
</exclude>
</source>
</phpunit>