diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05f35e4..899c0b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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-matrix-resource: IN PROGRESS\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}", @@ -49,11 +49,11 @@ jobs: "fields": [ { "type": "mrkdwn", - "text": "*Start:*\n${{ steps.timer_start.outputs.DATE_START }}" + "text": "*Start:* " }, { "type": "mrkdwn", - "text": "*End:*\n--" + "text": "*End:* --" } ] }, @@ -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 }}" + } + ] } ] } @@ -102,16 +109,16 @@ jobs: version: "11.0" php_version: "8.2" php_extensions: intl xdebug + configuration: phpunit-ci.xml coverage_clover: clover.xml coverage_text: true - memory_limit: "256M" - name: Make code coverage badge uses: timkrase/phpunit-coverage-badge@v1.2.1 with: 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 @@ -122,7 +129,8 @@ jobs: with: level: 9 php_version: "8.2" - path: config/ routes/ src/ tests/Feature/ resources/views/ + path: config/ lang/ src/ tests/Feature/ + args: --verbose --debug - name: Stopping timer if: ${{ !cancelled() }} id: timer_end @@ -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: | { @@ -152,11 +161,11 @@ jobs: "fields": [ { "type": "mrkdwn", - "text": "*Start:*\n${{ steps.timer_start.outputs.DATE_START }}" + "text": "*Start:* " }, { "type": "mrkdwn", - "text": "*End:*\n${{ steps.timer_end.outputs.DATE_END }}" + "text": "*End:* " } ] }, @@ -174,18 +183,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": "primary", + "url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + } + ] } ] } @@ -193,9 +210,9 @@ jobs: 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: | { @@ -213,11 +230,11 @@ jobs: "fields": [ { "type": "mrkdwn", - "text": "*Start:*\n${{ steps.timer_start.outputs.DATE_START }}" + "text": "*Start:* " }, { "type": "mrkdwn", - "text": "*End:*\n${{ steps.timer_end.outputs.DATE_END }}" + "text": "*End:* " } ] }, @@ -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 }}" + } + ] } ] } diff --git a/phpunit-ci.xml b/phpunit-ci.xml new file mode 100644 index 0000000..6d0ae50 --- /dev/null +++ b/phpunit-ci.xml @@ -0,0 +1,76 @@ + + + + + tests/Unit + + + tests/Feature + + + + + + + + + + + + + + + + + + + + + + src + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 6d0ae50..4e90588 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -66,7 +66,7 @@ - + diff --git a/src/Http/Requests/FormRequest.php b/src/Http/Requests/FormRequest.php index 7e861bd..1a7b67c 100644 --- a/src/Http/Requests/FormRequest.php +++ b/src/Http/Requests/FormRequest.php @@ -1,9 +1,9 @@ >