Skip to content

Commit

Permalink
GH-7 (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
gammamatrix committed Feb 10, 2024
1 parent 099a850 commit 592c15a
Show file tree
Hide file tree
Showing 63 changed files with 2,724 additions and 2,491 deletions.
217 changes: 212 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
types:
- opened
- reopened
- synchronize
- ready_for_review
- review_requested

permissions:
contents: write
Expand All @@ -16,10 +21,74 @@ jobs:
build:

runs-on: ubuntu-latest

if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
steps:
- uses: actions/checkout@v3
# - uses: php-actions/composer@v6
- name: Preparing timer
id: timer_start
run: |
echo "DATE_START=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_OUTPUT
echo "TIMESTAMP_START=$(date +'%s')" >> $GITHUB_OUTPUT
- name: "Slack notification: IN PROGRESS"
id: slack
uses: slackapi/[email protected]
with:
channel-id: 'C068A06PV43'
payload: |
{
"text": "CI Build Status for playground-auth: IN PROGRESS\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": ":runner: CI Build Status for playground-auth"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Start:*\n${{ steps.timer_start.outputs.DATE_START }}"
},
{
"type": "mrkdwn",
"text": "*End:*\n--"
}
]
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Status:* IN PROGRESS"
},
{
"type": "mrkdwn",
"text": ":timer_clock: --"
}
]
},
{
"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 }}"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
- uses: actions/checkout@v4
- name: Run php-actions/composer@v6
uses: php-actions/composer@v6
with:
Expand All @@ -30,7 +99,9 @@ jobs:
env:
XDEBUG_MODE: coverage
with:
php_extensions: xdebug
version: "10.1"
php_version: "8.2"
php_extensions: intl xdebug
coverage_clover: clover.xml
coverage_text: true
- name: Make code coverage badge
Expand All @@ -46,3 +117,139 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
- uses: php-actions/phpstan@v3
with:
level: 9
php_version: "8.2"
path: config/ database/ lang/ src/ tests/Unit/ tests/Feature/
args: --verbose --debug
- name: Stopping timer
if: ${{ !cancelled() }}
id: timer_end
env:
TIMESTAMP_START: ${{ steps.timer_start.outputs.TIMESTAMP_START }}
run: |
echo "DATE_END=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_OUTPUT
echo "DURATION_PHRASE=$(($(date +'%s')-$TIMESTAMP_START)) seconds" >> $GITHUB_OUTPUT
- name: "Slack notification: Done"
uses: slackapi/[email protected]
with:
channel-id: 'C068A06PV43'
update-ts: ${{ steps.slack.outputs.ts }}
payload: |
{
"text": "CI Build Status for playground-auth: DONE\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": ":white_check_mark: CI Build Status for playground-auth"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Start:*\n${{ steps.timer_start.outputs.DATE_START }}"
},
{
"type": "mrkdwn",
"text": "*End:*\n${{ steps.timer_end.outputs.DATE_END }}"
}
]
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Status:* Success"
},
{
"type": "mrkdwn",
"text": ":timer_clock: ${{ steps.timer_end.outputs.DURATION_PHRASE }}"
}
]
},
{
"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 }}"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
- name: "Send a notification for failures"
if: ${{ failure() }}
uses: slackapi/[email protected]
with:
channel-id: 'C068A06PV43'
update-ts: ${{ steps.slack.outputs.ts }}
payload: |
{
"text": "CI Build Status for playground-auth: FAILED\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": ":warning: CI Build Status for playground-auth"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Start:*\n${{ steps.timer_start.outputs.DATE_START }}"
},
{
"type": "mrkdwn",
"text": "*End:*\n${{ steps.timer_end.outputs.DATE_END }}"
}
]
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Status:* FAILED"
},
{
"type": "mrkdwn",
"text": ":timer_clock: ${{ steps.timer_end.outputs.DURATION_PHRASE }}"
}
]
},
{
"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 }}"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ vendor
# Test and Docs ignores
################################################################################
coverage
output
phpunit.xml
phpstan.neon
testbench.yaml
Expand Down
9 changes: 4 additions & 5 deletions .php-cs-fixer.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,11 @@

$finder = PhpCsFixer\Finder::create()
->in([
__DIR__ . '/config',
__DIR__ . '/database',
__DIR__.'/config',
__DIR__.'/database',
__DIR__ . '/lang',
__DIR__ . '/routes',
__DIR__ . '/src',
__DIR__ . '/tests/Feature',
__DIR__.'/src',
__DIR__.'/tests/Feature',
__DIR__ . '/tests/Unit',
])
->name('*.php')
Expand Down
Loading

0 comments on commit 592c15a

Please sign in to comment.