v73.0.0 #59
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "CI" | |
on: | |
push: | |
branches: [ "develop" ] | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- ready_for_review | |
- review_requested | |
permissions: | |
contents: write | |
pull-requests: write | |
issues: write | |
repository-projects: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }} | |
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-resource: 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-resource" | |
} | |
}, | |
{ | |
"type": "section", | |
"fields": [ | |
{ | |
"type": "mrkdwn", | |
"text": "*Start:* <!date^${{ steps.timer_start.outputs.TIMESTAMP_START }}^{date} at {time}|${{ steps.timer_start.outputs.DATE_START }}>" | |
}, | |
{ | |
"type": "mrkdwn", | |
"text": "*End:* --" | |
} | |
] | |
}, | |
{ | |
"type": "section", | |
"fields": [ | |
{ | |
"type": "mrkdwn", | |
"text": "*Status:* IN PROGRESS" | |
}, | |
{ | |
"type": "mrkdwn", | |
"text": ":timer_clock: --" | |
} | |
] | |
}, | |
{ | |
"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 }}" | |
} | |
] | |
} | |
] | |
} | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
- uses: actions/checkout@v4 | |
- 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: "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 | |
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@v4 | |
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' | |
- uses: php-actions/phpstan@v3 | |
with: | |
level: 9 | |
php_version: "8.2" | |
path: config/ routes/ src/ tests/Feature/ tests/Unit/ | |
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 | |
echo "TIMESTAMP_END=$(date +'%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-resource: 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-resource" | |
} | |
}, | |
{ | |
"type": "section", | |
"fields": [ | |
{ | |
"type": "mrkdwn", | |
"text": "*Start:* <!date^${{ steps.timer_start.outputs.TIMESTAMP_START }}^{date} at {time}|${{ steps.timer_start.outputs.DATE_START }}>" | |
}, | |
{ | |
"type": "mrkdwn", | |
"text": "*End:* <!date^${{ steps.timer_end.outputs.TIMESTAMP_END }}^{date} at {time}|${{ 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": "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/[email protected] | |
with: | |
channel-id: "C068A06PV43" | |
update-ts: ${{ steps.slack.outputs.ts }} | |
payload: | | |
{ | |
"text": "CI Build Status for playground-matrix-resource: 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-resource" | |
} | |
}, | |
{ | |
"type": "section", | |
"fields": [ | |
{ | |
"type": "mrkdwn", | |
"text": "*Start:* <!date^${{ steps.timer_start.outputs.TIMESTAMP_START }}^{date} at {time}|${{ steps.timer_start.outputs.DATE_START }}>" | |
}, | |
{ | |
"type": "mrkdwn", | |
"text": "*End:* <!date^${{ steps.timer_end.outputs.TIMESTAMP_END }}^{date} at {time}|${{ 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": "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 }}" | |
} | |
] | |
} | |
] | |
} | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |