Skip to content
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
26 changes: 26 additions & 0 deletions .github/workflows/php81.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build PHP 8.1

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
name: Run Tests
uses: WebFiori/workflows/.github/workflows/test-php.yaml@main
with:
php-version: '8.1'

code-coverage:
name: Coverage
needs: test
uses: WebFiori/workflows/.github/workflows/coverage-codecov.yaml@main
with:
php-version: '8.1'
coverage-file: 'php-8.1-coverage.xml'
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}



37 changes: 0 additions & 37 deletions .github/workflows/php81.yml

This file was deleted.

41 changes: 15 additions & 26 deletions .github/workflows/php82.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,22 @@ on:
branches: [ main, dev ]
pull_request:
branches: [ main ]
env:
OPERATING_SYS: ubuntu-latest
PHP_VERSION: 8.2
jobs:
test:
runs-on: "ubuntu-latest"

name: "PHP 8.2 - Ubuntu-Latest"
name: Run Tests
uses: WebFiori/workflows/.github/workflows/test-php.yaml@main
with:
php-version: '8.2'

code-coverage:
name: Coverage
needs: test
uses: WebFiori/workflows/.github/workflows/coverage-codecov.yaml@main
with:
php-version: '8.2'
coverage-file: 'php-8.2-coverage.xml'
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

steps:
- name: Clone Repo
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
extensions: mysqli, mbstring, sqlsrv
tools: phpunit:9.5.20, composer

- name: Install Dependencies
run: composer install --prefer-source --no-interaction

- name: Execute Tests
run: phpunit --configuration=tests/phpunit.xml

- name: CodeCov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

72 changes: 30 additions & 42 deletions .github/workflows/php83.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,49 +9,37 @@ env:
OPERATING_SYS: ubuntu-latest
PHP_VERSION: 8.3
jobs:

test:
runs-on: "ubuntu-latest"
name: Run Tests
uses: WebFiori/workflows/.github/workflows/test-php.yaml@main
with:
php-version: '8.3'
phpunit-config: 'tests/phpunit10.xml'

name: "PHP 8.3 - Ubuntu-Latest"

steps:
- name: Clone Repo
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
extensions: mysqli, mbstring, sqlsrv
tools: phpunit:9.5.20, composer

- name: Install Dependencies
run: composer install --prefer-source --no-interaction

- name: Execute Tests
run: phpunit --configuration=tests/phpunit.xml

- name: CodeCov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: SonarCloud Code Scan
uses: sonarsource/sonarqube-scan-action@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

code-coverage:
name: Coverage
needs: test
uses: WebFiori/workflows/.github/workflows/coverage-codecov.yaml@main
with:
php-version: '8.3'
coverage-file: 'php-8.3-coverage.xml'
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

code-quality:
name: Code Quality
needs: test
uses: WebFiori/workflows/.github/workflows/quality-sonarcloud.yaml@main
with:
coverage-file: 'php-8.3-coverage.xml'
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

release_prod:
release-prod:
name: Prepare Production Release Branch / Publish Release
needs:
- "test"
runs-on: "ubuntu-latest"
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- uses: google-github-actions/release-please-action@v3
with:
release-type: php
config-file: release-please-config.json
token: ${{ secrets.GITHUB_TOKEN }}
needs: [code-coverage, code-quality]
uses: WebFiori/workflows/.github/workflows/release-php.yaml@main
with:
branch: 'main'
44 changes: 15 additions & 29 deletions .github/workflows/php84.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,22 @@ on:
branches: [ main, dev ]
pull_request:
branches: [ main ]
env:
OPERATING_SYS: ubuntu-latest
PHP_VERSION: 8.4
jobs:
test:
runs-on: "ubuntu-latest"

name: "PHP 8.4 - Ubuntu-Latest"
name: Run Tests
uses: WebFiori/workflows/.github/workflows/test-php.yaml@main
with:
php-version: '8.4'

code-coverage:
name: Coverage
needs: test
uses: WebFiori/workflows/.github/workflows/coverage-codecov.yaml@main
with:
php-version: '8.4'
coverage-file: 'php-8.4-coverage.xml'
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

steps:
- name: Clone Repo
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
extensions: mysqli, mbstring, sqlsrv
tools: phpunit:9.5.20, composer

- name: Shutdown Ubuntu MySQL
run: sudo service mysql stop

- name: Install Dependencies
run: composer install --prefer-source --no-interaction

- name: Execute Tests
run: phpunit --configuration=tests/phpunit.xml

- name: CodeCov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
}
},
"scripts":{
"test": "phpunit --configuration tests/phpunit.xml"
"test": "phpunit --configuration tests/phpunit.xml",
"test-10": "phpunit --configuration tests/phpunit10.xml"
},
"require-dev": {
"phpunit/phpunit": "^10.0"
Expand Down
28 changes: 28 additions & 0 deletions tests/phpunit10.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
colors="true"
bootstrap="bootstrap.php">

<php>
</php>

<testsuites>
<testsuite name="Json Tests">
<directory>./WebFiori/Tests/Json</directory>
</testsuite>
</testsuites>

<source>
<include>
<directory>../WebFiori/Json</directory>
</include>
</source>

<coverage>
<report>
<clover outputFile="clover.xml"/>
</report>
</coverage>

</phpunit>
Loading