Skip to content

Workflow file for this run

name: 'Tests: Playground Matrix'
on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
permissions:
contents: write
pull-requests: write
issues: write
repository-projects: write
jobs:
build:
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": "section",
"text": {
"type": "mrkdwn",
"text": ":runner: CI Build Status for playground-matrix\nStatus: *IN PROGRESS*\n*Start:* ${{ steps.timer_start.outputs.DATE_START }}\n*End:* \n*Duration:* \n*PR: *${{ github.event.pull_request.html_url || github.event.head_commit.url }}\n*Build:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
- uses: actions/checkout@v3
- 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
# - name: Make code coverage badge
# uses: timkrase/[email protected]
# with:
# coverage_badge_path: output/coverage.svg
# push_badge: false
# - name: Git push to testing/develop branch
# uses: peaceiris/actions-gh-pages@v3
# with:
# publish_dir: ./output
# publish_branch: testing/develop
# 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 "TIMESTAMP_END=$(date +'%s')" >> $GITHUB_OUTPUT
# echo "TIMESTAMP_DURATION=$((${TIMESTAMP_END} - ${TIMESTAMP_START}))" >> $GITHUB_OUTPUT
#echo "TIMESTAMP_DURATION=$(($(date +'%s') - ${TIMESTAMP_START}))" >> $GITHUB_OUTPUT
#echo "TIMESTAMP_DURATION=$((2000 - 1800))" >> $GITHUB_OUTPUT
#echo "TIMESTAMP_DURATION=200" >> $GITHUB_OUTPUT
# echo "TIMESTAMP_DURATION_HOURS=$((${TIMESTAMP_DURATION} / 3600))" >> $GITHUB_OUTPUT
# echo "TIMESTAMP_DURATION_MINUTES=$((${TIMESTAMP_DURATION} / 60))" >> $GITHUB_OUTPUT
# echo "TIMESTAMP_DURATION_SECONDS=$((${TIMESTAMP_DURATION} - (${TIMESTAMP_DURATION_MINUTES} * 60)))" >> $GITHUB_OUTPUT
# echo "DURATION_PHRASE=${TIMESTAMP_DURATION_HOURS}:${TIMESTAMP_DURATION_MINUTES}:${TIMESTAMP_DURATION_SECONDS}" >> $GITHUB_OUTPUT
# echo "DURATION_PHRASE=${TIMESTAMP_START}" >> $GITHUB_OUTPUT
# echo ::set-env name=DURATION_PHRASE::$(($TIMESTAMP_END - $TIMESTAMP_START))
echo "DURATION_PHRASE=$((${TIMESTAMP_END} - ${TIMESTAMP_START}))" >> $GITHUB_OUTPUT
# echo "DURATION_PHRASE=$(date +'%Y-%m-%d %H:%M:%S')" >> $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": "section",
"text": {
"type": "mrkdwn",
"text": ":white_check_mark: CI Build Status for playground-matrix\nStatus: *DONE* \n*Start:* ${{ steps.timer_start.outputs.DATE_START }}\n*End:* ${{ steps.timer_end.outputs.DATE_END }}\n*TIMESTAMP_START:* ${{ steps.timer_start.outputs.TIMESTAMP_START }}\n*TIMESTAMP_END:* ${{ steps.timer_end.outputs.TIMESTAMP_END }}\n*Duration:* ${{ steps.timer_end.outputs.DURATION_PHRASE }}\n*PR: *${{ github.event.pull_request.html_url || github.event.head_commit.url }}\n*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": "section",
"text": {
"type": "mrkdwn",
"text": ":warning: CI Build Status for playground-matrix:\nStatus: *FAILED* \n*Start:* ${{ steps.timer_start.outputs.DATE_START }}\n*End:* ${{ steps.timer_end.outputs.DATE_END }}\n*TIMESTAMP_START:* ${{ steps.timer_start.outputs.TIMESTAMP_START }}\n*TIMESTAMP_END:* ${{ steps.timer_end.outputs.TIMESTAMP_END }}\n*Duration:* ${{ steps.timer_end.outputs.DURATION_PHRASE }}\n*PR: *${{ github.event.pull_request.html_url || github.event.head_commit.url }}\n*Build:* ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}