Skip to content

Commit 6f649a4

Browse files
authored
Merge pull request #49 from WebFiori/dev
Workflow Enhancements
2 parents 0b24db0 + 9cbeff8 commit 6f649a4

7 files changed

Lines changed: 116 additions & 135 deletions

File tree

.github/workflows/php81.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Build PHP 8.1
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
jobs:
9+
test:
10+
name: Run Tests
11+
uses: WebFiori/workflows/.github/workflows/test-php.yaml@main
12+
with:
13+
php-version: '8.1'
14+
15+
code-coverage:
16+
name: Coverage
17+
needs: test
18+
uses: WebFiori/workflows/.github/workflows/coverage-codecov.yaml@main
19+
with:
20+
php-version: '8.1'
21+
coverage-file: 'php-8.1-coverage.xml'
22+
secrets:
23+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
24+
25+
26+

.github/workflows/php81.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/workflows/php82.yml

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,22 @@ on:
55
branches: [ main, dev ]
66
pull_request:
77
branches: [ main ]
8-
env:
9-
OPERATING_SYS: ubuntu-latest
10-
PHP_VERSION: 8.2
118
jobs:
129
test:
13-
runs-on: "ubuntu-latest"
14-
15-
name: "PHP 8.2 - Ubuntu-Latest"
10+
name: Run Tests
11+
uses: WebFiori/workflows/.github/workflows/test-php.yaml@main
12+
with:
13+
php-version: '8.2'
14+
15+
code-coverage:
16+
name: Coverage
17+
needs: test
18+
uses: WebFiori/workflows/.github/workflows/coverage-codecov.yaml@main
19+
with:
20+
php-version: '8.2'
21+
coverage-file: 'php-8.2-coverage.xml'
22+
secrets:
23+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
1624

17-
steps:
18-
- name: Clone Repo
19-
uses: actions/checkout@v4
20-
21-
- name: Setup PHP
22-
uses: shivammathur/setup-php@v2
23-
with:
24-
php-version: ${{ env.PHP_VERSION }}
25-
extensions: mysqli, mbstring, sqlsrv
26-
tools: phpunit:9.5.20, composer
27-
28-
- name: Install Dependencies
29-
run: composer install --prefer-source --no-interaction
30-
31-
- name: Execute Tests
32-
run: phpunit --configuration=tests/phpunit.xml
3325

34-
- name: CodeCov
35-
uses: codecov/codecov-action@v4
36-
env:
37-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
26+

.github/workflows/php83.yml

Lines changed: 30 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -9,49 +9,37 @@ env:
99
OPERATING_SYS: ubuntu-latest
1010
PHP_VERSION: 8.3
1111
jobs:
12+
1213
test:
13-
runs-on: "ubuntu-latest"
14+
name: Run Tests
15+
uses: WebFiori/workflows/.github/workflows/test-php.yaml@main
16+
with:
17+
php-version: '8.3'
18+
phpunit-config: 'tests/phpunit10.xml'
1419

15-
name: "PHP 8.3 - Ubuntu-Latest"
16-
17-
steps:
18-
- name: Clone Repo
19-
uses: actions/checkout@v4
20-
21-
- name: Setup PHP
22-
uses: shivammathur/setup-php@v2
23-
with:
24-
php-version: ${{ env.PHP_VERSION }}
25-
extensions: mysqli, mbstring, sqlsrv
26-
tools: phpunit:9.5.20, composer
27-
28-
- name: Install Dependencies
29-
run: composer install --prefer-source --no-interaction
30-
31-
- name: Execute Tests
32-
run: phpunit --configuration=tests/phpunit.xml
33-
34-
- name: CodeCov
35-
uses: codecov/codecov-action@v4
36-
env:
37-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
38-
39-
- name: SonarCloud Code Scan
40-
uses: sonarsource/sonarqube-scan-action@v5
41-
env:
42-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
20+
21+
code-coverage:
22+
name: Coverage
23+
needs: test
24+
uses: WebFiori/workflows/.github/workflows/coverage-codecov.yaml@main
25+
with:
26+
php-version: '8.3'
27+
coverage-file: 'php-8.3-coverage.xml'
28+
secrets:
29+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
30+
31+
code-quality:
32+
name: Code Quality
33+
needs: test
34+
uses: WebFiori/workflows/.github/workflows/quality-sonarcloud.yaml@main
35+
with:
36+
coverage-file: 'php-8.3-coverage.xml'
37+
secrets:
38+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
4439

45-
release_prod:
40+
release-prod:
4641
name: Prepare Production Release Branch / Publish Release
47-
needs:
48-
- "test"
49-
runs-on: "ubuntu-latest"
50-
if: github.ref == 'refs/heads/main'
51-
steps:
52-
- uses: actions/checkout@v4
53-
- uses: google-github-actions/release-please-action@v3
54-
with:
55-
release-type: php
56-
config-file: release-please-config.json
57-
token: ${{ secrets.GITHUB_TOKEN }}
42+
needs: [code-coverage, code-quality]
43+
uses: WebFiori/workflows/.github/workflows/release-php.yaml@main
44+
with:
45+
branch: 'main'

.github/workflows/php84.yml

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,22 @@ on:
55
branches: [ main, dev ]
66
pull_request:
77
branches: [ main ]
8-
env:
9-
OPERATING_SYS: ubuntu-latest
10-
PHP_VERSION: 8.4
118
jobs:
129
test:
13-
runs-on: "ubuntu-latest"
14-
15-
name: "PHP 8.4 - Ubuntu-Latest"
10+
name: Run Tests
11+
uses: WebFiori/workflows/.github/workflows/test-php.yaml@main
12+
with:
13+
php-version: '8.4'
14+
15+
code-coverage:
16+
name: Coverage
17+
needs: test
18+
uses: WebFiori/workflows/.github/workflows/coverage-codecov.yaml@main
19+
with:
20+
php-version: '8.4'
21+
coverage-file: 'php-8.4-coverage.xml'
22+
secrets:
23+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
1624

17-
steps:
18-
- name: Clone Repo
19-
uses: actions/checkout@v4
20-
21-
- name: Setup PHP
22-
uses: shivammathur/setup-php@v2
23-
with:
24-
php-version: ${{ env.PHP_VERSION }}
25-
extensions: mysqli, mbstring, sqlsrv
26-
tools: phpunit:9.5.20, composer
27-
28-
- name: Shutdown Ubuntu MySQL
29-
run: sudo service mysql stop
30-
31-
- name: Install Dependencies
32-
run: composer install --prefer-source --no-interaction
33-
34-
- name: Execute Tests
35-
run: phpunit --configuration=tests/phpunit.xml
3625

37-
- name: CodeCov
38-
uses: codecov/codecov-action@v4
39-
env:
40-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
26+

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
}
2424
},
2525
"scripts":{
26-
"test": "phpunit --configuration tests/phpunit.xml"
26+
"test": "phpunit --configuration tests/phpunit.xml",
27+
"test-10": "phpunit --configuration tests/phpunit10.xml"
2728
},
2829
"require-dev": {
2930
"phpunit/phpunit": "^10.0"

tests/phpunit10.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
4+
colors="true"
5+
bootstrap="bootstrap.php">
6+
7+
<php>
8+
</php>
9+
10+
<testsuites>
11+
<testsuite name="Json Tests">
12+
<directory>./WebFiori/Tests/Json</directory>
13+
</testsuite>
14+
</testsuites>
15+
16+
<source>
17+
<include>
18+
<directory>../WebFiori/Json</directory>
19+
</include>
20+
</source>
21+
22+
<coverage>
23+
<report>
24+
<clover outputFile="clover.xml"/>
25+
</report>
26+
</coverage>
27+
28+
</phpunit>

0 commit comments

Comments
 (0)