Skip to content

Commit

Permalink
v73.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gammamatrix committed Jul 6, 2024
1 parent ba08950 commit 3985f7b
Show file tree
Hide file tree
Showing 7 changed files with 195 additions and 58 deletions.
127 changes: 76 additions & 51 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'CI'
name: "CI"

on:
push:
Expand Down Expand Up @@ -30,9 +30,9 @@ jobs:
echo "TIMESTAMP_START=$(date +'%s')" >> $GITHUB_OUTPUT
- name: "Slack notification: IN PROGRESS"
id: slack
uses: slackapi/slack-github-action@v1.25.0
uses: slackapi/slack-github-action@v1.26.0
with:
channel-id: 'C068A06PV43'
channel-id: "C068A06PV43"
payload: |
{
"text": "CI Build Status for playground-blade: IN PROGRESS\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
Expand All @@ -49,11 +49,11 @@ jobs:
"fields": [
{
"type": "mrkdwn",
"text": "*Start:*\n${{ steps.timer_start.outputs.DATE_START }}"
"text": "*Start:* <!date^${{ steps.timer_start.outputs.TIMESTAMP_START }}^{date} at {time}|${{ steps.timer_start.outputs.DATE_START }}>"
},
{
"type": "mrkdwn",
"text": "*End:*\n--"
"text": "*End:* --"
}
]
},
Expand All @@ -71,18 +71,25 @@ jobs:
]
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*PR:* ${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Build:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "Merge/Pull Request"
},
"url": "${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
},
{
"type": "button",
"text": {
"type": "plain_text",
"text": "Build: ${{ github.run_id }}"
},
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
]
}
]
}
Expand All @@ -102,6 +109,7 @@ jobs:
version: "11.0"
php_version: "8.2"
php_extensions: intl xdebug
configuration: phpunit-ci.xml
coverage_clover: clover.xml
coverage_text: true
- name: Make code coverage badge
Expand All @@ -110,7 +118,7 @@ jobs:
coverage_badge_path: output/coverage.svg
push_badge: false
- name: Git push to testing/develop branch
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
publish_dir: ./output
publish_branch: testing/develop
Expand All @@ -121,7 +129,7 @@ jobs:
with:
level: 9
php_version: "8.2"
path: config/ resources/views/ src/ tests/Unit/ tests/Feature/
path: config/ src/ tests/Feature/ tests/Unit/
args: --verbose --debug
- name: Stopping timer
if: ${{ !cancelled() }}
Expand All @@ -131,10 +139,11 @@ jobs:
run: |
echo "DATE_END=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_OUTPUT
echo "DURATION_PHRASE=$(($(date +'%s')-$TIMESTAMP_START)) seconds" >> $GITHUB_OUTPUT
echo "TIMESTAMP_END=$(date +'%s')" >> $GITHUB_OUTPUT
- name: "Slack notification: Done"
uses: slackapi/slack-github-action@v1.25.0
uses: slackapi/slack-github-action@v1.26.0
with:
channel-id: 'C068A06PV43'
channel-id: "C068A06PV43"
update-ts: ${{ steps.slack.outputs.ts }}
payload: |
{
Expand All @@ -152,11 +161,11 @@ jobs:
"fields": [
{
"type": "mrkdwn",
"text": "*Start:*\n${{ steps.timer_start.outputs.DATE_START }}"
"text": "*Start:* <!date^${{ steps.timer_start.outputs.TIMESTAMP_START }}^{date} at {time}|${{ steps.timer_start.outputs.DATE_START }}>"
},
{
"type": "mrkdwn",
"text": "*End:*\n${{ steps.timer_end.outputs.DATE_END }}"
"text": "*End:* <!date^${{ steps.timer_end.outputs.TIMESTAMP_END }}^{date} at {time}|${{ steps.timer_end.outputs.DATE_END }}>"
}
]
},
Expand All @@ -174,28 +183,36 @@ jobs:
]
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*PR:* ${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Build:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "Merge/Pull Request"
},
"url": "${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
},
{
"type": "button",
"text": {
"type": "plain_text",
"text": "Build: ${{ github.run_id }}"
},
"style": "primary",
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
]
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
- name: "Send a notification for failures"
if: ${{ failure() }}
uses: slackapi/slack-github-action@v1.25.0
uses: slackapi/slack-github-action@v1.26.0
with:
channel-id: 'C068A06PV43'
channel-id: "C068A06PV43"
update-ts: ${{ steps.slack.outputs.ts }}
payload: |
{
Expand All @@ -213,11 +230,11 @@ jobs:
"fields": [
{
"type": "mrkdwn",
"text": "*Start:*\n${{ steps.timer_start.outputs.DATE_START }}"
"text": "*Start:* <!date^${{ steps.timer_start.outputs.TIMESTAMP_START }}^{date} at {time}|${{ steps.timer_start.outputs.DATE_START }}>"
},
{
"type": "mrkdwn",
"text": "*End:*\n${{ steps.timer_end.outputs.DATE_END }}"
"text": "*End:* <!date^${{ steps.timer_end.outputs.TIMESTAMP_END }}^{date} at {time}|${{ steps.timer_end.outputs.DATE_END }}>"
}
]
},
Expand All @@ -235,18 +252,26 @@ jobs:
]
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*PR:* ${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Build:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
"type": "actions",
"elements": [
{
"type": "button",
"text": {
"type": "plain_text",
"text": "Merge/Pull Request"
},
"url": "${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
},
{
"type": "button",
"text": {
"type": "plain_text",
"text": "Build: ${{ github.run_id }}"
},
"style": "danger",
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
]
}
]
}
Expand Down
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,38 @@ php artisan vendor:publish --tag playground-blade-errors
composer test
```

## Cloc

```sh
composer cloc
```

```
➜ playground-blade git:(develop) ✗ composer cloc
> cloc --exclude-dir=output,vendor .
154 text files.
118 unique files.
38 files ignored.
github.com/AlDanial/cloc v 1.98 T=0.10 s (1143.8 files/s, 81948.0 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
Blade 49 397 13 2700
PHP 47 466 518 2524
CSS 10 139 141 461
SVG 2 2 2 301
YAML 1 5 0 275
XML 3 0 7 221
Markdown 3 47 0 98
JSON 1 0 0 65
JavaScript 1 0 35 22
INI 1 3 0 12
-------------------------------------------------------------------------------
SUM: 118 1059 716 6679
-------------------------------------------------------------------------------
```

## PHPStan

Tests at level 9 on:
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@
}
},
"scripts": {
"test": "vendor/bin/phpunit",
"test": "vendor/bin/testbench package:test",
"format": "vendor/bin/php-cs-fixer fix",
"cloc": "cloc --exclude-dir=output,vendor .",
"analyse": "vendor/bin/phpstan analyse --verbose --debug --level max"
}
}
4 changes: 1 addition & 3 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,5 @@ parameters:

treatPhpDocTypesAsCertain: false

checkGenericClassInNonGenericObjectType: false

editorUrl: 'vscode://file/%%file%%:%%line%%'
# editorUrl: 'vscode://file/%%file%%:%%line%%'
# editorUrl: 'phpstorm://open?file=%%file%%&line=%%line%%'
76 changes: 76 additions & 0 deletions phpunit-ci.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
stopOnSkipped="false"
backupGlobals="false"
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutOutputDuringTests="true"
cacheResult="false"
failOnRisky="true"
failOnWarning="true"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
displayDetailsOnIncompleteTests="true"
displayDetailsOnSkippedTests="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerErrors="true"
displayDetailsOnTestsThatTriggerNotices="true"
displayDetailsOnTestsThatTriggerWarnings="true"
testdox="true">
<testsuites>
<testsuite name="Unit">
<directory>tests/Unit</directory>
</testsuite>
<testsuite name="Feature">
<directory>tests/Feature</directory>
</testsuite>
</testsuites>
<coverage
includeUncoveredFiles="true"
pathCoverage="false"
ignoreDeprecatedCodeUnits="true"
disableCodeCoverageIgnore="true">
<report>
<clover outputFile="output/clover.xml" />
<cobertura outputFile="output/cobertura.xml" />
<crap4j outputFile="output/crap4j.xml" threshold="50" />
<!-- <html outputDirectory="output/html" lowUpperBound="50" highLowerBound="90"/> -->
<php outputFile="output/coverage.php" />
<text outputFile="output/coverage.txt" showUncoveredFiles="false" showOnlySummary="true" />
<!-- <xml outputDirectory="output/xml"/> -->
</report>
</coverage>
<logging>
<junit outputFile="output/junit.xml" />
<teamcity outputFile="output/teamcity.txt" />
<testdoxHtml outputFile="output/testdox.html" />
<testdoxText outputFile="output/testdox.txt" />
</logging>
<source>
<include>
<directory suffix=".php">src</directory>
</include>
</source>
<php>
<env name="APP_DEBUG" value="false" />
<env name="APP_ENV" value="testing" />
<env name="APP_KEY" value="base64:lNTGdmOOxP5uNUVuCj9FB//Ssn8JmRXBdtPEE4/QReE=" />
<env name="BCRYPT_ROUNDS" value="4" />
<env name="CACHE_DRIVER" value="array" />
<env name="LOG_CHANNEL" value="stderr" />
<env name="DB_CONNECTION" value="sqlite" />
<env name="DB_DATABASE" value=":memory:" />
<env name="TEST_DB_MIGRATIONS" value="true" />
<env name="MAIL_MAILER" value="log" />
<env name="QUEUE_CONNECTION" value="sync" />
<env name="SESSION_DRIVER" value="array" />
<env name="TELESCOPE_ENABLED" value="false" />
<ini name="memory_limit" value="512M" />
</php>
</phpunit>
6 changes: 3 additions & 3 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
<testsuite name="Unit">
<directory>tests/Unit</directory>
</testsuite>
<testsuite name="Feature">
<!-- <testsuite name="Feature">
<directory>tests/Feature</directory>
</testsuite>
</testsuite> -->
</testsuites>
<coverage
includeUncoveredFiles="true"
Expand Down Expand Up @@ -66,7 +66,7 @@
<env name="LOG_CHANNEL" value="stderr" />
<env name="DB_CONNECTION" value="sqlite" />
<env name="DB_DATABASE" value=":memory:" />
<env name="TEST_DB_MIGRATIONS" value="true" />
<env name="TEST_DB_MIGRATIONS" value="false" />
<env name="MAIL_MAILER" value="log" />
<env name="QUEUE_CONNECTION" value="sync" />
<env name="SESSION_DRIVER" value="array" />
Expand Down
Loading

0 comments on commit 3985f7b

Please sign in to comment.