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

PG-31 #4

Merged
merged 35 commits into from
Dec 4, 2023
Merged
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
204 changes: 203 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,84 @@ jobs:
runs-on: ubuntu-latest

steps:
- 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-matrix: 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-matrix"
}
},
{
"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@v3
- uses: php-actions/composer@v6
- name: Run php-actions/composer@v6
uses: php-actions/composer@v6
with:
php_version: "8.2"
php_extensions: intl
version: 2.x
- uses: php-actions/phpunit@v3
env:
XDEBUG_MODE: coverage
with:
version: "10.1"
php_version: "8.2"
php_extensions: xdebug
coverage_clover: clover.xml
coverage_text: true
Expand All @@ -40,3 +112,133 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
- 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-matrix: 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-matrix"
}
},
{
"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-matrix: 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-matrix"
}
},
{
"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 }}